<- function(filepath, auto.colnames=TRUE, fun.col=function(col,cols){cols[cols==col]<-paste(col,"Ibex",sep=".");return(cols)}) {
read.pcibex <- max(count.fields(filepath,sep=",",quote=NULL),na.rm=TRUE)
n.cols if (auto.colnames){
<- c()
cols <- file(filepath, "r")
con while ( TRUE ) {
<- readLines(con, n = 1, warn=FALSE)
line if ( length(line) == 0) {
break
}<- regmatches(line,regexec("^# (\\d+)\\. (.+)\\.$",line))[[1]]
m if (length(m) == 3) {
<- as.numeric(m[2])
index <- m[3]
value if (is.function(fun.col)){
<- fun.col(value,cols)
cols
}<- value
cols[index] if (index == n.cols){
break
}
}
}close(con)
return(read.csv(filepath, comment.char="#", header=FALSE, col.names=cols))
}else{
return(read.csv(filepath, comment.char="#", header=FALSE, col.names=seq(1:n.cols)))
} }
5 After coding is done
Here we will discuss what you should do after you think you have done your coding part and made sure everything works properly. You will need to share your experiment with participants or testers and manage the spread links. After you gather the data you will need to analyze it.
5.1 Making sure everything works
To make sure that your code performs as intended regularly preview your experiment in the area at the bottom of your screen. Press “refresh” to watch the code performance within this part of the screen or “Open in new tab” to better understand how it looks like for your participants. Error messages and warnings appear at the top right corner of the screen. In order to hide this error window type DebugOff() in your code.
5.3 Analyze the results
To download the results you should on the ‘Results’ button in the right-hand menu, click the “more options” (three dots on the right). Select the desired tab with the results of the demo or data-collection link. Click “Download” button and you will download funny-looking .csv file with results collected with the chosen link.
The given .csv is difficult to analyze by itself but the project team provide a technical decision how to transform in into the better looking format in the R language. You can perform this function below in your .R code to read the data in a nice way. After this you can manipulate and analyze the data in an easier manner.