This is probably stupid but i've not been able to see a solution.
When downloading FRED data it has horrible names such as
FranceExports <<- getSymbols("FRAXTEXVA01CXMLM", src = "FRED", auto.assign = FALSE)
I want to put a lot of data in a data.table
eu <- data.table( FranceExports , GermanyExports, ... )
but the table returns
head(FranceExports)
FRAXTEXVA01CXMLM
1960-01-01 595665297
1960-02-01 610479446
1960-03-01 612014108
1960-04-01 559989074
1960-05-01 579246653
1960-06-01 557069763
> eu <- data.table(FranceExports)
> head(eu)
FRAXTEXVA01CXMLM
1: 595665297
2: 610479446
3: 612014108
4: 559989074
5: 579246653
6: 557069763
Clearly I want to be able to access eu$FranceExports, not eu$FRAXTEXVA01CXMLM
> eu$FranceExports
NULL
I'm still new to R, so what I have figured out is that FranceExports is just a reference to the original data structure. Fine, I get that. And that env = userdata looks for a frame or table to put the data into, but it still doesn't simply change the name so that I can reference it directly.
So, how can I easily do this (easy, because there are a lot of EU countries with a lot of data ^^)
===== Apropos Convo with Louis below ==== Now each series looks like this
if (!exists("NetherlandsExports")) NetherlandsExports <<- getSymbols("NLDXTEXVA01CXMLM", src = "FRED", auto.assign = FALSE)
colnames(eu)[colnames(eu) == "NLDXTEXVA01CXMLM"] <- "NetherlandsExports"
if (!exists("GermanyExports")) SpainExports <<- getSymbols("ESPXTEXVA01CXMLM", src = "FRED", auto.assign = FALSE)
colnames(eu)[colnames(eu) == "GRCXTEXVA01CXMLM"] <- "GreeceExports"