rm_empty | R Documentation |
reorder_name
: reorder the name of data.frame, date.table or list.
rm_empty(x)
reorder_name(
d,
headvars = c("site", "date", "year", "doy", "d8", "d16"),
tailvars = ""
)
contain(d, pattern = "NDVI|EVI")
x |
A vector or list |
d |
A data.frame vector, or list |
headvars |
headvars will be in the head columns. |
tailvars |
tailvars will be in the tail columns. |
pattern |
string used to match |
# numeric
x <- c(1:5, NA)
rm_empty(x)
# list
l <- list(1:5, NULL, NA)
rm_empty(l)
df <- data.frame(year = 2010, day = 1:3, month = 1, site = "A")
dt <- data.table::data.table(year = 2010, day = 1:3, month = 1, site = "A")
l <- list(year = 2010, day = 1:3, month = 1, site = "A")
newname <- c("site", "year")
reorder_name(df, newname)
reorder_name(dt, newname)
reorder_name(l, newname)
df <- data.frame(year = 2010, day = 1:3, month = 1, site = "A")
contain(df, "year|month|day")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.