prompt.acs: Prompt for new values for metadata in an acs object.

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

Description

Helper function to interactively set new values for row- and/or column-names in an acs object.

Usage

1
2
3
## S3 method for class 'acs'
prompt(object, filename=NA, name=NA, what="acs.colnames",
geocols="all", ...)

Arguments

object

an acs object

filename

not used; provided for S3 generic/method consistency

name

not used; provided for S3 generic/method consistency

what

which acs-class metadata slot to prompt for; either "acs.colnames" (the default), "acs.units", or "geography"

geocols

a vector, or "all", specifying which columns from the geography metadata to prompt for (optional; defaults to "all"; ignored when what="acs.colnames")

...

not used; provided for S3 generic/method consistency

Details

The acs package provides this S3 prompt method for acs-class objects, primarily as a "helper" function to use in calls to geography(object)<-, acs.units(object)<-, or acs.colnames(object)<-. prompt provides an interactive interface, prompting the user for new metadata values based on the existing ones.

When what="geography" and geocols is not "all", prompt will only prompt for replacements of the values of geocols, but will still return values for all geography columns, suitable for passing to geography(object)<-.

Anytime during the interactive prompt() session, a user may enter a blank line to terminate, returning only the changed values up to that point (along with the unchanged values for remaining entries.)

Value

Returns a value of the same class and dimensions as the current geography, acs.units, or acs.colnames of object, but with new names, suitable for passing to one of the replacement methods (acs.colnames<-, (acs.units<-, or geography<-).

Author(s)

Ezra Haber Glenn eglenn@mit.edu

See Also

geography<-

acs.colnames<-

acs.units<-

Examples

1
2
3
4
5
data(kansas07)

acs.colnames(kansas07)=prompt(kansas07, what="acs.colnames")

geography(kansas07)=prompt.acs(kansas07, what="geography")

acs documentation built on May 1, 2019, 8:41 p.m.