locf() implements 'last observation carried forward':
NA's are imputed with the most recent non-
nocb() is the complement: 'next observation carried backward':
NA's are imputed with the next non-NA value.
forbak() first executes
nocb(), so that even leading NAs are imputed. If even one non-NA value is present,
forbak() should not return any
bakfor() does the reverse.
1 2 3 4 5 6 7
a vector possibly with some missing values and some non-missing values
a vector like
locf: locf last observation carried forward
forbak: forbak locf followed by nocb
bakfor: bakfor nocb followed by locf
nocb: nocb next observation carried backward
1 2 3
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.