Learn R Programming

rgr (version 1.0.4)

framework.summary: Generate and Save Framework/Subset Summary Statistics

Description

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.

Usage

framework.summary(group, x, file = NULL)

Arguments

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.

Details

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.

See Also

framework.stats, ltdl.fix.df, remove.na

Examples

Run this code
## 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)

Run the code above in your browser using DataLab