Skip to content

Tag: r

Count based on multiple conditions using sqldf

Hi all I’m writing a sql query on R using sqldf and seem to hit a roadblock. I have a table with an Id column, two dates columns and a grouping by column. The query I’m writing is From this query the result I’m getting is Whichis correct based on the query. What I want to achieve is if my

How to compose query properly using dbGetQuery command?

I have a small database in PostgresSQL. And I connected to it via R-studio and try to retrieve data from database. I wrote a command, but it doesn’t work. And I don’t know what’s the problem. Please, help me. So, the code works well. But these two codes fail Where con is the postgres connect…

Preserving times Class with sqldf

I am using sqldf to join several tables, but I am having trouble preserving the times class set with the chron package on a column. I used the method=”name__class” argument to the sqldf function and …