Displaying 3 results from an estimated 3 matches for "data_list".
2011 Apr 04
4
merging data list in to single data frame
Dear R community members
I did find a good way to merge my 200 text data files in to a single data
file with one column added will show indicator for that file.
filelist = list.files(pattern = "K*cd.txt") # the file names are K1cd.txt
.................to K200cd.txt
data_list <-lapply(filelist, read.table, header=T, comment=";", fill=T)
This will create list, but this is not what I want.
I want a single dataframe (all separate dataframes have same variable
headings) with additional row for example
; just for example, two small datasets are cr...
2024 Feb 19
5
Looping
I need to read csv files repeatedly, named data1.csv, data2.csv,? data24.csv, 24 altogether. That is,
data<-read.csv(?data1.csv?)
?
data<-read.csv(?data24.csv?)
?
Is there a way to do this in a loop? Thank you.
Steven from iPhone
[[alternative HTML version deleted]]
2009 Sep 21
2
Error in make.names when trying to read.table in if statement
Hi,
I'm trying to read data from a collection of CSV files for processing
and graphing. All of my files begin with "modrate" and end with
".csv". I think I have the regex working but I am stumped at trying to
get read.table to work within an if statement.
This works:
> filepattern="modrate*"
> files <- list.files(pattern=filepattern)
> data