[prev in list] [next in list] [prev in thread] [next in thread]
List: r-sig-finance
Subject: Re: [R-SIG-Finance] quantmod getSymbols data extraction issue -
From: julien cuisinier <j_cuisinier () hotmail ! com>
Date: 2010-02-16 11:40:04
Message-ID: COL102-W58CF013521635355111F9A8F490 () phx ! gbl
[Download RAW message or body]
to all who answered already, many thanks for the very quick & useful feedback.
putting this in the mailing list for posterity if any interest.
question 1 (number in symbols to extract) was solved using auto.assign=FALSE
> ArrTickersPort
[,1]
[1,] "3IN.L"
[2,] "BG.L"
[3,] "3IN.L"
[4,] "RBSI.L"
> ID <- getSymbols(ArrTickersPort[1,1],from="2010-02-01",auto.assign=FALSE)
> ID
3IN.L.Open 3IN.L.High 3IN.L.Low 3IN.L.Close 3IN.L.Volume
2010-02-01 102.5 104.4 102.5 104.20 470200
2010-02-02 103.6 106.0 103.6 105.90 859500
2010-02-03 106.0 106.0 105.0 105.60 1748700
2010-02-04 105.3 105.5 102.7 103.40 2031600
2010-02-05 103.8 103.9 102.1 103.30 1291100
2010-02-08 103.7 104.6 103.4 104.50 413400
2010-02-09 104.1 105.4 103.7 104.87 647100
2010-02-10 105.5 105.6 105.0 105.50 631100
2010-02-11 105.0 105.6 104.7 105.10 1052500
2010-02-12 104.9 105.6 103.2 103.60 408900
2010-02-15 104.4 105.4 103.7 105.20 291600
3IN.L.Adjusted
2010-02-01 104.20
2010-02-02 105.90
2010-02-03 105.60
2010-02-04 103.40
2010-02-05 103.30
2010-02-08 104.50
2010-02-09 104.87
2010-02-10 105.50
2010-02-11 105.10
2010-02-12 103.60
2010-02-15 105.20
question 2 (access the data without calling the symbol itself) was solved using \
OHLC.transformation thanks to solution question 1
> Ad(ID)
3IN.L.Adjusted
2010-02-01 104.20
2010-02-02 105.90
2010-02-03 105.60
2010-02-04 103.40
2010-02-05 103.30
2010-02-08 104.50
2010-02-09 104.87
2010-02-10 105.50
2010-02-11 105.10
2010-02-12 103.60
2010-02-15 105.20
Many thanks again for this help
Rgds,
Julien
> Subject: Re: [R-SIG-Finance] quantmod getSymbols data extraction issue - (1)symbol \
> starting with number & (2) accessing data from multiple symbolslookup (through \
> simple loop?)
> To: j_cuisinier@hotmail.com
> CC: cedrick@cedrickjohnson.com
> From: cedrickj@gmail.com
> Date: Tue, 16 Feb 2010 11:14:42 +0000
>
> To answer q 1 try adding in auto.assign=FALSE to the call and defining a variable. \
> R by design doesn't like variables starting with a number.
> MySym = getSymbols("3IN.L", auto.assign=FALSE)
>
> Hth, cedrick
>
> Sent from my BlackBerry® by Boost Mobile
>
> -----Original Message-----
> From: julien cuisinier <j_cuisinier@hotmail.com>
> Date: Tue, 16 Feb 2010 12:07:38
> To: <r-sig-finance@stat.math.ethz.ch>
> Subject: [R-SIG-Finance] quantmod getSymbols data extraction issue - (1)
> symbol starting with number & (2) accessing data from multiple symbols
> lookup (through simple loop?)
>
>
> Dear List,
>
>
> I have two issues using quantmod (no need to confirm how good this package is) to \
> extract data from yahoo finance.
> For the record: R 2.9.2 with REvolution enhancement installed (for that matters...) \
> under Ubuntu 9.10, library quantmod loaded & working My googling having been \
> unsuccessful till now, I hope I did not miss an obvious post or solution.
> 1. ticker starting with a number:
> > library(quantmod)
> > getSymbols("3IN.L",from="2010-02-01")
> [1] "3IN.L"
> > 3IN.L
> Error: unexpected symbol in "3IN.L"
>
> The same appear with other tickers starting with numbers (e.g. ICBC, ticker \
> 1398.HK) While it functions perfectly with symbols starting with a letter (could \
> not find any starting with letter & containing a number in it to test)
> and if one try
> > is.xts(3IN.L)
> Error: unexpected symbol in "is.xts(3IN.L"
>
> so the xts object does not seem to have been created?
> For information, the same behaviour appear on another computer (R 2.10.1 under \
> macosx 10.5.8)
>
> 2. Loading multiple symbols from vector/matrix - accessing data
> Assuming I have the following matrix
> > ArrTickersPort
> [,1]
> [1,] "3IN.L"
> [2,] "BG.L"
> [3,] "3IN.L"
> [4,] "RBSI.L"
> > getSymbols(ArrTickersPort[2,1],from="2010-02-01")
> [1] "BG.L"
>
> This functions, so I could (very basically) loop through my matrix of ticker & \
> extract data for each of them But at this stage, how can I extract the data \
> downloaded by getSymbols in the xts object "BG.L" without actually calling it? i.e. \
> I want to be able to extract te data from the object referencing it by \
> "ArrTickersPort[i,j]"
>
>
> Many thanks for any feedback / direction on those issues.
>
>
> Best regards,
> Julien
>
>
>
>
>
>
> _________________________________________________________________
> Hotmail: Vertrauenswürdige E-Mails dank dem leistungsstarken SPAM-Schutz von \
> Microsoft.
> [[alternative HTML version deleted]]
>
>
_________________________________________________________________
nlos herunter.
[[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.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic