Description Usage Arguments Details Value Note See Also Examples
mcsv_w
- Read and assign multiple csv files at the
same time.
mcsv_w
- Write multiple csv files into a file at
the same time.
1 2 3 |
files |
csv file(s) to read. |
a.names |
object names to assign the csv file(s) to. If NULL assigns the csv to the name(s) of the csv file(s) in the global environment. |
l.name |
A character vector of names to assign to the csv files (dataframes) being read in. Default (NULL) uses the names of the files in the directory without the file extension. |
list |
A character vector of length one to name the
list being read in. Default is |
... |
data.frame object(s) to write to a file |
dir |
optional directory names. If NULL a directory will be created in the working directory with the data and time stamp as the folder name. |
open |
logical. If TURE opens the directory upon completion. |
mcsv is short for "multiple csv" and the suffix c(_r, _w) stands for "read" (r) or "write" (w).
mcsv_r
- reads in multiple csv files at once.
mcsv_w
- creates a directory with multiple csv
files. Silently returns the path of the directory.
mcsv_r
is useful for reading in multiple csv files
from cm_csv.temp
for interaction with
cm_range2long
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #mcsv_r EXAMPLE:
mtcarsb <- mtcars[1:5, ]; CO2b <- CO2[1:5, ]
(a <- mcsv_w(mtcarsb, CO2b, dir="foo"))
rm("mtcarsb", "CO2b") # gone from .GlobalEnv
(nms <- dir(a))
mcsv_r(paste(a, nms, sep="/"))
mtcarsb; CO2b
rm("mtcarsb", "CO2b") # gone from .GlobalEnv
mcsv_r(paste(a, nms, sep="/"), paste0("foo.dat", 1:2))
foo.dat1; foo.dat2
rm("foo.dat1", "foo.dat2") # gone from .GlobalEnv
delete("foo")
#mcsv_w EXAMPLE:
(a <- mcsv_w(mtcars, CO2, dir="foo"))
delete("foo")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.