February 27, 2015 · Public
Great videos with solid information. You make it much easier for me to wrap my head around the subject.
I am new to R and have a couple of questions (probably more after I know it better) about loading CSV files into a dataframe and adding more data to it once loaded.
1) How do you load a bunch of similar structured files from the same working directory into a single dataframe? If they have sequential numerical file names (like 001.csv to 005.csv) does that help? Is there something like a *.* notation to load everything? How do I eliminate each of the files' column headers in the dataframe or maybe just keep the first one and kill the rest? And, how to I only read in complete records from these files without any rows with NA values (or do the NA's have to be elimiated after reading in the CSVs)?
2) How do you read in additional columns of differently structured CSV data to an existing dataframe? Can it be done to both introduce additional data elements for the same observations and/or to create new rows of observations (maybe creating a bunch of NA values for the earlier records where the the new data is missing)?
I've read through the user guides and nothing jumps out for me as the answers I'm looking for. So your help is really appreciated. Thanks.