Re: [R] Using !is.na() in a HAVING clause in sqldf() XXXX

2013-08-28 Thread Alex Gilgur
having is right; use HAVING Premie IS NOT NULL instead. The sqldf package has a SQLite database running behind it. All NA get internally converted to NULL, which is the standard representation for N/A in SQL, and then they become NA in the data.frame that is returned by the sqldf command

Re: [R] Using !is.na() in a HAVING clause in sqldf() XXXX

2013-08-28 Thread Alex Gilgur
Phil, sorry; I didn't see your response. You are right; the IS is superfluous On Wednesday, August 28, 2013 8:56:19 AM UTC-7, Alex Gilgur wrote: having is right; use HAVING Premie IS NOT NULL instead. The sqldf package has a SQLite database running behind it. All NA get internally

[R] Using !is.na() in a HAVING clause in sqldf() XXXX

2012-01-17 Thread Dan Abner
Hi everyone, I have the following: sqldf(select Premie,count(tpounds) N,avg(tpounds) Avg_Weight, stddev_samp(tpounds) StdDev from children group by Premie having !is.na(Premie)) sqldf() does not like the !is.na(Premie) specification. How does one exclude a missing group in an aggregated

Re: [R] Using !is.na() in a HAVING clause in sqldf() XXXX

2012-01-17 Thread Joseph Magagnoli
Did you try a where statement? where Premie is not null On Tue, Jan 17, 2012 at 3:03 PM, Dan Abner dan.abne...@gmail.com wrote: Hi everyone, I have the following: sqldf(select Premie,count(tpounds) N,avg(tpounds) Avg_Weight, stddev_samp(tpounds) StdDev from children group by Premie

Re: [R] Using !is.na() in a HAVING clause in sqldf() XXXX

2012-01-17 Thread Phil Spector
Dan - Try using having Premie not null instead of having !is.na(Premie) . - Phil Spector Statistical Computing Facility Department of Statistics