Message is very clear:
> 1 * 'a'
Error in 1 * "a" : non-numeric argument to binary operator
"wekt_n_ok " must be non-numeric. You need to provide a reproducible
script. You also need to learn about debugging. 'str(wekt_n_ok )' when
the
error occurred may have helped to pinpoint the problem.
On Sun, May 31, 2009 at 5:43 PM, Grze¶ <gregorio99@gmail.com> wrote:
>
> Hello!
> I have a function:
>
> zywnoscCalosc<- function( jedzenie, n1, n2, n3, n4, d1, d2, d3, d4 ) {
>
> ndf <- data.frame(nn1=n1,nn2=n2,nn3=n3,nn4=n4)
> ddf <- data.frame(dd1=d1,dd2=d2,dd3=d3,dd4=d4)
> for (i in 1:length(n1)){
>
> wekt_n = ndf[i,]
>
> wekt_n_ok = wekt_n[!is.na(wekt_n)]
>
>
> dl_n = length(wekt_n_ok)
> wynik = (1*wekt_n_ok)/(1*dl_n)
> }
> }
>
> and I get an error like this:
> Error in 1 * wekt_n_ok : non-numeric argument to binary operator
>
> Anybody can help me?
> --
> View this message in context:
>
http://www.nabble.com/Error%3Anon-numeric-argument-in-my-function-tp23807218p23807218.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<http://www.r-project.org/posting-guide.html>
> and provide commented, minimal, self-contained, reproducible code.
>
--
Jim Holtman
Cincinnati, OH
+1 513 646 9390
What is the problem that you are trying to solve?
[[alternative HTML version deleted]]