![]() ![]() or by name, and drop the offensive first column concat.split ( temp, "Likes", drop = TRUE ) # The "Hates" column uses a different separator concat.split ( temp, "Hates", sep = " ", drop = TRUE ) # Not run: # You'll get a warning here, when trying to retain the original values concat.split ( temp, 2, mode = "value", drop = TRUE ) # End(Not run) # Try again. # Load some data temp <- head ( concat.test ) # Split up the second column, selecting by column number concat.split ( temp, 2 ) #. The features available in the separated functions of cSplit(), cSplit_l(),ĬSplit(), cSplit_l(), cSplit_e() Examples This is more of a "legacy" or "convenience" wrapper function encompassing Sep = "", and fixed = FALSE to split on any of those characters. ForĮxample, to split on ",", " ", or "|", you can set sep = ",| |\|" or Supply a a regular expression containing the characters to split on. When structure = "expanded" or structure = "list", it is possible to "list" creates a single new column that is structurally a list within a When the input is numeric, "expanded" creates as many columns as the This is the most useful general-case application of this function. "compact" creates as many columns as the maximum length of the resulting The "fill" value for missing values when structure = "expanded". Is the input for the sep value fixed, or a regular Logical (whether to remove the original variable from the output Message will be issued if used with other structures. ![]() This setting only applies when structure = "expanded" a warning Structure = "expanded" a warning message will be issued if used with otherĬan be either "numeric" or "character" (where "numeric" isĭefault). DefaultsĬan be either "binary" or "value" (where "binary" is defaultĪnd it recodes values to 1 or NA, like Boolean data, but without assuming 0 The character separating each value (defaults to ",").Ĭan be either "compact", "expanded", or list. The variable that needs to be split can be specifiedĮither by the column number or the variable name. stratified: Take a Stratified Sample From a DatasetĬoncat.split ( data, l, sep = ",", structure = "compact", mode = NULL, type = NULL, drop = FALSE, fixed = FALSE, fill = NA.Stacked: Stack Columns from a Wide Form to a Long Form.splitstackshape-package: splitstackshape.Reshape: Reshape Wide Data Into a Semi-long Form.ncat: Read Concatenated Character Vectors Into a ame.othernames: Extract All Names From a Dataset Other Than the Ones Listed.numMat: Create a Numeric Matrix from a List of Values.NoSep: Split Basic Alphanumeric Strings Which Have No Separators.Names: Dataset Names as a Character Vector, Always.merged.stack: Take a List of Stacked data.tables and Merge Them.listCol_w: Flatten a Column Stored as a List. ![]() listCol_l: Unlist a Column Stored as a List.getanID: Add an "id" Variable to a Dataset.FacsToChars: Convert All Factor Columns to Character Columns.expandRows: Expand the Rows of a Dataset.cSplit: Split Concatenated Values into Separate Values. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |