remove_zero_rows: Remove rows where specified column(s) has zero value...

Description Usage Arguments Value Author(s) Examples

View source: R/remove_zero_rows.R

Description

Remove rows where specified column(s) has zero value

Usage

1
2
  remove_zero_rows(Symbols, columns = "Volume",
    env = .GlobalEnv, store = TRUE)

Arguments

Symbols

names of instruments

columns

which columns to require to have positive, non-zero values ('Volume')

env

where to find the data. (.GlobalEnv)

store

should the data be overwritten? Must be TRUE if length(Symbols) > 1. If FALSE the cleaned data will be returned.

Value

usually called for side-effect, returning only the symbol names. If store=FALSE the cleaned data is returned.

Author(s)

Garrett See

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
get data for all big Vix futures that expire in 2010
getSymbols('VX',Month=1:12,Year=2010, require.volume=FALSE, src='cfe')
head(VX_F10); tail(VX_F10)
remove_zero_rows('VX_F10','Settle') #require 'Settle' column to be positive
head(VX_F10); tail(VX_F10) #Last row has zeros for everything except Settle.
remove_zero_rows("VX_G10",'Volume')
remove_zero_rows("VX_H10",c("Close","Settle","Volume"))
remove_zero_rows(c("VX_J10","VX_K10","VX_M10"),'Volume')

## End(Not run)

qmao documentation built on May 2, 2019, 4:54 p.m.