Hi Bert,
thanks for your advice on lapply which I am still not very familair with.
With regard from the issue of the names I realised that I can simply call
names on the data.frame and then join them with other strings through paste
and add them to the data.frame by using the [] syntax rather than
1. This won't work. The lagged variables have length one less than the
originals.
2. How about:
lagged_Q <- data.frame( lapply( QuarterlyData,diff))
You can then change the names in lagged_Q to something like
lagged_originalName via paste() if you like.
3. I strongly suspect that none of this i
Hello,
I would like to create lagged and delta variables from a set of variables
and then add them to a dataframe
Suppose that GDPPcSa is a variable. I would like to be able to do this
QuarterlyData$D1GdpPcSa = diff(GDPPcSa , 1)
in an automated fashion so that I loop over Quartely data to compu
3 matches
Mail list logo