How can I modify raw_dataframe to wished_dataframe?
raw_dataframe <- data.frame(
category=c('a','1','2','3','4'),
subcategory=c('b','3','2','1','0'),
item=c('wd','4','5','7','0'))
wished_dataframe <- data.frame(
category_a=c('1','2','3','4'),
subcategory_b=c('3','2','1','0'),
item_wd=c('4','5','7','0'))
I actually have many csv files, the structure like 'raw_dataframe ' and (I want to combine row 1 and row 2 as the variable name. Any one can help?