how to have a description of the variables?

hello everybody
I have an excel file with five different sheets and in each sheet, I have different tables (by header). I imported four of them into R separately and cleaning them but now when I want to import one of the tables of the fifth sheet. when I want to have the description of the table, it just gives me 10 variables.
I import the first table successfully but...
why?

## baseline
setwd("C:/Users/....../data/request")
M<-read_excel("Baseline_BC.xlsx", "Medical info", skip = 2, n_max=2000)
variables<- rbind(M)
Baseline_BC<- variables %>% filter(Selection!="X")
# cleaning Baseline/ medical ------------------------------------------------------
setwd("C:/Users/....../raw/baseline")
bb = list.files(path = "./raw/baseline",pattern="*.xlsx")
############
###PreviousPregnancyHistory#############
dff = read_excel('C:/Users/...........History.xlsx')
###
variables<-variables %>% filter(!is.na(`Variable name`))
names<-variables$`Variable name`
df1<-dff %>% select(any_of(names))
description<-as.data.frame(names(df1))
description<-left_join(description, variables[,], by=c("names(df1)"="Variable name"))

Since your problem is with an specific excel file, we can't possibly help you without having access to the said file, can you share a link to it?

Also, the code you have posted doesn't seem related to this specific issue, can you please clarify? Ideally, try to provide a proper REPRoducible EXample (reprex) illustrating your issue.

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.