Re: [R] Accessing specific data.frame columns within function

2016-02-05 Thread Greg Snow
You are trying to use shortcuts where shortcuts are not appropriate and having to go a lot longer around than if you did not use the shortcut, see fortune(312). You should really reread the help page: help("[[") and section 6.1 of An Introduction to R. Basically you should be able to do something

Re: [R] Accessing specific data.frame columns within function

2016-02-04 Thread Ulrik Stervbo
Hi Clark, In your function you are using the variable 'y' and not 'data'. If this indeed is your intention, there is no need to pass 'data' to your function, otherwise all 'y's in your function should be 'data'. Does this work for you: f <- function(data, oldnames, subset.val = 4){ data <- dat