[Rcicr-users] ColMeans question

Dotsch, R. (Ron) R.Dotsch at uu.nl
Thu Dec 18 08:52:54 CET 2014


Hi Dan,

Your script misspecified the label referring to base image in the generateCI2IFC function and the list that combines both cis. In the development version (version 0.2.6) I have added user feedback to the package, so rcicr will give you a more informative error message that will help find this mistake.

Moreover, up until the current version, if you want images aggregated across subjects, you need to feed aggregated data into the generateCI2IFC. Otherwise the data structures become to big and R will crash with an error message. This is what will happen if you run the code below with your current version. However, I adapted generateCI2IFC do this automatically for you in the development version (version 0.2.6), so you don't have to do the aggregation yourself. The function will simply assume it can aggregate data that is fed into it by stimulus number. If you just provide the data for a single subject, the behavior will be the same as previously.

I have uploaded the development version to R-Forge and it is being built as we speak. You can see its current status at https://r-forge.r-project.org/R/?group_id=1932. As soon as its ready (status: current), you can follow the instructions on http://ron.dotsch.org/rcicr to install the development version. Then you should be able to run the following code without problems:

-----------------------
R code:
-----------------------
library(rcicr)
rdata <- 'rcicrdata.Rdata'

responsedata <- read.csv('rcicrdataM.csv')
ci1 <- generateCI2IFC(responsedata$Face, responsedata$correct, 'OldM', rdata)

responsedata <- read.csv('rcicrdataF.csv')
ci2 <- generateCI2IFC(responsedata$Face, responsedata$correct, 'OldF', rdata)

cis <- list(OldM=ci1, OldF=ci2)
scaled_cis <- autoscale(cis, saveasjpegs=T)
-----------------------

Hope this helps.

Best,

Ron



________________________________
Dr. Ron Dotsch

Utrecht University
Department of Psychology

Website: http://ron.dotsch.org


On Mon, Dec 15, 2014 at 4:22 AM, Dotsch, R. (Ron) <R.Dotsch at uu.nl<mailto:R.Dotsch at uu.nl>> wrote:
Hi Daniel,

I apologize for the cryptic error messages, this part of the package is definitely not user friendly yet, and something that I need to work on.

In your specific case, the error message reflects that your input is still incorrect. Can you send your code + .Rdata file + .csv file to me off-list so I can debug? I'll report the solution back to the list.

Best,

Ron

________________________________
Dr. Ron Dotsch

Utrecht University
Social and Organizational Psychology (Room E2.22)

Website: http://ron.dotsch.org<http://ron.dotsch.org/>


On Dec 12, 2014, at 17:40, Daniel Albohn <d.albohn at gmail.com<mailto:d.albohn at gmail.com>> wrote:

Thanks, Ron. I saw the error after I sent the email. However, after accounting for it, I still get the same colMeans error. That is, I seperated the data by base image and tried call the batchGenerateCI2IFC function again with no success. Do you have any idea what variable this the colMeans(weighted) is referring to?

To answer your other question, all participants saw both base image faces.

Thanks,
Dan


Daniel Albohn
484-332-7688<tel:484-332-7688>

On Fri, Dec 12, 2014 at 3:06 AM, Dotsch, R. (Ron) <R.Dotsch at uu.nl<mailto:R.Dotsch at uu.nl>> wrote:
Hi Daniel,

This is a bit complicated, because it depends on how you structured your data file and whether the different base images were presented to the same participants or to different ones. Anyway, you have made a mistake in your code. Your reference baseimage as argument to the call to batchGenerateCI2IFC but you define the two baseimages as separate variables earlier (baseimage1, baseimage2). For now, the easiest option is to only refer to one as baseimage, and make sure you then only supply the subset of responsedata that applies to that specific base image.

Best,

Ron

________________________________
Dr. Ron Dotsch

Utrecht University
Social and Organizational Psychology (Room E2.22)

Website: http://ron.dotsch.org<http://ron.dotsch.org/>


On Dec 12, 2014, at 00:48, Daniel Albohn <d.albohn at gmail.com<mailto:d.albohn at gmail.com>> wrote:

Hello all,

I’m attempting to analyze the data for a RC study using two base images. When I run the generateCI2IFC command, I get the following error:

Error in colMeans(weighted):
‘x’ must be an array of at least two dimensions

In my response data file I have four columns: 1) Subject_nbr (numerical), 2) Face (stim number presented), 3) Sex (gender of the stimulus presented), and 4) correct (1 or -1 based off of participant response).

Full script reproduced below. Thanks in advance for your help!

Best,
Dan

library(rcicr)
base_face_files<- list('OldM'='And_OldM.jpg', 'OldF'='And_OldF.jpg')

library(rcicr)

baseimage1 <- 'And_OldM'
baseimage2 <- 'And_OldF'

rdata <- 'rcicrdata.Rdata'

responsedata <- read.csv('rcicrdata.csv')

ci <- batchGenerateCI2IFC(responsedata, 'Sex', 'Face', 'correct', baseimage, rdata)

Daniel Albohn
Email<mailto:d.albohn at gmail.com>  | (484)332-7688<tel:%28484%29332-7688>

_______________________________________________
Rcicr-users mailing list
Rcicr-users at lists.r-forge.r-project.org<mailto:Rcicr-users at lists.r-forge.r-project.org>
http://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcicr-users




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcicr-users/attachments/20141218/a3806d62/attachment-0001.html>


More information about the Rcicr-users mailing list