sqldf select statements in R not working? -
i have dataframe myframe
8 variables in r. load sqldf
bundle using library(sqldf)
. run command:
proxyframe = sqldf("select a, b, c, d, e myframe c > 1000")
however, when @ proxyframe
using view(proxyframe)
see there clear instances of rows included c < 1000
. did farther investigations , found reason statements like:
"0" < 6 # returns true "22" > 6 # returns false
i'm looking general tips or ideas @ might causing select statements homecoming odd dataframes, , if has r's weird utilize of comparing operators. fear somehow column c
character , right comparing operator isn't beingness applied---though don't have much experience how r works under cover or how bundle works.
cast character column real:
> df <- data.frame(a = "22", stringsasfactors = false) > sqldf("select * df cast(a real) > 6") 1 22
r sqldf
No comments:
Post a Comment