Trouble shoot please?

Metals <- read.xport("PBCD_J.XPT")
Cholesterol <- read.xport("TCHOL_J.XPT")
nhanes_combined <- list(Metals,Cholesterol) %>%
Reduce(function(df1, df2) inner_join(df1, df2, by = "SEQN"), .)

nhanes_combined %>%
select(LBXBCD,LBXTHG,LBXBPB,LBXTC,LBXBSE) %>%

rename(Mercury = LBXTHG) %>%
rename(Cadmium = LBXBCD) %>%
rename(Lead = LBXBPB) %>%
rename(Selenium =LBXBSE) %>%
rename(Cholesterol = LBXTC)

complete_nhanes <- na.omit(nhanes_combined)

Error in select(., LBXBCD, LBXTHG, LBXBPB, LBXTC, LBXBSE) :
unused arguments (LBXBCD, LBXTHG, LBXBPB, LBXTC, LBXBSE)

I do not know what is happening??

Possibly a conflict with a function named select from a package other than dplyr?

If you execute this > select, it will print information about select including what package it's from.

Also I would check class(nhanes_combined) to make sure it's a data frame. Not sure what that Reduce does; perhaps is returning a list.

assuming it is a dataframe, this will tell you the names that its possible to select out.

names(nhanes_combined )

This topic was automatically closed 21 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.