Learn R Programming

rgr (version 1.1.7)

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

A default file name is generated from the data frame, group and variable (x) names, data frame name_deparse(substitute(group))_deparse(substitute(x)).csv. If file contains text it is used as the first part of the file name identifying the data source for the file to be saved in the specified folder, for example, file = "D://R_work//Project3//C_soils". If no folder is specified the file is saved in the R working directory. 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_horizon")

## Detach test data
detach(kola.c)

Run the code above in your browser using DataLab