drop_unspec_vars | R Documentation |
This function drops all unspecified variables. It will throw and error if the dataset does not contain all expected variables.
drop_unspec_vars(dataset, metacore, dataset_name = NULL)
dataset |
Dataset to change |
metacore |
metacore object that only contains the specifications for the dataset of interest. |
dataset_name |
Optional string to specify the dataset. This is only needed if the metacore object provided hasn't already been subsetted. |
Dataset with only specified columns
library(metacore)
library(haven)
library(dplyr)
load(metacore_example("pilot_ADaM.rda"))
spec <- metacore %>% select_dataset("ADSL")
data <- read_xpt(metatools_example("adsl.xpt")) %>%
select(USUBJID, SITEID) %>%
mutate(foo = "Hello")
drop_unspec_vars(data, spec)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.