#R dplyr package. Need help with an error
69 messages · Page 1 of 1 (latest)
Dayumm it's an r question leshgoooo
Why are you using show_query? You're not accessing a database
Hi wang
Hi Gx
It might be useful to show the task when asking for help 🙂
okay
the first task is:
import data "dslabs::stars". Import it so that the "data %>% show_query()" code doesn't throw an error.
then has other one
i think i need to do with dplyr package. but even if i used it. it gives error(
when i checked the type of data it is data frame
i think that maybe to use tibble or something like this but then also gived an error. Pls help me to find the answer
Sorry was doing my night routine
no problem
Where is show_query from? Dbplyr or dplyr?
i think in dplyr
Can you try utils::getAnywhere(show_query)
Maybe it needs to be in quotes?
I can't remember
okay
A single object matching ‘show_query’ was found
It was found in the following places
package:dplyr
namespace:dplyr
with value
Okay so it is from dplyr
Interesting, I've never used that function except for in a database
actually i dont understand why it gives an error. But i think it's related to dplyr
okay
What's kinda answer is that lol
data = dslabs::stars %>% as_tibble()
data %>% class()
[1] "tbl_df" "tbl" "data.frame"
data %>% show_query()
no applicable method for 'show_query' applied to an object of class "c('tbl_df', 'tbl', 'data.frame')"
i was trying ))
Oh what why'd a vector get returned
there is no problem in data. but then again show query gives an error
sorry i also did this
data %>% class()
What about making it into a tbl?
you mean like this?
data = tbl(dslabs::stars)
Oh okay I was right
no applicable method for 'tbl' applied to an object of class "data.frame"
You have to convert it to a databse
how i can do it
Have you been taught any ways?
I don't want to get you in trouble for using things you're not allowed to
That sounds like it could work
but it gives error again((
Error in tbl_memdb(.) : could not find function "tbl_memdb"
oh okay
Surely these errors you should be able to solve yourself c'mon
okay. i will try to do it
Hello? It shouldn't take this long lol
i tried then gived another error
))
oh I fixed it. i think
data %>% show_query()
<SQL>
SELECT *
FROM .
i am new in R. I think it works now
Noice good work
Welcome to R lol
Thank you. I will try to do another part of question. I hope there will be no errors)
No worries
Feel free to come back and ask if you have more questions
I will however, be sleeping soon so I won't reply until I wake up and I don't think anyone else in this server helps with r so ...
No problem