knavero
2012-Mar-14 11:57 UTC
[R] logical test not functioning correctly on zoo series...what the hell?
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 difference): http://pastebin.com/LDNw8UT0 The issue specifically is the last line of code in which I want to print out any value greater than 0. 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 logical vectors to get a better visual of what the process is, tried doing all of the above on a small sample data set (which actually works correctly for some reason, but doesn't work on the actual raw data), and basically have done a lot of research and trial and error before posting on here. Help is much appreciated. Thank you. P.S. I hope I asked this correctly on the forum (putting reproducible code that reproduces the error, etc.). If I made some noob mistake, I apologize in advance so please don't be mad at me. I will clarify if necessary. -- View this message in context: http://r.789695.n4.nabble.com/logical-test-not-functioning-correctly-on-zoo-series-what-the-hell-tp4471654p4471654.html Sent from the R help mailing list archive at Nabble.com.
David Winsemius
2012-Mar-14 15:26 UTC
[R] logical test not functioning correctly on zoo series...what the hell?
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.csvNothing appears.> > 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 difference): > > http://pastebin.com/LDNw8UT0 > > The issue specifically is the last line of code in which I want to > print out > any value greater than 0.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 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 logical vectors to get a better visual of what > the > process is, tried doing all of the above on a small sample data set > (which > actually works correctly for some reason, but doesn't work on the > actual raw > data), and basically have done a lot of research and trial and error > before > posting on here. Help is much appreciated. Thank you. > > P.S. I hope I asked this correctly on the forum (putting > reproducible code > that reproduces the error, etc.).If there is an error then you should post the complete error message.> If I made some noob mistake, I apologize > in advance so please don't be mad at me. I will clarify if necessary. >David Winsemius, MD West Hartford, CT
Seemingly Similar Threads
- uneven vector length issue with read.zoo?
- read.zoo - combining two columns with date and time respectively into one index column?
- Filter/Ceiling for unwanted data - zoo
- aggregating specific parts in zoo index column to perform sliding average
- Wrong output due to what I think might be a data type issue (zoo read in problem)