How can I use R to list all files with a specified extension ?

0 votes
May 10, 2018 in Data Analytics by shams
• 3,580 points
35 views

1 answer to this question.

0 votes
fls <- list.files(pattern = "\\.dbf$")
$ at the end means that it is the end of string.
"dbf$" will work too, but adding \\. will ensure that you match only files with particular extension. (in our case it is.dbf )
answered May 10, 2018 by zombie
• 3,690 points

Related Questions In Data Analytics

0 votes
1 answer

How can I import a file in R without giving the destination/file path to the specified file?

You can use the window explorer to ...READ MORE

answered Aug 28, 2018 in Data Analytics by Anmol
• 3,620 points

edited Aug 28, 2018 by Vardhan 59 views
0 votes
1 answer

How to write a custom function which will replace all the missing values in a vector with the mean of values in R?

Consider this vector: a<-c(1,2,3,NA,4,5,NA,NA) Write the function to impute ...READ MORE

answered Jul 4, 2018 in Data Analytics by CodingByHeart77
• 3,690 points
193 views
0 votes
1 answer

How can I convert a factor variable to numeric in R ?

A factor variable can be converted to ...READ MORE

answered Sep 18, 2018 in Data Analytics by shams
• 3,580 points
53 views
0 votes
1 answer

How can I convert a list to a dataframe?

L = ['1', '2','3','4','5'] #create new df df ...READ MORE

answered Sep 18, 2018 in Data Analytics by Anmol
• 3,620 points
37 views
0 votes
1 answer

How to run a file with .r extension?

Follow the below command: C:\Program Files\R\R-3.1.1\bin\Rscript.ex ...READ MORE

answered Apr 29 in Data Analytics by Tyrion anex
• 8,280 points
44 views
0 votes
0 answers

How to zip a folder with r image files from RStudio?

How to zip a folder with r ...READ MORE

Oct 10 in Data Analytics by ch
• 3,290 points
15 views
+1 vote
1 answer

How to convert a list of vectors with various length into a Data.Frame?

We can easily use this command as.data.frame(lapply(d1, "length< ...READ MORE

answered Apr 4, 2018 in Data Analytics by DeepCoder786
• 1,720 points
130 views
0 votes
1 answer

How can I list all the data sets available in all R packages?

You can use the below line of ...READ MORE

answered Sep 7, 2018 in Data Analytics by zombie
• 3,690 points
47 views
0 votes
1 answer

How can I import multiple .csv files into R ?

## import_multiple_csv_files_to_R # Purpose: Import multiple csv files ...READ MORE

answered Apr 19, 2018 in Data Analytics by zombie
• 3,690 points
834 views