Try this,
fl = list.files(pattern = "dta", path = "d:/folder",
full.names = TRUE)
dl = lapply(fl, foreign::read.dta)
names(dl) = tools::file_path_sans_ext(fl)
str(dl)
More Related Contents:
- How to create a loop that will make regression models in R? [closed]
- how to use loop to subset 1000 csv files and do co-integration test in R?
- “for” loop only adds the final ggplot layer
- Looping over a Date or POSIXct object results in a numeric iterator
- ggplot does not work if it is inside a for loop although it works outside of it [duplicate]
- Why do R objects not print in a function or a “for” loop?
- Save multiple ggplots using a for loop
- Looping over variables in ggplot
- Skipping error in for-loop
- Merge several data.frames into one data.frame with a loop
- Examples of the perils of globals in R and Stata
- Replace negative values by zero
- Same function over multiple data frames in R
- How to identify/delete non-UTF-8 characters in R
- How do I create a “macro” for regressors in R?
- Mutate multiple columns in a dataframe
- Converting a list of data frames into individual data frames in R [duplicate]
- Read Stata 13 file in R
- Loop in R: how to save the outputs?
- R: Break for loop
- Different Robust Standard Errors of Logit Regression in Stata and R
- Enclosing variables within for loop
- show multiple plots from ggplot on one page in r
- Create an empty data.frame
- Add a common Legend for combined ggplots
- Assign multiple new variables on LHS in a single line
- Rename multiple columns given character vectors of column names and replacement [duplicate]
- Last Observation Carried Forward In a data frame? [duplicate]
- different size facets proportional of x axis on ggplot 2 r
- Add values to a reactive table in shiny