Displaying 20 results from an estimated 4000 matches similar to: "Zoo and numeric data"
2010 Feb 11
3
read numeric values with thousands seperator from csv file
Hello,
Is there an easy way to read a csv file with numeric values that contain
thousands seperators. The file looks like this:
Date;opening;High;Low;closing;Volume
12/02/08;4,764.95;4,897.62;4,729.13;4,895.31;-
13/02/08;4,868.02;4,927.81;4,833.85;4,898.60;-
14/02/08;4,942.18;4,962.43;4,877.88;4,895.99;-
I want to get the numeric values as..., well, numeric values, and not as
character strings.
2013 Aug 16
1
as.Date.character speed improvement suggestion
R-Devel,
I store and retrieve a large amount of financial data (millions of rows) in a PostgreSQL database keyed by date (and represented in R by class Date). Unfortunately, I frequently find that a great deal of processing time is spent converting dates from character representations to Date class representations in R, presumably because strptime is not fast for large vectors (>10,000
2009 Feb 03
1
Automatic creation of columns in zoo object
Hello, everyone
I have a question.
Assume I have the following zoo object:
me.la <- structure(c(1524.75, 1554.5, 1532.25, 1587.5, 1575.25, 1535.5,
1550, 1493.5, 1492.5, 1472.25, 1457.5, 1442.75, 1399, 1535.75,
1565.25, 1543.5, 1598.5, 1586.5, 1547, 1561.5, 1504.75, 1503.75,
1483.75, 1468.75, 1453.75, 1410, 1546.75, 1575.25, 1554, 1609,
1597.5, 1558.5, 1573, 1516.25, 1515.5, 1495, 1480, 1465,
2010 Sep 14
1
NA confusion (length question)
Hi folks,
I am running a very simple regression using
mylm <- lm(mass ~ tarsus, na.action=na.exclude)
I would like the use the residuals from this analysis for more
regression but I'm running into a snag when I try
cbind(mylm$residuals, mydata) # where my data is the original data set
The error tells me that it cannot use cbind because the length of
mylm$residuals is
2010 Oct 25
4
zoo.read intraday data
Hello all,
I'm trying to use zoo.read but can't figure out
how to deal with the time format. (example below)
would be nice if someone could help.
best regards,
Immanuel
---------------------------
L <- "Date,Time,Open,High,Low,Close,Up,Down
05.02.2001,00:30,421.20,421.20,421.20,421.20,11,0
05.02.2001,01:30,421.20,421.40,421.20,421.40,7,0
2012 Mar 20
3
Wrong output due to what I think might be a data type issue (zoo read in problem)
Here's the small scale version of the R script:
http://pastebin.com/sEYKv2Vv
Here's the file that I'm reading in:
http://r.789695.n4.nabble.com/file/n4487682/weatherData.txt weatherData.txt
I apologize for the length of the data. I tried to cut it down to 12 lines,
however, it wasn't reproducing the bad output that I wanted to show.
The problem is that my whole data set
2011 Jun 19
1
Skyline plots from several trees in newick format
Dear all,
I am trying to create a consensus skyline plot using the "ape"
package(newbie).
I have a nexus file that looks like the one from above containing many
trees. (my_file.trees)
#NEXUS
begin trees; [Treefile generated by sim_coal.exe (Laurent Excoffier)]
tree true_tree_1 = [&U] (((13.1:6, 43.1:5):12, 28.1:14):284, (((((21.1:0,
(20.1:1, 4.1:0):0):1, ((37.1:0,
2011 Sep 13
1
ZOO: Learning to apply it to my data
I have read ?zoo but am not sure how to relate the parameters (x,
order.by, frequency, and style) to my data.frame. The structure of the
data.frame is
'data.frame': 11169 obs. of 4 variables:
$ stream : Factor w/ 37 levels "Burns","CIL",..: 1 1 1 1 1 1 1 1 1 1 ...
$ sampdate: Date, format: "1987-07-23" "1987-09-17" ...
$ param : Factor w/
2008 Feb 21
2
Unable to create/index a zoo irregular timeseries
In the text file pressione2008.csv I have the following
"Data","MAX","MIN","Note"
"07-01-2008 08:00:00", 135, 90, "Eccessi feste, inizio dieta"
"07-01-2008 18:00:00", 135, 85, ""
"08-01-2008 08:00:00", 125, 75, ""
which is a collection of blood pressure data at different time of the day.
I would
2009 Sep 27
2
zoo: merging aggregated zoo-objects fails
Dear all,
I have several text files looking like this:
9063032 19700201 22:00 174.067
9063032 19700201 23:00 174.076
9063032 19700202 00:00 174.085
9063032 19700202 01:00 174.091
9063032 19700202 02:00 174.094
9063032 19700202 03:00 174.091
9063032 19700202 04:00 174.082
9063032 19700202 05:00 174.079
And I run this loop:
for (j in 1:nr.of.files)
{
#Import:
DF <-
2009 Nov 25
3
Feature request for as.Date() function
Hello -
I have a csv file with a few date columns. Some of the records have an
"NA" character string instead of the date. When I attempt to use
read.csv() and typecast the columns using colClasses, I receive the
following error:
Error in charToDate(x) :
character string is not in a standard unambiguous format
Similarly, the following command produces the same error:
2011 Oct 27
2
Simple time series question with zoo
New user here. My goal is pull daily averages from a long dataset.
I've been working with some code I got from this list from
https://stat.ethz.ch/pipermail/r-help/2009-March/191302.html
The code how I have been using it is as follows:
library(zoo)
library(chron)
DB<-read.table("/Users/me/Desktop/R/data.csv", sep=",", header=TRUE, as.is
=TRUE)
z<-zoo(LTER6$temp,
2009 Dec 22
1
Using zoo() to aggregate daily data to monthly means
I am trying to get monthly means for a daily data series using zoo(). I have
found an odd problem, that seems to be caused by zoo()'s handling of leap
years.
Here's my R script with 2 methods (freq=365, 366) for aggregating the daily
data to monthly series:
library(zoo)
J_link <- "http://www.ijis.iarc.uaf.edu/seaice/extent/plot.csv"
JAXA_data <- read.table(J_link,
2012 Apr 04
2
Trying to merge new data set to bottom of old data set. Both are zoo objects.
Here is the data I'm working with:
http://r.789695.n4.nabble.com/file/n4530888/new.txt new.txt
http://r.789695.n4.nabble.com/file/n4530888/old.txt old.txt
My code is here:
http://pastebin.com/9jjs6Ahr
I'm looking for away to simply attach the new.txt to the bottom of old.txt
through R, else I'll just throw it in Excel to do some preprocessing. I've
looked into using merge,
2012 May 02
5
uneven vector length issue with read.zoo?
I truncated and simplified my code and the read in data that I'm working with
to isolate the issue. Here is the read in data and R script respectively:
http://r.789695.n4.nabble.com/file/n4604287/test.csv test.csv
http://pastebin.com/rCdaDqPm
Here is the terminal/R shell output that I hope the above replicates on your
screen:
> source("elecLoad.r", echo = TRUE)
> #Load
2011 Nov 01
1
Multiple time series with zoo
Thanks for everyone's input so far, it is greatly appreciated. But I've got
one last task I could use some advice on
Here are the first few lines of my data set:
site,time_local,time_utc,reef_type_code,sensor_type,sensor_depth_m,temperature_c
06,2006-04-09 10:20:00,2006-04-09 20:20:00,BAK,sb39, 2, 29.63
06,2006-04-09 10:40:00,2006-04-09 20:40:00,BAK,sb39, 2, 29.56
06,2006-04-09
2011 Jun 21
1
plot error bars on skyline plot
Hi,
I have generated a skyline plot of a tree in newick format using "ape".
How can I plot the error bars for this graph?
I only have the the tree data.
un<-"((((8.1:0, 20.1:0):0, 6.1:3):123, (((((35.1:0, (22.1:0, (43.1:1,
29.1:0):0):0):4, 25.1:6):0, ((42.1:0, 21.1:0):3, (39.1:0, 2.1:0):3):1):8,
(3.1:0, 7.1:0):8):48, (((((15.1:0, 14.1:0):0, 11.1:0):0, 37.1:0):0,
2007 Aug 20
1
Ask for functions to obtain partial R-square (squared partial correlation coefficients)
The partial R-square (or coefficient of partial determination, or
squared partial correlation coefficients) measures the marginal
contribution of one explanatory variable when all others are already
included in multiple linear regression model.
The following link has very clear explanations on partial and
semi-partial correlation:
http://www.psy.jhu.edu/~ashelton/courses/stats315/week2.pdf
In
2000 Jun 28
1
Rd2dvi
I'm trying to use R CMD Rd2dvi and I end up at a Latex (I think)
command prompt. What's missing or what am I suppose to do?
Paul Gilbert
_______
paul at breman:/apps/dse-versions/2000.6/dse#R CMD Rd2dvi syskern This is
TeX, Version 3.14159 (Web2C 7.3) (Rd2.tex LaTeX2e <1998/12/01> Babel
<v3.6k> and hyphenation patterns for american, french, german, ngerman,
nohyphenation,
2009 Jun 14
2
read.csv
If read.csv's colClasses= argument is NOT used then read.csv accepts
double quoted numerics:
1: > read.csv(stdin())
0: A,B
1: "1",1
2: "2",2
3:
A B
1 1 1
2 2 2
However, if colClasses is used then it seems that it does not:
> read.csv(stdin(), colClasses = "numeric")
0: A,B
1: "1",1
2: "2",2
3:
Error in scan(file, what, nmax, sep,