Skip to content

Commit

Permalink
fixed etopo error
Browse files Browse the repository at this point in the history
  • Loading branch information
rmendels committed Sep 24, 2019
1 parent 18995ef commit 3a9ab51
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: rerddapXtracto
Type: Package
Title: Extracts Environmental Data from 'ERDDAP' Web Services
Version: 0.4.3
Version: 0.4.4
Authors@R: person("Roy", "Mendelssohn", email = "[email protected]", role = c("aut","cre"))
Description: Contains three functions that access
environmental data from any 'ERDDAP' data web service. The rxtracto() function extracts
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# rerddapXtracto 0.4.4

- fixed etopo error reported by user

# rerddapXtracto 0.4.3

- fixed vignette to reflect new datasetID at IFREMER ERDDAP
Expand Down
14 changes: 9 additions & 5 deletions R/rxtracto.R
Original file line number Diff line number Diff line change
Expand Up @@ -320,9 +320,13 @@ oldDataFrame <- out_dataframe[1, ]


# populate the dataframe
out_dataframe[i, 1] <- mean(extract[[parameter]], na.rm = TRUE)
out_dataframe[i, 2] <- stats::sd(extract[[parameter]], na.rm = TRUE)
out_dataframe[i, 3] <- length(extract[[parameter]][!is.na(extract[[parameter]])])
parameter1 <- parameter
if (grepl('etopo',attributes(dataInfo)$datasetid)) {
parameter1 <- "depth"
}
out_dataframe[i, 1] <- mean(extract[[parameter1]], na.rm = TRUE)
out_dataframe[i, 2] <- stats::sd(extract[[parameter1]], na.rm = TRUE)
out_dataframe[i, 3] <- length(extract[[parameter1]][!is.na(extract[[parameter1]])])
if (!is.null(working_coords$tcoord1)) {
out_dataframe[i, 4] <- requesttime
}
Expand All @@ -335,8 +339,8 @@ oldDataFrame <- out_dataframe[1, ]
if (!is.null(working_coords$tcoord1)) {
out_dataframe[i, 11] <- as.character.Date(tcoord[i])
}
out_dataframe[i, 12] <- stats::median(extract[[parameter]], na.rm = TRUE)
out_dataframe[i, 13] <- stats::mad(extract[[parameter]], na.rm = TRUE)
out_dataframe[i, 12] <- stats::median(extract[[parameter1]], na.rm = TRUE)
out_dataframe[i, 13] <- stats::mad(extract[[parameter1]], na.rm = TRUE)

}
# store last request in case next one is same
Expand Down

0 comments on commit 3a9ab51

Please sign in to comment.