# How to access the last value in a vector in R?

R ProgrammingServer Side ProgrammingProgramming

This can be done by using tail function.

## Example

> x<-c(253,254,36,874,351,651,245,274,19,1095)
> tail(x,n=1)
[1] 1095
[1] -0.6565688