Re: [R] logical test not functioning correctly on zoo series...what the hell?

2012-03-14 Thread knavero
Thanks Gabor. colClasses did the trick. Also, I'll be sure to minimize the reproducible example the next time around using a text quote. Sorry about the noob mistake. -- View this message in context: http://r.789695.n4.nabble.com/logical-test-not-functioning-correctly-on-zoo-series-what-the-hell-

Re: [R] logical test not functioning correctly on zoo series...what the hell?

2012-03-14 Thread knavero
Heh, a one liner fix huh? This was going to be my alternative solution (got this coded as soon as the character strings theory arrived, and yes I'll use dput next time, sorry about that again and for all the miscommunication): require(zoo); require(chron) setwd("/home/knavero/Desktop") rawData =

Re: [R] logical test not functioning correctly on zoo series...what the hell?

2012-03-14 Thread knavero
"If you showed the output of dput(yourData) or even str(yourData) others could see what types the columns are. Ordinary printed output can make numeric, character, and factor data look the same. Comparisons involving strings do not always return the same value as comparisons involving the equival

Re: [R] logical test not functioning correctly on zoo series...what the hell?

2012-03-14 Thread knavero
Additionally, the dput(rawData) output: dput(rawData) structure(list(Date...Time = structure(1:1040, .Label = c("2/11/12 12:45 ", "2/11/12 13:00 ", "2/11/12 13:15 ", "2/11/12 13:30 ", "2/11/12 13:45 ", "2/11/12 14:00 ", "2/11/12 14:15 ", "

Re: [R] logical test not functioning correctly on zoo series...what the hell?

2012-03-14 Thread knavero
"I'm getting a 404 on the dropbox linklooking at your pastebin link, my guess is that those numbers are in fact greater than zero, but are very small so they appear as zeros in the print method. If you want to send your data, it's easier to simply give us dput(rawData) and copy and paste the r

Re: [R] logical test not functioning correctly on zoo series...what the hell?

2012-03-14 Thread Gabor Grothendieck
On Wed, Mar 14, 2012 at 12:43 PM, knavero wrote: > attached http://r.789695.n4.nabble.com/file/n4472408/dataout_2471_843.csv > dataout_2471_843.csv > Here is how the problem can be presented in a self contained, minimal, reproducible fashion (as per last two lines on every message to r-help): l

Re: [R] logical test not functioning correctly on zoo series...what the hell?

2012-03-14 Thread R. Michael Weylandt
Just took a closer look at this, Bill Dunlap's guess was correct (mine wasn't): your data is stored as a character (or at least, mine is after the commands below) -- character sorting is highly platform dependent so that's probably why I got a different answer than you. rawData <- zoo(as.numeric(c

Re: [R] logical test not functioning correctly on zoo series...what the hell?

2012-03-14 Thread William Dunlap
, "origin")= Named num [1:3] 1 1 1970 .. ..- attr(*, "names")= chr [1:3] "month" "day" "year" You need to figure out how to import the data as a character column and a numeric column if you want the comparison with 0 to work. Bill Dunlap Spotfir

Re: [R] logical test not functioning correctly on zoo series...what the hell?

2012-03-14 Thread R. Michael Weylandt
That sure doesn't resemble the output of dput(). Still, I ran the following: rawData <- read.zoo("dataout_2471_843.csv", header = TRUE, FUN = as.chron, format = "%m/%d/%Y %H:%M", index.column = 2, sep = ",", aggregate = function(x) tail(x,1)) rawData$Meter.ID = NULL rawData[rawData$KW.ch..1..

Re: [R] logical test not functioning correctly on zoo series...what the hell?

2012-03-14 Thread knavero
attached http://r.789695.n4.nabble.com/file/n4472408/dataout_2471_843.csv dataout_2471_843.csv -- View this message in context: http://r.789695.n4.nabble.com/logical-test-not-functioning-correctly-on-zoo-series-what-the-hell-tp4471654p4472408.html Sent from the R help mailing list archive at Nab

Re: [R] logical test not functioning correctly on zoo series...what the hell?

2012-03-14 Thread William Dunlap
0.01 10.1 20.2 > "0.0" > 0 [1] TRUE Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf > Of R. Michael Weylandt > Sent: Wednesda

Re: [R] logical test not functioning correctly on zoo series...what the hell?

2012-03-14 Thread R. Michael Weylandt
Also, the term "error" means something specific so try not to misuse it (it will misdirect people as to the nature of your problem). An error looks like what you get if you do this: sqrt(list() + `if` / data) Michael On Wed, Mar 14, 2012 at 2:38 PM, R. Michael Weylandt wrote: > I'm getting a 40

Re: [R] logical test not functioning correctly on zoo series...what the hell?

2012-03-14 Thread R. Michael Weylandt
I'm getting a 404 on the dropbox linklooking at your pastebin link, my guess is that those numbers are in fact greater than zero, but are very small so they appear as zeros in the print method. If you want to send your data, it's easier to simply give us dput(rawData) and copy and paste the re

Re: [R] logical test not functioning correctly on zoo series...what the hell?

2012-03-14 Thread knavero
Here's the exact error I'm receiving: http://pastebin.com/mNsPauwk Tracked each output along the way. Starting to think there's a bug in the source code. -- View this message in context: http://r.789695.n4.nabble.com/logical-test-not-functioning-correctly-on-zoo-series-what-the-hell-tp4471654p

Re: [R] logical test not functioning correctly on zoo series...what the hell?

2012-03-14 Thread knavero
"You're missing a comma between 0 and "]" in the last line if your goal is to retrieve the rows that satisfy that condition (and if the condition makes any sense). Haven't tested the rest of your code, though. ?Extract > The outputs that I'm getting, however, are > printing out 0's down th

Re: [R] logical test not functioning correctly on zoo series...what the hell?

2012-03-14 Thread David Winsemius
On Mar 14, 2012, at 11:47 AM, knavero wrote: "> Here's the raw data I'm working with (will be available temporarily): http://dl.dropbox.com/u/41922443/dataout_2471_843.csv Nothing appears. " ^ Clicking on the link should prompt you to download a csv file and save it somewhere in your H

Re: [R] logical test not functioning correctly on zoo series...what the hell?

2012-03-14 Thread knavero
"> Here's the raw data I'm working with (will be available temporarily): > > http://dl.dropbox.com/u/41922443/dataout_2471_843.csv Nothing appears. " ^ Clicking on the link should prompt you to download a csv file and save it somewhere in your HDD. -- View this message in context: http://r.7896

Re: [R] logical test not functioning correctly on zoo series...what the hell?

2012-03-14 Thread knavero
"> The outputs that I'm getting, however, are > printing out 0's down the columns. I've tried various methods assuming > various theories, read the R manual via "?" for different possible > solutions, Googled stuff, tried the ifelse function which produces > the same > error, tried creating logic

Re: [R] logical test not functioning correctly on zoo series...what the hell?

2012-03-14 Thread David Winsemius
On Mar 14, 2012, at 7:57 AM, knavero wrote: Here's the raw data I'm working with (will be available temporarily): http://dl.dropbox.com/u/41922443/dataout_2471_843.csv Nothing appears. Next, here's the code I want to impose (error that I'm seeing SHOULD reproduce on your shell when script

[R] logical test not functioning correctly on zoo series...what the hell?

2012-03-14 Thread knavero
Here's the raw data I'm working with (will be available temporarily): http://dl.dropbox.com/u/41922443/dataout_2471_843.csv Next, here's the code I want to impose (error that I'm seeing SHOULD reproduce on your shell when script is executed...btw using Ubuntu Linux 11.10 if that makes a differenc