How to merge dat format files in R

r
machine_learning

#1

Hi, I am using PAMAP2 dataset from UCI.
the data is in DAT format and do not even have a column header.
these datasets are distributed in 9 sets.I want to first merge them, upload them and put the column header on
how can I proceed with this problem.
http://archive.ics.uci.edu/ml/datasets/PAMAP2+Physical+Activity+Monitoring


#2

Hi @sagar7958

get_data <- read.table('PAMAP2_Dataset/Protocol/subject101.dat', sep = ' ', header = F)
get_data <- as.data.frame(get_data)

You can set the columns names using colnames(get_data) <- c(the values) mentioned on the description page.