splitdata {CTFS} | R Documentation |
THIS FUNCTION WILL BE DELETED IN FUTURE RELEASES AND REPLACED BY :
sep.data
and sep.vct.data
. See
CTFS.readwrite
and CTFS.groupcats
for a
description of replacement functions.
Creates a list from a dataframe with each dataframe being the rows from the orignial file that have the same value for the split variable. There are as many dataframes in the list as there are valid values for the split variable.
splitdata(census1, split = census1$sp, allsplit = unique(split))
census1 |
any “dataframe” |
split |
any column name in the dataframe |
allsplit |
a unique set of values of split |
Different columns of the census1
can be defined by using
the format: census1$columnname
. In this case DO NOT USE
QUOTES. Do not ever provide a different parameter value for
allsplit
. As seen from the usage, allsplit
is the
result of a function, not a user defined parameter. The values of
the split are sorted alphabetically and missing values, including
“.” are provided.
This function is very useful for turning any dataframe into a
list of the same records. For instance, taking the *.full dataset
and creating the *.spp dataset.
The function sends a message to the terminal to indicate the
progress is it making on each value of the split
variable.
Returns a list of dataframes with tree records from one or more census1es
Rick Condit
## Not run: # make the bci95.spp from bci95.full tst.out.1 <- splitdata("tst.bci90.full") # note this file is identical to the results of sep.data tst.out.2 <- sep.data("tst.bci90.full") identical(tst.out.1, tst.out.2) # specifying a different column in the census tst.out.codes <- splitdata("tst.bci90.full",split=tst.bci90.full$codes) ## End(Not run)