Learn R Programming

rgr (version 1.1.15)

gx.ngr.summary: Saves a NGR Report Summary Statistics Table to a .csv File

Description

Prepares a .csv file with the standard set of NGR Report summary statistics for further processing with a spread sheet program. The table includes: N (data set size), number of NAs, mean, SD, skew, CV%, geometric mean, median, MAD, robust CV%, and the miniumum and maximum values and 17 intermediate percentiles.

Usage

gx.ngr.summary(xmat, vars, banner = deparse(substitute(xmat)),
	file = NULL)

Arguments

xmat

name of the matrix or data frame.

vars

the indices, or names (see Example), of the columns of the matrix or data frame for the variables whose summary statistics are to be displayed.

banner

by default the character string for xmat, the input matrix, is used in the file name. An alternate title can be displayed with banner = "text string", see Details below.

file

the name of the folder where the files are 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.

Details

The file name is synthesized by concatenating the input matrix name and ‘_NGR_Summary.csv’, and prefixed by sQuote/. If a data frame is the data source, the synthesize file name will be ‘/dataframe_NGR_Summary.csv’, as it is not possible to obtain the text string for the data frame name from xmat. In such cases the user should rename the .csv file mpre appropriately after it has been saved. 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.

See Also

gx.ngr.stats, gx.stats, gx.ngr.skew, ltdl.fix.df, remove.na, gx.summary1, gx.summary2

Examples

Run this code
# NOT RUN {
## Make test data available
data(sind.mat2open)

## Prepare and export a .csv file 
gx.ngr.summary(sind.mat2open)
# }

Run the code above in your browser using DataLab