0

I have to run an API download function for several countries separately. My variables are strings that I read in from an Excel-list. Each observation is identified by a three letter country identifier(codes[i,1]). Ideally, I would want to do this:

codes = read.xls("data.xlsx")

for(i in 1:50) {
codes[i,1] = Quandl(c(toString(codes[i,2]),toString(codes[i,3]),toString(codes[i,4])), collapse="annual")
}

obviously, codes[i,1] = ... doesn't work. Is there a simple solution to this problem. Performance isn't a major concern. Thanks for your help.

1 Answer 1

2
codes = read.xls("data.xlsx")

for(i in 1:50) {
assign(codes[i,1], Quandl(c(toString(codes[i,2]),toString(codes[i,3]),toString(codes[i,4])), collapse="annual"))
}

Try that.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.