controlling R output -
i have code:
x <- rnorm(10) print(x)
is returning output:
[1] -0.67604293 -0.49002147 1.50190943 0.48438935 -0.17091949 0.39868189 [7] -0.57922386 -0.08172699 -0.82327067 0.07005629
i suppose r having limit of characters per line or , why splitting result in 2 lines. building service based on output of r.
what should in order in 1 line?
than better tell r output things in way convenient wrapper; check out string functions paste()
, sprintf()
, push result output cat()
; instance putting numbers in column like:
x<-rnorm(10) cat(paste(x,collapse="\n"),"\n")
what outputs just:
0.889105851072202 0.86920550247321 0.817785758768382 -0.0194490361401052 1.13386492568134 0.0786139738004322 0.7431631392675 0.93881227070957 0.534225167458455 1.08265812080696
Comments
Post a Comment