S3 class S4 class?

7 views
Skip to first unread message

katherine.dami1

unread,
Mar 22, 2021, 11:58:12 AMMar 22
to Motus Wildlife Tracking System
Hello,

I run this code:
tbl_motusFilter <- filterByActivity(sql.motus, return = "all")
or
tbl.id <- filterByActivity(sql.motus, view = "alltags")
or
tbl.alltags <- filterByActivity(sql.motus, return = "all")
and I get
Error in h(simpleError(msg, call)) : 
  error in evaluating the argument 'conn' in selecting a method for function 'dbListTables': $ operator not defined for this S4 class

I know R is tricky and likes things done in order. I have a very limited knowledge of R. I have no idea what the error code I got means. I looked it up and people said you cant use "$" for S4 class, but there is no "$" in the code.

The error message may be because I am not following the R code in the book because the normal code to make an alltags dataframe didn't work because I have too much data.
df.alltags <- tbl.alltags %>% 
  collect() %>% 
  as.data.frame()

I was working with Yolanda's code that she made to help me with this issue and filtered my data by species. I started with the species I am not interested because we have very few transmitters with that species. Because of this filtration, could it mess up R code in later chapters of the book?
test <- tbl.alltags %>% 
  filter(speciesSci == "Rallus limicola") %>%  
  distinct() %>% collect() %>% as.data.frame()
I don't this code effected the code I am getting the error message on, seeing as how this is making a dataframe for me and the code I am having issues with is dealing with the data in sql.motus and not my filtered dataframe.
I was thinking maybe because I cannot run the normal code outlined in the R handbook, I may not have something in my global environment or another error I can't fathom due to my inexperience in R. 

Thanks,
Katherine




Reply all
Reply to author
Forward
0 new messages