prompt - R prompting [1] 1 while running a function -
i prepared complex r function running nicely. however, each time running r fills screen following expression:
[1] 1 [1] 1 [1] 1 [1] 1 [1] 1 [1] 1 i wondering if there way avoid prompting r. here can give example of function:
y=function(x){ results=rep(0, length(x)) (i in (1:length(x))) { if (x[i]>0) { results[i]=u(x) } } } u=function(x){ output=x+1 return(output) }
you sink("nul"), so:
u(9) #[1] 10 sink("nul") u(9) sink() u(9) #[1] 10
Comments
Post a Comment