trimTable | R Documentation |
Downloaded spreadsheets sometimes contain empty columns at the end. This function removes all of the columns after the give column.
trimTable(tab, lastcol = "Description")
tab |
A matrix, data frame or tibble to be trimmed). |
lastcol |
The name of the last column to keep. Any column to the right of this one will be discarded. |
The first several columns of the table.
Russell Almond
read.csv
dat <- data.frame(One=1:3,Two=4:6,Three=7:9,10:12)
trimmed <- trimTable(dat,"Three")
stopifnot (ncol(trimmed)==3L)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.