select function

penguins %>% select(species,island)

not getting results pls help me

Did you load the required libraries:

library(palmerpenguins)
library(dplyr)
library(magrittr)
penguins %>% select(species,island)
1 Like

Hi,
i have added the library (magrittr ) also.... still it is not working

penguins %>% select(species,island)

the error got:::::: as below
Error in select(., species, island) : unused arguments (species, island)

Could you include a screenshot that shows both the code you ran and the console output?

1 Like

What happens if you try this?

library(palmerpenguins)
library(dplyr)
penguins |>  select(species,island)

1 Like

the error indicates that you're not using dplyr's select, but a select from a different package

You can try to specify which select to use

penguins %>% dplyr::select(species,island)

If you're not sure which find you're using, try

find("select")

You should see:

> find("select")
[1] "package:dplyr"
2 Likes

Hi,

Thanks...!! i am able to get the results

library(palmerpenguins)

penguins %>% select(species,island)
dput(head(penguins%>% select(species,island)))
structure(list(species = structure(c(1L, 1L, 1L, 1L, 1L, 1L), levels = c("Adelie",
"Chinstrap", "Gentoo"), class = "factor"), island = structure(c(3L,
3L, 3L, 3L, 3L, 3L), levels = c("Biscoe", "Dream", "Torgersen"
), class = "factor")), row.names = c(NA, -6L), class = c("tbl_df",
"tbl", "data.frame"))

i have added the library (dplyr)...... now it is working good..

Thanks for the support

Thanks.... for the reply.
i got the output....re loaded the dplyr package... get result on the same code

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.