I have a function f that accepts two arguments, a and b. I have a list of values x that I’d like to plug in for a, while b is fixed. In Ruby, I’d use map, as in:
x.map {|el| f(el,3) }
How do you write this in R?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
edited: fixed argument order
Something like
lapply(x,f,b=3)(orsapply())