Learn R Programming

BatchGetSymbols (version 2.6.4)

df.fill.na: Replaces NA values in dataframe for closest price

Description

Helper function for BatchGetSymbols. Replaces NA values and returns fixed dataframe.

Usage

df.fill.na(df.in)

Arguments

df.in

DAtaframe to be fixed

Value

A fixed dataframe.

Examples

Run this code
# NOT RUN {
df <- data.frame(price.adjusted = c(NA, 10, 11, NA, 12, 12.5, NA ), volume = c(1,10, 0, 2, 0, 1, 5))

df.fixed.na <- df.fill.na(df)

# }

Run the code above in your browser using DataLab