Learn R Programming

berryFunctions (version 1.22.5)

dataStr: str of datasets

Description

Print the str of each dataset returned by data

Usage

dataStr(
  heads = FALSE,
  only = NULL,
  msg = heads,
  package = NULL,
  view = TRUE,
  ...
)

Value

invisible data.frame. If msg=TRUE, prints via message in a for loop.

Arguments

heads

Logical: display heads of all data.frames? If TRUE, only is ignored. DEFAULT: FALSE

only

Charstring class: give information only about objects of that class. Can also be TRUE to sort output by nrow/ncol DEFAULT: NULL (ignore)

msg

Logical: message str info? DEFAULT: FALSE

package

Package name. DEFAULT: NULL

view

Open dataframe with View (in Rstudio, if available)? DEFAULT: TRUE

...

Other arguments passed to data

Author

Berry Boessenkool, berry-b@gmx.de, November 2015, in search of good datasets for teaching

See Also

Examples

Run this code

if (FALSE)  ## View should not be used in examples
dataStr() # all loaded packages on search path (package=NULL)
# dataStr(package="datasets") # only datasets in base R package datasets
dataStr(only=TRUE) # sorted by nrow / ncol
d <- dataStr(only="data.frame") # data.frames only
sort(sapply(d$Object, function(dd) {sum(is.na(get(dd)))})) # datasets with NAs
head(d)
if(interactive()) View(d) # to sort in Rstudio Viewer
d[,c("Object","ncol","nrow")]

dataStr(heads=TRUE) # heads of all data.frames

# dataStr(package="hms") # no datasets in package


Run the code above in your browser using DataLab