0
votes

enter image description hereI have imported 90 excel files by creating a directory (dir) and using (lapply). All of the excel files have 5 similar variables and different numbers of observations. Then I applied (map_dfr) to combine all the files into one file but I found that the new data frame has 10 variables and unfortunately, some observations have appeared as variable names. What might be the possible reason and solution for this ?

setwd("F:\Spring 2019\Thesis_data\Kam_Thesis\data\nontidal_water_level")

nontidal_list <- dir(pattern= ".xlsx", full.names = T)

nontidal_wl <- lapply(nontidal_list, read_excel)

nontide_dfr <- map_dfr(nontidal_list, read_excel)

1

1 Answers

0
votes

You need to at least post (use 'dput') what the output looks like. It sounds like one of the files might not have a header row on it. You might try examining each file to make sure the format is consistent.