[R] reading data rows

forkusam forkusam at yahoo.com
Thu Nov 20 19:21:49 CET 2003


 I have problems reading a file with more than one row
to carry out mathematical calculations 

I have a a file  of the form 
mu1	mu2	alpha	beta	Wsigma sigmaA  b  r 
25	15	.05	.05	22	 3	  .3	.5
30	20	.1	.2	22	.3	  .3	.5

 I intend to read one row , carry out the calculations
and then the next row with which I intend to do the
same calculations.
I do the following.
p<-read.table(file="eingabe.csv", header=TRUE,sep=";")
	
data.frame(as.numeric(mu1<-p$mu1),as.numeric(mu2<-p$mu2),
		  
as.numeric(alpha<-p$alpha),as.numeric(beta<-p$beta),
		  
as.numeric(Wsigma<-p$Wsigma),as.numeric(sigmaA<-p$sigmaA),as.numeric(b<-p$b),as.numeric(r<-p$r))

I intend to  use the variables stored in the the data
frame for my caculations. but each time I try I get
the  followingerror message.

Error in uniroot(function(n) eval(p.body) - power,
c(2, 1e+07)) : 
        invalid function value in 'zeroin'
In addition: Warning message: 
the condition has length > 1 and only the first
element will be used in: if (f(lower, ...) * f(upper,
...) >= 0) stop("f() values at end points not of
opposite sign")

...which I do not get when I use just one row.

Thanks
sylvie


=====
=====================
Sylvie B. Forkusam
Eppelheimer Str.52/A2-5-2
69115 Heidelberg, Germany
Tel: (0049)-06221/346913
Mobile: 0179-6816276
=======================

__________________________________

Free Pop-Up Blocker - Get it now




More information about the R-help mailing list