Saving text (string) data to the spreadsheet
Posted: Sun Oct 08, 2023 1:16 pm
Hello
Is it possible to save text as string values to the spreadsheet. I have a variable that is Categorical, with levels "C1", "C2" etc. If I use setValues, it is saved as numerical. Here is a simple version of what I am doing:
private = list(
.run = function() {
n<-42
IV<-rnorm(n)
IV2<-as.factor(paste0("C",ceiling(runif(n)*3)))
DV<-rnorm(n)
dataOut<-data.frame(IV=IV,IV2=IV2,DV=DV)
if (self$options$IVvalues) {
self$results$IVvalues$setValues(dataOut)
self$results$textOutput$setContent("Done!")
}
})
Many thanks,
Roger Watt
Is it possible to save text as string values to the spreadsheet. I have a variable that is Categorical, with levels "C1", "C2" etc. If I use setValues, it is saved as numerical. Here is a simple version of what I am doing:
private = list(
.run = function() {
n<-42
IV<-rnorm(n)
IV2<-as.factor(paste0("C",ceiling(runif(n)*3)))
DV<-rnorm(n)
dataOut<-data.frame(IV=IV,IV2=IV2,DV=DV)
if (self$options$IVvalues) {
self$results$IVvalues$setValues(dataOut)
self$results$textOutput$setContent("Done!")
}
})
Many thanks,
Roger Watt