Learn R Programming

fuj (version 0.2.1)

alias_extract: Extract and replace aliases

Description

Extract and replace aliases

Arguments

Value

See base::Extract

Examples

Run this code
df <- quick_dfl(a = 1:5, b = 6:10)
# alias of `[`
subset1(df, 1)
subset1(df, 1, )
subset1(df, , 1)
subset1(df, , 1, drop = FALSE)

# alias of `[[`
subset2(df, 1)
subset2(df, 1, 2)

# alias of `$`
subset3(df, a)
subset3(df, "b")
subset3(df, "foo")

# alias of `[<-`
subassign1(df, "a", , 2)

Run the code above in your browser using DataLab