0

I would like to transpose a set of columns in my data frame a. without needing to explicitly identifying the transposed column names in the script (there are >900) AND b. with the transposed columns being of varied data types

My data is horribly structured survey data with over 900 columns!! most columns are survey answers, and i want a very simple structure which is Name, Question, Answer

I've already tried the melt function of the reshape library however, i'm hitting the following snag noted in the the melt documentation: "..In the current implementation, there is only one assumption that melt makes: all measured values must be of the same type"

 name  Q1  Q2         Q3   Q900
 Jill  5   Sometimes  Yes  3
 Eve   2   Never      No   2




 name  Question  Answer
 Jill  Q1        5
 Jill  Q2        Sometimes
 Jill  Q3        Yes
 Jill  Q900      3
 Eve   Q1        2
 Eve   Q2        Never
 Eve   Q3        No
 Eve   Q900      2
D Note
  • 1
  • 1

0 Answers0