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

Description Usage Arguments Details Note Author(s) See Also Examples

View source: R/framework.summary.R

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

1

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 name of the folder where the file is to be saved, a ‘/’ is appended before the synthesized file name, details of which are displayed on the current device. If no file is specified, the files are saved to the Working Directory, see Details below.

Details

The file name is synthesized by concatenating the data frame name, group and variable, x, names, separated by _s, and
.csv. If a folder name has been provided in file, for example, file = "D://R_work//Project3", a ‘/’ is appended prior to the synthesized file name.

The file name for the .csv file is displayed on the current device, and all other output is suppressed. The output file can be inspected with spread sheet software or a viewer of the user's choice.

Note

The synthesis of the file name uses the data frame name which it is assumed is located in search() position [[2]].

To set the R working directory, if it has not already been set in a first function, use at the R command line, for example, setwd("C:\R\WDn"), where ‘n’ is some number, which will result in all saved output being placed in that folder. The folder must be created before the R session commences.

Any less than detection limit values represented by negative values, or zeros or other numeric codes representing blanks in the data, must be removed prior to executing this function, see ltdl.fix.df.

Any NAs 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.

Author(s)

Robert G. Garrett

See Also

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## 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)

## Detach test data
detach(kola.c)  

rgr documentation built on May 2, 2019, 6:09 a.m.

Related to framework.summary in rgr...