Take a basic function
fun<-function(){
x<-c(1,2,3,4,5)
y<-c(1,2,3,4,5)
t<-x+y
return(t)
}
After I have run the function, is there a way I can access any of the variables created within the function. Either by specifying the variable- something like this:
fun$y
or
fun$t
or is there some way of asking R to save the variable within the function for use during my current R session (I'm not looking to save it permanently). AKA something along the lines of:
fun<-function(){
x<-c(1,2,3,4,5)
y<-c(1,2,3,4,5)
t<-x+y
Y<-save y for latter use
T<-save T for latter use
return(t)
}
Thanks!