You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Example from xportr_metadata() runs fine without metadata:
metadata <- data.frame(
dataset = "test",
variable = c("Subj", "Param", "Val", "NotUsed"),
type = c("numeric", "character", "numeric", "character"),
format = NA,
order = c(1, 3, 4, 2)
)
adlb <- data.frame(
Subj = as.character(123, 456, 789),
Different = c("a", "b", "c"),
Val = c("1", "2", "3"),
Param = c("param1", "param2", "param3")
)
xportr_metadata(adlb, metadata, "test")
xportr_metadata(adlb, domain = "test") # metadata will be NULL
Example from xportr_type() gives an error if metadata is not set prior with xportr_metadata() or explicitly in call to type:
metadata <- data.frame(
dataset = "test",
variable = c("Subj", "Param", "Val", "NotUsed"),
type = c("numeric", "character", "numeric", "character")
)
.df <- data.frame(
Subj = as.character(123, 456, 789),
Different = c("a", "b", "c"),
Val = c("1", "2", "3"),
Param = c("param1", "param2", "param3")
)
# These two work fine
xportr_type(.df, metadata, "test")
xportr_metadata(.df, metadata, "test") %>%
xportr_type()
# This tells you to set metadata somewhere, even though the `metadata` default is NULL
xportr_type(.df, domain = "test")
Given that the error is descriptive, and dropping the NULL default for metadata would complicate some pipelines that xportr_metadata() is meant to simplify, we're leaving this as is for now. It will be revisited in the next development push.
The text was updated successfully, but these errors were encountered: