I am trying to use package ROCR to analyze classification accuracy, unfortunately there are some problems right at the beginning. Question 1) When I try to run demo I am getting the following error message> library(ROCR) > demo(ROCR) > if(dev.cur() <= 1) .... [TRUNCATED]Error in get(getOption("device")) : wrong first argument When I issue the command> dev.cur()it returns null device 1 It seems something is wrong with my R-environment ? Could somebody provide a hint, what is wrong. Question 2) When I run an example commands from the manual library(ROCR) data(ROCR.simple) pred <- prediction( ROCR.simple$predictions, ROCR.simple$labels ) perf <- performance( pred, "tpr", "fpr" ) plot( perf ) the plot command issues the following error message Error in as.double(y) : cannot coerce type 'S4' to vector of type 'double' How this could be fixed ? Thanks for the support -- View this message in context: http://www.nabble.com/Using-package-ROCR-tp22198213p22198213.html Sent from the R help mailing list archive at Nabble.com.
Responding to question 1... it seems the demo assumes you already have a plot window open. library(ROCR) plot(1,1) demo(ROCR) seems to work. For question 2, my environment produces the expected results... plot doesn't generate an error: * R 2.8.1 GUI 1.27 Tiger build 32-bit (5301) * OS X 10.5.6 * ROCR 1.0-2 -Wil wiener30 wrote:> > I am trying to use package ROCR to analyze classification accuracy, > unfortunately there are some problems right at the beginning. > > Question 1) > When I try to run demo I am getting the following error message >> library(ROCR) >> demo(ROCR) >> if(dev.cur() <= 1) .... [TRUNCATED] > Error in get(getOption("device")) : wrong first argument > When I issue the command >> dev.cur() > it returns > null device > 1 > It seems something is wrong with my R-environment ? > Could somebody provide a hint, what is wrong. > > Question 2) > When I run an example commands from the manual > library(ROCR) > data(ROCR.simple) > pred <- prediction( ROCR.simple$predictions, ROCR.simple$labels ) > perf <- performance( pred, "tpr", "fpr" ) > plot( perf ) > > the plot command issues the following error message > Error in as.double(y) : > cannot coerce type 'S4' to vector of type 'double' > > How this could be fixed ? > > Thanks for the support > >-- View this message in context: http://www.nabble.com/Using-package-ROCR-tp22198213p22219437.html Sent from the R help mailing list archive at Nabble.com.
Thank you very much for the response! The plot(1,1) helped to resolve the first problem. But I am still getting a second error message when running demo(ROCR) Error in as.double(y) : cannot coerce type 'S4' to vector of type 'double' It seems it has something to do with compatibility of S4 objects. My versions of R and ROCR package are the same as you listed. But it seems something other is missing in my installation. William Doane wrote:> > > Responding to question 1... it seems the demo assumes you already have a > plot window open. > > library(ROCR) > plot(1,1) > demo(ROCR) > > seems to work. > > For question 2, my environment produces the expected results... plot > doesn't generate an error: > * R 2.8.1 GUI 1.27 Tiger build 32-bit (5301) > * OS X 10.5.6 > * ROCR 1.0-2 > > -Wil > > > > wiener30 wrote: >> >> I am trying to use package ROCR to analyze classification accuracy, >> unfortunately there are some problems right at the beginning. >> >> Question 1) >> When I try to run demo I am getting the following error message >>> library(ROCR) >>> demo(ROCR) >>> if(dev.cur() <= 1) .... [TRUNCATED] >> Error in get(getOption("device")) : wrong first argument >> When I issue the command >>> dev.cur() >> it returns >> null device >> 1 >> It seems something is wrong with my R-environment ? >> Could somebody provide a hint, what is wrong. >> >> Question 2) >> When I run an example commands from the manual >> library(ROCR) >> data(ROCR.simple) >> pred <- prediction( ROCR.simple$predictions, ROCR.simple$labels ) >> perf <- performance( pred, "tpr", "fpr" ) >> plot( perf ) >> >> the plot command issues the following error message >> Error in as.double(y) : >> cannot coerce type 'S4' to vector of type 'double' >> >> How this could be fixed ? >> >> Thanks for the support >> >> > >-- View this message in context: http://www.nabble.com/Using-package-ROCR-tp22198213p22220312.html Sent from the R help mailing list archive at Nabble.com.
> library(ROCR) > library(randomForest) > plot(results,significant)Error in as.double(x) : cannot coerce type 'S4' to vector of type 'double' After try with all the possibilities, it shows same error in simpleaffy data plot for the results. please someone guide me wiener30 wrote:> > I am trying to use package ROCR to analyze classification accuracy, > unfortunately there are some problems right at the beginning. > > Question 1) > When I try to run demo I am getting the following error message >> library(ROCR) >> demo(ROCR) >> if(dev.cur() <= 1) .... [TRUNCATED] > Error in get(getOption("device")) : wrong first argument > When I issue the command >> dev.cur() > it returns > null device > 1 > It seems something is wrong with my R-environment ? > Could somebody provide a hint, what is wrong. > > Question 2) > When I run an example commands from the manual > library(ROCR) > data(ROCR.simple) > pred <- prediction( ROCR.simple$predictions, ROCR.simple$labels ) > perf <- performance( pred, "tpr", "fpr" ) > plot( perf ) > > the plot command issues the following error message > Error in as.double(y) : > cannot coerce type 'S4' to vector of type 'double' > > How this could be fixed ? > > Thanks for the support > >-- View this message in context: http://www.nabble.com/Using-package-ROCR-tp22198213p22495365.html Sent from the R help mailing list archive at Nabble.com. [[alternative HTML version deleted]]