Saturday 15 August 2015

Why is there an unexpected symbol in my R code? -



Why is there an unexpected symbol in my R code? -

i not sure alter in r code remove unexpected symbol.

error: unexpected symbol in "lp=function(n1,n2,m2){n_hat_lp=(((n1)*(n2))/m2) return(n_hat_lp)}"

the problem have homecoming command on same line defining of n_hat_lp.

you set return(n_hat_lp) command on next line.

in fact, can simplify just:

lp=function(n1,n2,m2){((n1)*(n2))/m2}

there's no point in defining n_hat_lp return it. r understands if include want parameters.

r

No comments:

Post a Comment