Closed maxheld83 closed 3 years ago
just to be clear, @aiorazabala, because I don't quite understand why people would use two central columns with zero – this is merely for because data entry is easier (b/c the column height is lower), correct?
three comments:
import.q.sorts()
currently does not look at any row to figure out the rank, but merely infers it from the index (left to right, from negative to positive).
So we'd need to add a) a convention for a row in which the column value (-2, -1, 0, 0, 1, 2) etc is stored and b) an alternative way to read in q sorts in that way, which, I worry, might make things more complex and buggier.So bottom line: I probably won't spend time doing this, but sure, why not, if people find it helpful.
Hummm, I see the logic of the import.q.sorts()
function.
if (1 == T)
then the problem would occur when someone enters these Q-sorts but excludes the last line indicating column values, Correct?Here's the code snippet I used to fix this issue when using our 'faulty' data.
mydata
is a raw matrix like the one you read from a Q-sort csv.
# Merge the 0 columns
central <- (ncol(mydata-1))/2
top.part <- matrix(data=NA, nrow=dim(mydata)[1], ncol=dim(mydata)[2]-1)
top.part[,central] <- mydata[ ,central+1]
colnames(top.part) <- colnames(mydata[ ,-(central+1)])
mydata <- rbind(top.part, mydata[ ,-(central+1)])
This could be either integrated inside the function (e.g. as an optional argument) or simply point at this snippet whenever someone has this issue.
@aiorazabala just suggested: