I want to name columns in a data.frame in r by using a txt file. I manipulated the original txt file to extract the text and made a list out of the prospective column names. But the problem is that I ended up seeing remnants of the list displayed in the column name which is not desired. I would appreciate suggestions what to do instead of creating a list? How to get the text and use it to name columns in r?
The columns names of the dataframe looks like this at the end of my code:
 "list(V2 = \"tBodyAcc-mean()-X\")" "list(V2 = \"tBodyAcc-mean()-Y\")"
 "list(V2 = \"tBodyAcc-mean()-Z\")" "list(V2 = \"tBodyAcc-std()-X\")"
This is what I did:
#read in the txt file
features<-read.table("C:/Adatok/coursera/3_getting and cleaning data/Quizes/Assignment/UCI HAR Dataset/features.txt", stringsAsFactors = FALSE)
1 1 tBodyAcc-mean()-X
2 2 tBodyAcc-mean()-Y
3 3 tBodyAcc-mean()-Z
#removed the first column with this command
#made a list