Gistlib Logo

gistlib

subset a part of a list of files by using names in r in r

main.r
# List of files
file_list <- c("file1.csv", "file2.csv", "file3.csv", "file4.csv")

# Subset files containing "file2"
subset_files <- file_list[grep("file2", file_list)]
subset_files
183 chars
7 lines

similar r code snippets

filter a dataframe from specific variable value superior to in r
subset a list using time in r
write a function to subset a data.table, then wight unit test for that function in r
loop through all files in a folder in r
find the size of a csv file in r
correlation matrix with certain variables in r
removing column from a df with their names in r
remove column 'a' and 'c' from a df in r
select a column in data frame in r
remove an element from an array at a specific index in r

related categories

r
subset
files

gistlibby LogSnag