Re: [R-SIG-Finance] Extracting data from a web
On Thu, 30 Jul 2020 at 21:31, Pedro páramo wrote: > I want to folow a fund and I see I can obtain data from here but I have to > Mark the dates on the web previously, there is no a txt ir CSV, is there a > way to extract the values from a line in a .R on a web like this? > Try using XML::htmlTreeParse(). The line data seems to be coded very nicely in a `` and a few `` with a tagged `class`. [[alternative HTML version deleted]] ___ R-SIG-Finance@r-project.org 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.
Re: [R-SIG-Finance] time format convert
On 29 September 2014 09:18, jun wang wrote: > Dear all, > > I have the following data format: > > x > 2012-02-24 10:10:00 1.267113e-05 > 2012-02-27 10:10:00 2.397383e-05 > 2012-02-28 10:10:00 2.576296e-05 > 2012-02-29 10:10:00 4.171427e-05 > 2012-03-01 10:10:00 3.855354e-05 > 2012-03-02 10:10:00 2.446517e-05 > 2012-03-05 10:10:00 2.565693e-05 > 2012-03-06 10:10:00 2.137300e-05 > 2012-03-07 10:10:00 1.953491e-05 > 2012-03-08 10:10:00 1.425474e-05 > > I was wondering if there is any way to convert this into the following > format,basically get rid of the time,just keep the data. Convert timestamps to a time based object if they are not already and use format() to only pull out the dates. -- Chirag Anand http://atvariance.in/chiraganand ___ R-SIG-Finance@r-project.org 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.
Re: [R-SIG-Finance] Aligning time series
Hi Mikhail, As Ilya said, xts takes care of it. You can use "merge.zoo" (if using zoo) or "merge.xts" to merge two series. The missing timestamps are taken care of by the "all" argument. You can use it to specify whether to take missing timestamps from both the series, an individual series, or not at all. The details are available in the respective man pages of the functions. On 16 April 2014 00:39, Ilya Kipnis wrote: > Mikhail, are you using the xts package? Because when you cbind two xts time > series, it takes care of alignment for you. > > -Ilya > > > On Tue, Apr 15, 2014 at 12:07 PM, Mikhail Beketov < > mikhailbeke...@googlemail.com> wrote: > >> Hello, >> I have to analyze a large data-set of 1-min stock prices. The problem is >> that the time-series for different stocks in my data-set have different >> length, as some time points are missing in one series but present in >> another etc. So, I have to create a table with aligned time series (all >> dates/times should correspond to all the stocks). My questions are: >> 1) Is there some efficient way to do it? Is there anything that is already >> programmed. >> 2) Does it make sense to align all of them to shortest time series (so, >> delete the time points that are not given for all stocks)? Or, is better to >> copy the preceding price values for the absent time points, and therefore >> to align all of them to the longest time series? >> Thanks, >> Michael >> >> [[alternative HTML version deleted]] >> >> ___ >> R-SIG-Finance@r-project.org 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]] > > ___ > R-SIG-Finance@r-project.org 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. -- Chirag Anand http://atvariance.in/chiraganand ___ R-SIG-Finance@r-project.org 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.
Re: [R-SIG-Finance] 4-digit SIC codes
On 5 February 2013 19:50, David Reiner wrote: > Very nice, Garrett! > More curious than anything, but does anyone know why I get the extraneous > characters when I do it? > They are present in x as well. I believe they are non-breaking spaces. Hi David, I generally get rid of these characters by doing: $ LC_ALL=C /usr/bin/R You may want to export this variable during shell spawn, so that you don't have to do this every time. HTH > -Original Message- > From: r-sig-finance-boun...@r-project.org > [mailto:r-sig-finance-boun...@r-project.org] On Behalf Of G See > Sent: Monday, February 04, 2013 9:30 PM > To: Bastian Offermann > Cc: r-sig-finance@r-project.org > Subject: Re: [R-SIG-Finance] 4-digit SIC codes > > I'm not sure, but here's a really quick and dirty way to get it > >> library(XML) >> x <- readHTMLTable("http://www.sec.gov/info/edgar/siccodes.htm";, > stringsAsFactors=FALSE)[[4]] >> colnames(x) <- x[2, ] >> SIC <- x[-c(1:3), ] >> head(SIC) > SICCode A/D OfficeIndustry Title > 4 100 5 AGRICULTURAL PRODUCTION-CROPS > 5 200 5 AGRICULTURAL PROD-LIVESTOCK & ANIMAL SPECIALTIES > 6 700 5 AGRICULTURAL SERVICES > 7 800 5 FORESTRY > 8 900 5 FISHING, HUNTING AND TRAPPING > 91000 9 METAL MINING > >> SIC[SIC$SICCode == "2834", ] >SICCode A/D Office Industry Title > 912834 1 PHARMACEUTICAL PREPARATIONS > > HTH, > Garrett > > On Mon, Feb 4, 2013 at 9:19 PM, Bastian Offermann > wrote: >> Hi, >> does anybody know whether 4-digit SIC codes are available in R? Something >> along the lines >> >> "2834" "Pharmaceutical Preparations" >> >> Thank you. >> >> ___ >> R-SIG-Finance@r-project.org 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. > > ___ > R-SIG-Finance@r-project.org 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. > > > This e-mail and any materials attached hereto, including, without limitation, > all content hereof and thereof (collectively, "XR Content") are confidential > and proprietary to XR Trading, LLC ("XR") and/or its affiliates, and are > protected by intellectual property laws. Without the prior written consent > of XR, the XR Content may not (i) be disclosed to any third party or (ii) be > reproduced or otherwise used by anyone other than current employees of XR or > its affiliates, on behalf of XR or its affiliates. > > THE XR CONTENT IS PROVIDED AS IS, WITHOUT REPRESENTATIONS OR WARRANTIES OF > ANY KIND. TO THE MAXIMUM EXTENT PERMISSIBLE UNDER APPLICABLE LAW, XR HEREBY > DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS AND IMPLIED, RELATING TO THE XR > CONTENT, AND NEITHER XR NOR ANY OF ITS AFFILIATES SHALL IN ANY EVENT BE > LIABLE FOR ANY DAMAGES OF ANY NATURE WHATSOEVER, INCLUDING, BUT NOT LIMITED > TO, DIRECT, INDIRECT, CONSEQUENTIAL, SPECIAL AND PUNITIVE DAMAGES, LOSS OF > PROFITS AND TRADING LOSSES, RESULTING FROM ANY PERSON'S USE OR RELIANCE UPON, > OR INABILITY TO USE, ANY XR CONTENT, EVEN IF XR IS ADVISED OF THE POSSIBILITY > OF SUCH DAMAGES OR IF SUCH DAMAGES WERE FORESEEABLE. > > ___ > R-SIG-Finance@r-project.org 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. -- Chirag Anand http://atvariance.in ___ R-SIG-Finance@r-project.org 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.