Description Usage Arguments Details Value Note See Also Examples
mcsv_r
- 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 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
files |
csv file(s) to read. |
a.names |
object names to assign the csv file(s) to. If |
l.name |
A single character string of a name to assign to the list if
dataframes created by the csv files being read in. Default ( |
list |
logical. If |
pos |
where to do the removal. By default, uses the current environment. |
envir |
the environment to use. |
... |
data.frame object(s) to write to a file or a list of data.frame
objects. If the objects in a list are unnamed V + digit will be assigned.
Lists of dataframes (e.g., the output from |
dir |
optional directory names. If |
open |
logical. If |
sep |
A character string to separate the terms. |
dataframes |
An optional character vector of dataframes in lieu of ... argument. |
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_df.temp
for interaction with
cm_range2long
.
cm_range2long
,
cm_df.temp
,
condense
,
assign
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | ## Not run:
## 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(file.path(a, nms))
mtcarsb; CO2b
rm("mtcarsb", "CO2b") # gone from .GlobalEnv
mcsv_r(file.path(a, nms), paste0("foo.dat", 1:2))
foo.dat1; foo.dat2
rm("foo.dat1", "foo.dat2") # gone from .GlobalEnv
delete("foo")
## mcsv_w EXAMPLES:
(a <- mcsv_w(mtcars, CO2, dir="foo"))
delete("foo")
## Write lists of dataframes as well
poldat <- with(DATA.SPLIT, polarity(state, person))
term <- c("the ", "she", " wh")
termdat <- with(raj.act.1, termco(dialogue, person, term))
mcsv_w(poldat, termdat, mtcars, CO2, dir="foo2")
delete("foo2")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.