diff --git a/NAMESPACE b/NAMESPACE index 063917c..d23a39e 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -14,7 +14,6 @@ export(removeInvalidDates) export(removeInvalidFlag) export(removeMissingEntry) export(removeNoInfo) -export(removeNonExistingRecord) export(removeNonProtectedFlag) export(removeSingleEntryCountry) export(removeZeroConflict) diff --git a/R/removeNonExistingRecord.R b/R/removeNonExistingRecord.R deleted file mode 100644 index 059e711..0000000 --- a/R/removeNonExistingRecord.R +++ /dev/null @@ -1,42 +0,0 @@ -##' Function to remove non-existing record -##' -##' Sometimes non-existing records (observation status flag and method flag and -##' value all NA) are returned by the database, or can be created by -##' denormalising the data. This function removes these records. -##' -##' @param data The data containing non-existing record -##' @param areaVar The column name corresponding to the geographic -##' area. -##' @param itemVar The column name corresponding to the commodity -##' item. -##' @param elementVar The column name corresponding to the measured -##' element. -##' @param yearVar The column name corresponding to the year. -##' @param flagObsVar The column name corresponding to the observation -##' status flag. -##' @param flagMethodVar The column name corresponding to the method -##' flag. -##' @param valueVar The column name corresponding to the value. -##' -##' @return Data with non-existing records omitted. -##' -##' @export -##' - -removeNonExistingRecord = function(data, - areaVar = "geographicAreaM49", - itemVar = "measuredItemCPC", - elementVar = "measuredElement", - yearVar = "timePointYears", - flagObsVar = "flagObservationStatus", - flagMethodVar = "flagMethod", - valueVar = "Value"){ - dataCopy = copy(data) - - requiredColumn = c(areaVar, itemVar, elementVar, yearVar, - flagObsVar, flagMethodVar, valueVar) - if(!all(requiredColumn %in% colnames(dataCopy))) - stop("Required column not in data, data has to be normalised!") - - dataCopy[!is.na(dataCopy[[flagObsVar]]) & !is.na(dataCopy[[flagMethodVar]]), ] -} diff --git a/man/removeNonExistingRecord.Rd b/man/removeNonExistingRecord.Rd deleted file mode 100644 index 6963110..0000000 --- a/man/removeNonExistingRecord.Rd +++ /dev/null @@ -1,42 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/removeNonExistingRecord.R -\name{removeNonExistingRecord} -\alias{removeNonExistingRecord} -\title{Function to remove non-existing record} -\usage{ -removeNonExistingRecord(data, areaVar = "geographicAreaM49", - itemVar = "measuredItemCPC", elementVar = "measuredElement", - yearVar = "timePointYears", flagObsVar = "flagObservationStatus", - flagMethodVar = "flagMethod", valueVar = "Value") -} -\arguments{ -\item{data}{The data containing non-existing record} - -\item{areaVar}{The column name corresponding to the geographic -area.} - -\item{itemVar}{The column name corresponding to the commodity -item.} - -\item{elementVar}{The column name corresponding to the measured -element.} - -\item{yearVar}{The column name corresponding to the year.} - -\item{flagObsVar}{The column name corresponding to the observation -status flag.} - -\item{flagMethodVar}{The column name corresponding to the method -flag.} - -\item{valueVar}{The column name corresponding to the value.} -} -\value{ -Data with non-existing records omitted. -} -\description{ -Sometimes non-existing records (observation status flag and method flag and -value all NA) are returned by the database, or can be created by -denormalising the data. This function removes these records. -} -