r - Creating a list/vector from first column od multiple data -


in total have 21 csv files load r. did:

list_of_data = list.files(pattern="*.csv") tbl_met = lapply(list_of_data, read.csv) 

can't give dput because it's data...

what want list off names in first column in datasets. combined 1 vector/list there 2 problems:

  • first of columns in files separated ";" or without separation mark... have inside files , make them separated in same way ?

  • second problem there might duplicates of names , i'd remove them list.

do have idea how ? should provide more data ? if yes, let me know how that.

i found solution. it's not easiest 1 works. first of had convert of csv files same pattern. easy task r.

later:

list_of_data = list.files(pattern="*.csv") tbl_met = lapply(list_of_data, read.csv) tbl <- rbindlist(tbl_met) ## binding of tables in list row  vec_names <- tbl$locus ## name of column names interested in vec <- unique(vec_names) ## removing duplicates 

nicely done!


Comments

Popular posts from this blog

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -