Quantcast
Channel: Active questions tagged xts - Stack Overflow
Viewing all articles
Browse latest Browse all 57

How to access xts column by name in a function in R?

$
0
0

How would I access an xts column by name in a function? The code below returns NULL.

#m(list=ls())#dev.off(dev.list()["RStudioGD"])getSymbols("^GSPC",src="yahoo",from="2015-01-01",to = "2020-06-04")str(GSPC)frog<-function(ts,name) {    ts$name}frog(GSPC,"GSPC.Close")

Viewing all articles
Browse latest Browse all 57

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>