
Last chance! 50% off unlimited learning
Sale ends in
checkData(x, method = c("zoo","matrix","vector"), na.rm = FALSE, quiet = TRUE, ...)
checkDataMatrix(x, na.rm = TRUE, quiet = TRUE, ...)
checkDataVector(x, na.rm = TRUE, quiet = TRUE, ...)
checkDataZoo(x, na.rm = TRUE, quiet = TRUE, ...)
checkDataVector returns a vector
checkDataZoo returns a zoo object
checkData will make a reasonable assumption, or return the object requested by method
checkData
function grew out of three older functions: checkDataMatrix
,checkDataVector
, and checkDataZoo
. All three of these functions are provided as wrappers to checkData
for backwards compatibility and for clarity inside existing code. It is worth noting that the older checkData* functions set na.rm=TRUE
by default. The user is free to specify a value for this parameter to change the behavior.data(edhec)
x = checkData(edhec)
class(x)
head(x)
tail(x)
# Note that passing in a single column loses the row and column names
x = checkData(edhec[,1])
class(x)
head(x)
# Include the "drop" attribute to keep row and column names
x = checkData(edhec[,1,drop=FALSE])
class(x)
head(x)
x = checkData(edhec, method = "matrix")
class(x)
head(x)
x = checkData(edhec[,1], method = "vector")
class(x)
head(x)
Run the code above in your browser using DataLab