View source: R/createAccessor.R
createAccessor | R Documentation |
Create Function to Safely Access Data Frame Columns or List Elements
createAccessor(x)
x |
a data frame or a list |
getcol <- createAccessor(data.frame(a = 1:2, b = 2:3))
getcol("a")
getcol("b")
getcol(c("b", "a"))
# getcol("c") # error with info about existing columns
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.