Dear Marc,
Try
require(zoo)
na.locf(a)
HTH,
Jorge.-
On Thu, Nov 22, 2012 at 11:56 PM, Marc Girondot <> wrote:
> Dear members,
>
> I have a series of values in a vector and some value are missing and
> replaced with NA.
> For example:
> a <- c(27, 25, NA, NA, 24, 26, 27, NA, 26)
> I would like
Take a look at
na.locf()
in the zoo package. (LOCF = last observation carried forward)
RMW
On Thu, Nov 22, 2012 at 12:56 PM, Marc Girondot wrote:
> Dear members,
>
> I have a series of values in a vector and some value are missing and
> replaced with NA.
> For example:
> a <- c(27, 25, NA, NA,
Dear members,
I have a series of values in a vector and some value are missing and
replaced with NA.
For example:
a <- c(27, 25, NA, NA, 24, 26, 27, NA, 26)
I would like to replace the NAs with the value taken from the previous
value that is non-NA. The output would be in this case:
27 25 25
3 matches
Mail list logo