I have a dataframe myframe
with 8 variables in R. I then load the sqldf
package using library(sqldf)
. Then I run the command:
proxyframe = sqldf("select a, b, c, d, e from myframe where c > 1000")
However, when I look at proxyframe
using view(proxyframe)
I see that there are clear instances of rows included where c < 1000
. I did some further investigations and found that for some reason statements like:
"0" < 6 # returns true
"22" > 6 # returns false
I'm looking for any general tips or ideas at what might be causing my select statements to return odd dataframes, and if it has anything to do with R's weird use of comparison operators. My fear is that somehow column c
is a character and the right comparison operator isn't being applied---though I don't have much experience how R works under the cover or how this package works.