One more question, that will get me going. 

temp <- xts(1:84, timeCalendar(m=1, d=rep(1:7,each=12),h = seq(0,23,2)))

I need to add named column, say SMA(temp)

nice way to do this is temp$sma <- SMA(temp)

however it is inside a function and it might have different SMAs, so I want to adda column named paste0("sma.",n)

temp$paste0("sma.",n) <- SMA(temp)
temp[,paste0("sma.",n)] <- SMA(temp) 

does not work

it is an option to use merge 
merge(temp,SMA(temp))
and then colnames

However my question is whether it is possible to use temp$paste0("sma.",n) <- SMA(temp) in some way.
I tried  temp$as.name(paste0("sma.",n)) and similar options...

Thank you.

Kind regards,-- 
Dominykas Grigonis


	[[alternative HTML version deleted]]

