How to transfer value from R command to other variables

rstudio

#1

boxplot.stats(golub[1042,gol.fac=="AML"], coef = 1.5, do.conf = TRUE, do.out = TRUE)
$stats
[1] 0.127580 0.461870 0.737840 0.955955 1.450140

$n
[1] 11

$conf
[1] 0.5024639 0.9732161

out [1] -0.74333 Above command boxplot return values such as stats, $n,$conf and $out
How I can transfer these values to other variables. Please help to advise. Thanks in advance.


#2

Just save the results to a variable. You'll then have a list and be able to access the different parts by name.

res <- boxplot.stats(golub[1042,gol.fac=="AML"], coef = 1.5, do.conf = TRUE, do.out = TRUE)
res[["stats"]]
# [1] 0.127580 0.461870 0.737840 0.955955 1.450140
res[["n"]]
# [1] 11