dataStr | R Documentation |
Print the str
of each dataset returned by data
dataStr(
heads = FALSE,
only = NULL,
msg = heads,
package = NULL,
view = TRUE,
...
)
heads |
Logical: display heads of all data.frames?
If TRUE, |
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 |
... |
Other arguments passed to |
invisible data.frame. If msg=TRUE
, prints via message
in a for loop.
Berry Boessenkool, berry-b@gmx.de, November 2015, in search of good datasets for teaching
str
## Not run: ## 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
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.