dplyr dataset not able to view

view(iris) ..... code not given result
mean(iris$Sepal.Length) .... got result
iris %>% mean(Sepal.Length) .... No result
pls advise...

mean() expects a vector, not a data frame, You can use

iris$Sepal.Length %>% mean()
or
iris %>% pull(Sepal.Length) %>% mean()
or
iris %>% summarise(mean(Sepal.Length))

1 Like

Hi @manikandan_ramaraj, when you use View() is with upper V. You have v, view().

# try:
library(ggplot2)
View(iris) # must show df 
view(iris) # dont show anything. Its not a function.
1 Like

The view() function is part of the tibble package. It simply calls the View() function.

If you load the tidyverse package, then tibble will also be loaded. If you just load selected tidyverse packages, such as dplyr or ggplot2, you will need to run library(tibble) or use tibble::view().

library(ggplot2)
library(tibble)
view(iris)  # gives same result as View(iris)
1 Like

Hi,
Thanks for replying me.... still it is not working....i am not able to add screenshot thru upload in this section.
when i upload it becomes link as below...pls advise

Hi ,
sorry... when i give ok to the tab i am able to view the screenshot in the section

Thanks,

Hi.....

now it is working.... given result

Thanks......!!! replying me.
. i am not able get results... below the attached

Thanks... i!!
i will load tibble package