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

David Winsemius dwinsemius at comcast.net
Wed Mar 14 16:26:52 CET 2012


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 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



More information about the R-help mailing list