framework.summary {rgr} | R Documentation |
Function to generate ‘framework’ or subset summary statistics and save them as a .csv file in the R working directory. The file can be directly imported into a spreadsheet, e.g., MS Excel, for inspection, or into other software, e.g., a Geographical Information System (GIS) where the spatial information concerning the ‘framework’ units is available, e.g., ecoclassification units.
framework.summary(group, x, file = NULL)
group |
the name of the factor variable by which the data are to be subset. |
x |
name of the variable to be processed. |
file |
the first part of the file name identifying the data source for saving the function output in the R working directory, see Details below. |
file
contains the first part of the file name identifying the data source for the output file to be saved in the R working directory, see Note below. The function concatenates the working directory name with file
, _
, group
as a character string, _
, x
as a character string, and _summary.csv
to be used as the file name.
Output to the current device is suppressed. The output file can be inspected with spread sheet software or a viewer of the user's choice.
To set the R working directory, use at the R command line, for example, setwd("C:\\R\\WDn")
which will result in all saved output being placed in that folder.
Any less than detection limit values represented by negative values, or zeros or other numeric codes representing blanks in the data vector, must be removed prior to executing this function, see ltdl.fix.df
.
Any NA
s in the data vector are counted and then removed prior to computing the summary statistics.
The function framework.stats
is employed to compute the summary statistics.
Robert G. Garrett
framework.stats
, ltdl.fix.df
, remove.na
## Make test data available data(kola.c) attach(kola.c) ## Saves the file kola_c_COUNTRY_Cu_summary.csv for later use ## in the R working directory. framework.summary(COUNTRY, Cu, file = "kola_c") ## Detach test data detach(kola.c)