Just FYI, the R interpreter typically saves the last value returned briefly
in a variable called .Last.value that can be accessed before you do anything
else.
> sin(.5)
[1] 0.4794255
> temp <- .Last.value
> print(temp)
[1] 0.4794255
> sin(.666)
[1] 0.6178457
> .Last.value
[1] 0.6178457
> temp
[1]
Fragile and probably a bad idea, but:
"%.%" <- function(x,y) { assign(deparse(substitute(x)), y,
parent.frame()); print(y) }
> a %.% "hello"
[1] "hello"
> a
[1] "hello"
Not sure how much value this has over other idioms such as wrapping
the assignment in parentheses, which makes
Warm greetings to you all.
Using the tapply function below:
data<-read.table("FD1month",col.names = c("Dates","count"))
x=data$count
f<-factor(data$Dates)
AB<- tapply(x,f,mean)
I made a simple calculation. The result, stored in AB, is of the form
below. But an effort to write AB to a file as a
3 matches
Mail list logo