No, simply access the components you want to get and put then into a
data.frame.
Let's make a nonsense lm() example that is reproducible for me:
result - lapply(1:10, function(i){
x - rnorm(10)
y - rnorm(10)
lm(y~x)
})
result
Now you want to get the coefficients by
Farrel Buchinsky wrote:
Uwe Ligges [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Simply speaking, the last value of a function is returned. You can also
explicitly call return(). You have to assign the value to a new variable
when you call the function. Example:
I read your
Uwe Ligges [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
$statistic
Chi-squared test
1.923077
$parameter
DF
1
$exact
[1] TRUE
$p.value
Chi-squared test12
0.16551790.26684570.2668457
$method
[1]
Uwe Ligges [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Simply speaking, the last value of a function is returned. You can also
explicitly call return(). You have to assign the value to a new variable
when you call the function. Example:
I read your explanation and I half get it.
Hi,
I have written a user defined function that carries
out a monte carlo simulation and outputs various
stats. I would like to access and store the simulation
data (a two column local variable) from outside the
function I have written. How can I output the data
from the function as new
Andrew Cox wrote:
Hi,
I have written a user defined function that carries
out a monte carlo simulation and outputs various
stats. I would like to access and store the simulation
data (a two column local variable) from outside the
function I have written. How can I output the data
from the
(GMT)
From: Andrew Cox [EMAIL PROTECTED]
To: r-help@stat.math.ethz.ch
Subject:[R] Outputing dataframe or vector from within a user
defined
function
Hi,
I have written a user defined function that carries
out a monte carlo simulation
Hi,
I have written a user defined function that carries
out a monte carlo simulation and outputs various
stats. I would like to access and store the simulation
data (a two column local variable) from outside the
function I have written. How can I output the data
from the function as new variable,