padders | R Documentation |

Padd vector by index

Pad vector front

Pad vector rear

Pad vector front + rear

x %[+% j x %+]% j x %[+]% j

`x` |
A vector |

`j` |
A one, or two element vector. One element: Pad |

A padded version of `x`

x <- rnorm(100) # Pad front with 10 zeros x%[+%10 # Same as x%[+%c(10,0) # Pad rear with zeros x%+]%10 # Same as x%+]%c(10,0) # Pad front + rear with NA x%[+]%c(NA,10) # Pad front + rear of a character vector "yes"%[+]%c(2,"no") "yes"%[+]%c(1,"no") "yes"%[+]%c(0,"no")

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.