[R] Problem building/checking library that requires input from user

From: Ken Termiso <jerk_alert_at_hotmail.com>
Date: Mon 03 Oct 2005 - 23:41:05 EST


Hi all,

I've got a package i've written that i am trying to check, build, and install. This is my 1st time doing this, so apologies in advance... ;)

The package that I've written requires input from the user. It needs to know sample sizes and then runs some calcs, (sample sizes are just integers), and it gets this info from the user as

num_reps <- readline("How many reps do you have... ")

num_reps <- as.integer(num_reps)

and then loops

for(i in 1:num_reps)
{

      #code
}

HOWEVER, I get this error msg when trying to check/build/install:

Error in 1:num_con_biol_reps : NA/NaN argument

Presumably this is because R thinks the variable is never initialized before i try to use it as a loop limit...

Anyway around this?? I tried initializing the num_reps variable in the code before the readline, but get the same error...

Thanks very much in advance,
Ken



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Mon Oct 03 23:46:24 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:40:34 EST