Learn R Programming

rpymat (version 0.1.7)

py_slice: Slice index in 'Python' arrays

Description

Slice index in 'Python' arrays

Usage

py_slice(...)

Value

Index slice instance

Arguments

...

passing to slice ('Python')

Examples

Run this code


if(interactive() && dir.exists(env_path())) {

  x <- np_array(array(seq(20), c(4, 5)))

  # equivalent to x[::2]
  x[py_slice(NULL, NULL, 2L)]

}

Run the code above in your browser using DataLab