Hi,

Try:
spc.w <- to.weekly(spc)[,4]

instead of:
spc.w <- to.weekly(spc)

Regards,

-Mark-


2010/4/7 Hodgess, Erin <HodgessE@uhd.edu>

> Dear Finance People:
>
> I used the "get.hist.quote" to get the S&P as seen below:
>
> >  spc <- get.hist.quote(instrument = "^gspc", start = "1998-01-01",
> +               quote = "Close")
> trying URL 'http://chart.yahoo.com/table.csv?s=
> ^gspc&a=0&b=01&c=1998&d=3&e=05&f=2010&g=d&q=q&y=0&z=^gspc&x=.csv'
> Content type 'text/csv' length unknown
> opened URL
> .......... .......... .......... .......... ..........
> .......... .......... .......... .......... ..........
> .......... .......... .......... .......... ..........
> .......... .......... .......... ...
> downloaded 183 Kb
>
> time series starts 1998-01-02
>
>
> Then I use the to.weekly to convert to weekly data:
>
> > spc.w <- to.weekly(spc)
> > str(spc.w)
> An ‘xts’ object from 1998-01-02 to 2010-04-05 containing:
>  Data: num [1:641, 1:4] 975 977 939 979 957 ...
>  - attr(*, "dimnames")=List of 2
>  ..$ : NULL
>  ..$ : chr [1:4] "spc.Open" "spc.High" "spc.Low" "spc.Close"
>  Indexed by objects of class: [Date] TZ:
>  Original class: 'zoo'
>  xts Attributes:
>  NULL
> >
>
> My question is:  I  only need the "Close" section.  The other ones (Open,
> High, Low) are duplicates.  Is there a way just to return the Close
> component, please?
>
> thanks,
> Erin
>
>
>
> Erin M. Hodgess, PhD
> Associate Professor
> Department of Computer and Mathematical Sciences
> University of Houston - Downtown
> mailto: hodgesse@uhd.edu
>
>
>        [[alternative HTML version deleted]]
>
>
> _______________________________________________
> R-SIG-Finance@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions
> should go.
>

	[[alternative HTML version deleted]]

