Hi there,

I have created the function below:

pirate<-function(x){
a<-x-1; b<-a/5; c<-a-b;
d<-c-1; e<-d/5; f<-d-e;
g<-f-1; h<-g/5; i<-g-h;
j<-i-1; k<-j/5; l<-j-k;
m<-l-1; n<-m/5; o<-m-n;
final<-o/5;

final
}

I want to run this function until the output ('final') is an exact integer
(e.g. 893.00000 rather than 893.78332).  I then need to find out what value
of X (input) resulted in this integer.  Could someone please help?  I am
relatively inexperienced at creating functions.

Kind regards,
James 

-- 
View this message in context: 
http://www.nabble.com/Function-Help-tp25848627p25848627.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to