dpc10ster / RJafroc

Artificial Intelligence: Evaluating AI, optimizing AI
19 stars 8 forks source link

DfReadDataFile error on data w/o control #64

Closed hrktkhs closed 3 years ago

hrktkhs commented 3 years ago

Hi,

I am trying to import an excel sheet in which no control exists. That means all cases include at least one lesion in each- all cases have lesion ID with 1 or more in "Truth" sheet. DfReadDataFile does not work on this sheet and return error below:

Error in [<-(*tmp*, , , k2 + K1, (1:lesionVector[k2]) + 1, value = 1) : subscript out of bounds

Could you help me to solve this problem?

dpc10ster commented 3 years ago

You are most likely using the CRAN version of RJafroc. Please use the GitHub version on the master branch. If you upload a dummy file I can test it and tell for sure.

dpc10ster commented 3 years ago

Dummy data.xlsx

Using this data and the version of code on master branch:

library(RJafroc)
x <- DfReadDataFile("Dummy data.xlsx")                                                                                                                               
str(x)
List of 3
 $ ratings     :List of 3
  ..$ NL   : num [1, 1:2, 1:10, 1] -Inf -Inf 40 30 -Inf ...
  ..$ LL   : num [1, 1:2, 1:10, 1:3] 90 70 100 90 90 70 80 100 70 100 ...
  ..$ LL_IL: logi NA
 $ lesions     :List of 3
  ..$ perCase: int [1:10] 1 1 1 3 1 1 2 1 1 3
  ..$ IDs    : num [1:10, 1:3] 1 1 1 1 1 1 1 1 1 1 ...
  ..$ weights: num [1:10, 1:3] 1 1 1 0.333 1 ...
 $ descriptions:List of 7
  ..$ fileName     : chr "Dummy data"
  ..$ type         : chr "FROC"
  ..$ name         : logi NA
  ..$ truthTableStr: num [1, 1:2, 1:10, 1:4] 1 1 NA NA NA NA NA NA NA NA ...
  ..$ design       : chr "FCTRL"
  ..$ modalityID   : Named chr "1"
  .. ..- attr(*, "names")= chr "1"
  ..$ readerID     : Named chr [1:2] "1" "2"
  .. ..- attr(*, "names")= chr [1:2] "1" "2"
dpc10ster commented 3 years ago

I have reopened the issue; please use only this forum until we solve it.

How can I install master brunch of the code?
installing "devtools" vis Github?

install.packages("devtools")
library(devtools)
install_github("dpc10ster/rjafroc")
library(RJafroc)

However, it doesn't work. 

Your last comment does not give me much to work on: what error messages do you get?

That being said, you seem to be doing the right things.   It works on my machine, see pdf below.

You might try (requires package remotes to be installed) 

remotes::install_github("dpc10ster/RJafroc")

Or try running directly from Terminal window (need to be in your working directory)

Rscript -e 'remotes::install_github("dpc10ster/RJafroc")'

install.pdf

hrktkhs commented 3 years ago

Thanks, it looks like the issue with the Rtools. I have installed the newer version and did work.

https://stackoverflow.com/questions/20023739/install-rtools-on-r-version-3-0-2 The same error reported here.

dpc10ster commented 3 years ago

Great! Thank you. This thread will be useful to other users.