I just want to know why this code produces one result on console and one plot just as I expected
mtcars %>%
select(hp, mpg) %T>%
print() %>%
plot()
But this code doesn't
library(plotluck)
library(skimr)
mtcars %>%
select(hp, mpg) %T>%
skim() %>%
plotluck(data = ., hp ~ mpg)
Can anybody please point out what am I doing wrong??
cderv
February 14, 2020, 7:09am
2
I think you just need to use skimr::skim_tee
mtcars %>%
select(hp, mpg) %T>%
skim_tee() %>%
plotluck(data = ., hp ~ mpg)
As explained in the doc,
skim() is an alternative to summary(), quickly providing a broad
overview of a data frame. It handles data of all types, dispatching a
different set of summary functions based on the types of columns in the data
frame.
skim
will return a tibble and does not print by itself. That is why you get nothing. skim_tee
will do that for you by printing the result before returning it explicitly.
Hope it helps.
2 Likes
system
Closed
March 6, 2020, 7:09am
3
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.