@@ -103,11 +103,11 @@
Loading
103 103
  structure(list(variables=vars, alldata=oo, base_url=url),
104 104
            class="info",
105 105
            datasetid=datasetid,
106 -
            type=table_or_grid(datasetid))
106 +
            type=table_or_grid(datasetid, url))
107 107
}
108 108
109 109
#' @export
110 -
print.info <- function(x, ...){
110 +
print.info <- function(x, ...) {
111 111
  global <- x$alldata$NC_GLOBAL
112 112
  tt <- global[ global$attribute_name %in%
113 113
                  c('time_coverage_end','time_coverage_start'), "value", ]
@@ -115,6 +115,7 @@
Loading
115 115
  vars <- x$alldata[x$variables$variable_name]
116 116
  cat(sprintf("<ERDDAP info> %s", attr(x, "datasetid")), "\n")
117 117
  cat(paste0(" Base URL: ", x$base_url), "\n")
118 +
  cat(paste0(" Dataset Type: ", attr(x, "type")), "\n")
118 119
  if(attr(x, "type") == "griddap") cat(" Dimensions (range): ", "\n")
119 120
  for(i in seq_along(dims)){
120 121
    if(names(dims[i]) == "time"){
@@ -154,3 +155,16 @@
Loading
154 155
as.info.character <- function(x, url) {
155 156
  info(x, url)
156 157
}
158 +
159 +
table_or_grid <- function(datasetid, url) {
160 +
  table_url <- paste0(url, 'tabledap/index.json')
161 +
  tab <- toghelper(table_url)
162 +
  if (datasetid %in% tab) "tabledap" else "griddap"
163 +
}
164 +
165 +
toghelper <- function(url) {
166 +
  out <- erdddap_GET(url, list(page = 1, itemsPerPage = 10000L))
167 +
  nms <- out$table$columnNames
168 +
  lists <- lapply(out$table$rows, stats::setNames, nm = nms)
169 +
  vapply(lists, "[[", "", "Dataset ID")
170 +
}

@@ -176,6 +176,10 @@
Loading
176 176
  orderbymax=NULL, orderbymin=NULL, orderbyminmax=NULL, units=NULL,
177 177
  url = eurl(), store = disk(), callopts=list()) {
178 178
179 +
  if (inherits(x, "info")) {
180 +
    url <- x$base_url
181 +
    message("info() output passed to x; setting base url to: ", url)
182 +
  }
179 183
  x <- as.info(x, url)
180 184
  fields <- paste(fields, collapse = ",")
181 185
  url <- sprintf(paste0(url, "tabledap/%s.csv?%s"), attr(x, "datasetid"),

@@ -14,8 +14,15 @@
Loading
14 14
         call. = FALSE)
15 15
  }
16 16
17 -
  x <- as.info(x, url)
18 17
  dimargs <- list(...)
18 +
  if (length(dimargs) == 0) stop("no dimension arguments passed, see ?griddap")
19 +
  if (inherits(x, "info")) {
20 +
    url <- x$base_url
21 +
    message("info() output passed to x; setting base url to: ", url)
22 +
  }
23 +
  x <- as.info(x, url)
24 +
  if (attr(x, "type") != "griddap")
25 +
    stop("datasetid '", attr(x, "datasetid"), "' not of type griddap")
19 26
  check_dims(dimargs, x)
20 27
  check_lat_text(dimargs)
21 28
  check_lon_text(dimargs)

@@ -62,19 +62,6 @@
Loading
62 62
  print(tibble::as_tibble(x$info))
63 63
}
64 64
65 -
table_or_grid <- function(datasetid){
66 -
  table_url <- paste0(eurl(), 'tabledap/index.json')
67 -
  tab <- toghelper(table_url)
68 -
  if (datasetid %in% tab) "tabledap" else "griddap"
69 -
}
70 -
71 -
toghelper <- function(url){
72 -
  out <- erdddap_GET(url, list(page = 1, itemsPerPage = 10000L))
73 -
  nms <- out$table$columnNames
74 -
  lists <- lapply(out$table$rows, stats::setNames, nm = nms)
75 -
  vapply(lists, "[[", "", "Dataset ID")
76 -
}
77 -
78 65
#' @export
79 66
#' @rdname ed_search
80 67
ed_datasets <- function(which = 'tabledap', url = eurl()){
Files Coverage
R 62.02%
Project Totals (20 files) 62.02%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading