similar to: extracting data from zoo series

Displaying 20 results from an estimated 3000 matches similar to: "extracting data from zoo series"

2006 Dec 10
1
using zoo for daily stock prices
Hi all, Please forgive this newbie posting to the list for the first time if I haven't followed proper procedure. I have read through many of the archives and find them most useful in learning R. I have ten years daily data (stock closing prices) which I read in zoo format. I am having problems coding R to run a count of how many days in each month have a price higher than the first day
2007 Mar 28
2
aggregating data with Zoo
Is there a way of aggregating 'zoo' daily data according to day of week? eg all Thursdays I came across the 'nextfri' function in the documentation but am unsure how to change this so any day of week can be aggregated. I have used POSIX to arrange the data (not as 'zoo' series) according to day of week, but am curious if I've missed if a similar option available
2007 May 28
2
Yearly statistics
Dear R-experts, Sorry if I've overlooked a simple solution here. I have calculated a proportion of the number of observations which meet a criteria, applied to five years of data. How can I break down this proportion statistic for each year? For example (data in zoo format): open high low close hc lc 2004-12-29 4135 4135 4106 4116 8 -21 2004-12-30 4120 4131
2007 Jun 01
1
aggregate in zoo
Hi R-experts, Thanks very much to Jim Holtman and Gabor on my previous question. I am having another problem with data manipulation in zoo. The following is data (Z) for first business day of every month in zoo format. I am trying to get mean of "open" for each year. I subset Z <- Z[,2] then > sapply(split(Z, format(index(Z), "%Y")),mean) I get error message:
2007 Jun 08
4
match rows of data frame
Hi R-experts, I have a data frame (A) , and a subset (B) of this data frame. I am trying to create a new data frame which gives me all the rows of B, plus the 5th next row(occuring in A). I have used the below code, but it gives me all 5 rows after the matching row. I only want the 5th. FiveDaysLater <- A[c(sapply(match(rownames(B),rownames(A)), seq, length=6))),] Any guidance much
2007 Feb 22
2
Is there better alternative to this loop?
Dear List, Thanks to those who helped with my enquiry a few days ago. I have a another question on loops, in this case I am trying to print out the row of a data frame if the previous 3 values (daily values) in col5 are in descending order. I have this loop which works, but ask whether this can be done differently (without conventional loop) in R: flag="T" d= 3 # d represents
2007 Feb 19
2
help with loop over data frame
Dear List, This may be the fifth time Ive tried to send this to the list so apologies if there are multiple emails. I need some help getting started with this problem. I have a data frame containing a year of daily stock prices in the following format: Date Open High Low Close 1/15/2000 10 11 8 10 1/16/2000 12 12 10 11 etc.. I want to create a new
2007 Feb 22
1
how to show date with this subset
Dear List, Thankyou to Jim and Marc for their help on my previous question. I have a data frame of five columns, the first being a list of dates and the other four columns are numeric values. I wanted to list the days where all 4 columns of values are less than in the previous row. I used the following which works fine, except it doesnt show the dates for each row (the values from column 1).
2024 Aug 09
1
WDI package commands timing out and not working
>>>>> Ivan Krylov via R-help >>>>> on Fri, 9 Aug 2024 15:23:58 +0300 writes: > ? Thu, 8 Aug 2024 12:43:23 +0530 > Anupam Tyagi <anuptyagi at gmail.com> ?????: >> In open.connection(con, "rb") : >> URL >>
2012 Feb 27
2
compare two data frames of different dimensions and only keep unique rows
Dear list, I am still struggling with something that should be easy: I compare two data frames with a lot of common rows and want to keep only rows that are NOT in both data frames, unique. Here are an example of these data frame. reported <- structure(list(Product = structure(c(1L, 1L, 1L, 1L, 2L, 2L, 3L, 4L, 5L, 5L), .Label = c("Cocoa", "Coffee C", "GC",
2018 Sep 11
1
Running libvirtd outside of a shell results in qemu defunct processes
Hi, In KubeVirt we are right now starting libvirt via a wrapper shell script. I want to remove that wrapper and directly start libvirtd from our golang code. This means that our golang code is PID 1 in the container and we start libvirtd as a fork from there. When I did this, strange things started to happen. Libvirt was still able to start and manage qemu processes, but stopping the qemu
2024 Aug 09
2
WDI package commands timing out and not working
? Thu, 8 Aug 2024 12:43:23 +0530 Anupam Tyagi <anuptyagi at gmail.com> ?????: > In open.connection(con, "rb") : > URL > 'https://api.worldbank.org/v2/en/country/OED/indicator/NY.ADJ.NNAT.GN.ZS?format=json&date=1977:2020&per_page=32500&page=1': > Timeout of 60 seconds was reached If you try to open the link in the browser, does it work? How long
2013 Apr 23
2
Frustration to get help R users group
Dear R users/developers I requested help to solve the problem of formulating Multivariate Sample selection model by using Full Information Maximum Likelihood (FIML)estimation method. I could not get any response. I formulated the following code of FIML to analyse univariate sample selection problem. Would you please advise me where is my problem library (sem) library(nrmlepln) Selection
2014 May 30
1
R CMD check for the R code from vignettes
Hi, Recently I saw a couple of cases in which the package vignettes were somewhat complicated so that Stangle() (or knitr::purl() or other tangling functions) can fail to produce the exact R code that is executed by the weaving function Sweave() (or knitr::knit(), ...). For example, this is a valid document that can pass the weaving process but cannot generate a valid R script to be source()d:
2016 Jul 07
2
Re: [PATCH v3 4/8] mllib: Add some imperative list manipulation functions.
On Thursday 07 July 2016 17:30:03 Richard W.M. Jones wrote: > This adds imperative list manipulation functions inspired by Perl. > The functions are passed list refs which get updated in place. > > This allows us to replace some awkward pure functional code like: > > let xs = ys in > let xs = if foo then xs @ zs else xs in > > with: > > let xs = ref ys in
2008 Nov 29
3
including Sweave tangled code in '.Rnw' document
Hello List, I have been using Sweave for my homework this last quarter and have been very impressed at how much time and effort it saves me. I, however, have run up against a problem which I have not been able to solve using any of the Sweave/LaTeX tricks I know. I work through my homework one problem at a time, typesetting equations and writing R code, etc. and occasionally use
2013 Apr 25
1
[LLVMdev] Proposal for new Legalization framework
On 04/24/2013 07:39 PM, Chris Lattner wrote: > On Apr 24, 2013, at 6:27 PM, Reed Kotler <rkotler at mips.com> wrote: >> I would really push towards doing this in LLVM IR as the next step. > What makes you say that? > Partly for the reasons Dan stated. For me, the IR is definitely way more friendly too and not tangled up in lots of undocumented obscurity as selection DAG is
2006 Mar 21
2
How do I get substring of utf-8 string?
I''m trying to get substring from a utf-8 encoded string. (say, first 50 characters of the string) String#[0..49] would give me the first 50 bytes not 50 characters.. I know there is jcode library, but it only let you count number of characters in utf-8 string. unicode gem doesn''t seem to help much. unicode_hacks gem seem to solve the problem, but it also seems to
2006 May 25
1
PC rotation question
On p. 48 of "Statistics Complements" to the 3rd MASS edition, http://www.stats.ox.ac.uk/pub/MASS3/VR3stat.pdf I read that the orthogonal rotations of Z Lambda^-1 remain uncorrelated, where Z is the PC and Lambda is the diag matrix of singular values. However, the example below that text is > A <- loadings(ir.pca) %*% diag(ir.pca$sdev) If ir.pca$sdev are the singular values,
2016 Jul 08
2
Re: [PATCH v3 4/8] mllib: Add some imperative list manipulation functions.
On Thu, Jul 07, 2016 at 06:08:43PM +0100, Richard W.M. Jones wrote: > On Thu, Jul 07, 2016 at 07:00:46PM +0200, Pino Toscano wrote: > > On Thursday 07 July 2016 17:30:03 Richard W.M. Jones wrote: > > > This adds imperative list manipulation functions inspired by Perl. > > > The functions are passed list refs which get updated in place. > > > > > > This