View source: R/explicit_guide.R
implicit_guide.dvec | R Documentation |
Coerces dvec guide-like attributes to 'guide'.
The attribute 'guide' generally suggests a guide
to interpretation of a data item, such as units, formats, codelists,
and encodings. The idea here is to replace these with 'guide':
i.e., to undo the effects of explicit_guide.dvec
.
If guide attribute is still present, the explicit attribute is removed.
Otherwise the explicit element is renamed.
## S3 method for class 'dvec'
implicit_guide(x, ...)
x |
dvec |
... |
ignored |
dvec
Other explicit_guide:
explicit_guide()
,
explicit_guide.data.frame()
,
explicit_guide.dvec()
,
explicit_guide.yamlet()
,
implicit_guide()
,
implicit_guide.data.frame()
,
infer_guide()
Other dvec:
[.dvec()
,
[<-.dvec()
,
[[.dvec()
,
[[<-.dvec()
,
as.data.frame.dvec()
,
as_dvec()
,
as_dvec.character()
,
as_dvec.complex()
,
as_dvec.dvec()
,
as_dvec.integer()
,
as_dvec.logical()
,
as_dvec.numeric()
,
c.dvec()
,
classified.dvec()
,
desolve.dvec()
,
explicit_guide.data.frame()
,
format.dvec()
,
length.dvec()
,
print.dvec()
,
resolve.classified()
,
resolve.dvec()
,
unclassified.dvec()
library(magrittr)
x <- data.frame(
ID = as_dvec(1),
CONC = as_dvec(1),
RACE = as_dvec(1),
SEX = as_dvec(1),
DATE = as_dvec(1)
)
x %<>% modify(ID, label = 'subject identifier')
x %<>% modify(CONC, label = 'concentration', guide = 'ng/mL')
x %<>% modify(RACE, label = 'race', guide = list(white = 0, black = 1, asian = 2))
x %<>% modify(SEX, label = 'sex', guide = list(female = 0, male = 1))
x %<>% modify(DATE, label = 'date', guide = '%Y-%m-%d')
x %>% decorations
x %>% explicit_guide %>% decorations
x %>% explicit_guide %>% implicit_guide %>% decorations
x %>% explicit_guide %>% implicit_guide(DATE) %>% decorations # limit scope
x %>% explicit_guide(simplify = FALSE) %>% decorations
x %>% explicit_guide(simplify = FALSE) %>% implicit_guide %>% decorations
x %<>% explicit_guide
a <- x$DATE
str(a)
str(a %>% implicit_guide)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.