Learn R Programming

IBDhaploRtools (version 1.8)

removezeros: remove zeros

Description

remove zeros from a vector

Usage

removezeros(X)

Arguments

X
a vector

Value

the same vector but with zeros removed

Examples

Run this code

X = c(1,0,2,0,3)

removezeros(X)

## equivalently
 X[X!=0]

Run the code above in your browser using DataLab