I have a function h(n) that returns values for each integer 1 =< n =< k.
How can I construct a list of the form (h(1), h(2), h(3), ...) where k is large so doing this manually will take some time.
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.
Without your function, I don’t know for sure, but
lapply(1:k, h)should take every value between 1 and k and send it to your function and return them in a list.P.S. This isn’t homework is it?