rdotsch / rcicr

Reverse correlation image classification using R
9 stars 12 forks source link

batchGenerateCI2IFC() error #79

Closed olivethree closed 2 years ago

olivethree commented 7 years ago

Returns the following error:

Error in txtProgressBar(min = 1, max = npids, style = 3) : must have 'max' > 'min'

Also, I ran this function with the same data in the old package and it worked.

rdotsch commented 7 years ago

Could you paste the code that you used so we can reproduce this error?

olivethree commented 7 years ago

Here it is:

library(rcicr) # dev version library(png) library(stringr) library(tidyverse) library(broom)

Simulation settings

iter <- 300 # number of 2IFC task trials res <- 256

Generate base image

base_image <- strc("grey", res, ".png") writePNG(matrix(0.5, nrow=res, ncol=res), base_image)

baseimage <- 'grey'

Generate task stimuli

stimuli_set_1 <- generateStimuli2IFC(base_face_files=list("grey"=base_image), n_trials = iter, ncores = 2, returnAsDataframe = TRUE, seed = 1, img_size = 256, stimulus_path = "./stimuli_set_1")

Load Rdata file (attached)

rcic_seed_1_time_jul_19_2017_21_03.zip

rdata1 <- 'rcic_seed_1_time_jul_19_2017_21_03.Rdata' load(rdata1)

Generate random responses to simulate 2IFC task judgments

resp <- 1 # response value nr_response_sets <- 20 # simulated number of participants stim1responses <- sample(c(-resp,resp),iter*nr_response_sets,replace=TRUE)

dataset1 <- data.frame(subject = rep(1:nr_response_sets, each = iter), stimuli = rep(1:iter, times = nr_response_sets), responses = stim1responses)

Generates a set of individual CIs

sim_cis_1 <- batchGenerateCI2IFC(dataset1,'subject', 'stimuli', 'responses', baseimage, rdata1, saveaspng = TRUE, targetpath = "./sim_cis_1")

rdotsch commented 7 years ago

Thanks, I will take a look next week.

As a note to ourselves: In the development version, generateCI2IFC() will take over almost all functionality of batchGenerateCI2IFC(). It already performs the same computations when you specify the participants argument, it just doesn't save each participant's CI to a bitmap. (See #43)

rdotsch commented 2 years ago

This issue is now fixed in the development branch.