keepr | R Documentation |
keepr is used to keep a list of variables in a dataframe (and to drop the rest). Inspired by the "keep" command in Stata.
keepr(mydf, ...)
mydf |
the dataframe to be modified. |
... |
a list of the variables to be kept. |
keepr is used internally by the fsm package.
mydf <- mtcars mydf <- keepr(mydf, "mpg", "cyl", "displ") mydf
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.