use a pathname from a row in a dataframe in a for loop
问题 In an R script, I'd like to use use a pathname from a row in a dataframe in a for loop. For example, I'd like to get the directory size for each of the paths in column one in the following dataframe, by substituting "." in the code: sum(file.info(list.files(".", all.files = TRUE, recursive = TRUE))$size) with a value from the 'pathname' column. pathname size 1 F:/Asus/C_drive/WEPP/bitmap 0 2 F:/Asus/C_drive/WEPP/Data 0 3 F:/Asus/C_drive/WEPP/misc 0 4 F:/Asus/C_drive/WEPP/output 0 5 F:/Asus/C