Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>What I did in the end was print out the headers using libreoffice labeled as V1,V2, etc. then I just read in the file as</p> <pre><code> m1 &lt;- read.csv('Sheet1.csv', header=FALSE, skip=1) </code></pre> <p>and then just did the analysis against m1$V10, m1$V23 etc...</p> <p>To get around the mess of multiple columns I used the following little function</p> <pre><code># function to merge columns into one with a space separator and then # remove multiple spaces mcols &lt;- function(df, cols) { # e.g. mcols(df, c(14:18)) exp &lt;- paste('df[,', cols, ']', sep='', collapse=',' ) # this creates something like... # "df[,14],df[,15],df[,16],df[,17],df[,18]" # now we just want to do a paste of this expression... nexp &lt;- paste(" paste(", exp, ", sep=' ')") # so now nexp looks something like... # " paste( df[,14],df[,15],df[,16],df[,17],df[,18] , sep='')" # now we just need to parse this text... and eval() it... newcol &lt;- eval(parse(text=nexp)) newcol &lt;- gsub(' *', ' ', newcol) # replace duplicate spaces by a single one newcol &lt;- gsub('^ *', '', newcol) # remove leading spaces gsub(' *$', '', newcol) # remove trailing spaces } # mcols(df, c(14:18)) </code></pre> <p>No doubt somebody will be able to clean this up!</p> <p>To tidy up Likert-like scales I used:</p> <pre><code># function to tidy c('Strongly Agree', 'Agree', 'Disagree', 'Strongly Disagree') tidylik4 &lt;- function(x) { xlevels &lt;- c('Strongly Disagree', 'Disagree', 'Agree', 'Strongly Agree') y &lt;- ifelse(x == '', NA, x) ordered(y, levels=xlevels) } for (i in 44:52) { m2[,i] &lt;- tidylik4(m2[,i]) } </code></pre> <p>Feel free to comment as no doubt this will come up again!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload