Package 'dmir'

Title: Download Data From DMI via the API to the Open Data
Description: Access the DMI API.
Authors: Lars Dalby [aut, cre] (ORCID: <https://orcid.org/0000-0002-7270-6999>)
Maintainer: Lars Dalby <[email protected]>
License: MIT + file LICENSE
Version: 0.2.5
Built: 2026-06-08 08:27:07 UTC
Source: https://gitlab.au.dk/ecos/tools/r-pkgs/dmir

Help Index


Monthly mean temperature at Daneborg Greenland

Description

Dataset downloaded via the dmi_get_climate

Usage

daneborg

Format

A dataframe with 12 rows and 11 variables

Details

See the DMI documentation for further info.

The list column with paramterId has been stripped from the dataset. Use dmi_get_climate to get the full dataset.


Check the download from DMI API

Description

A simple checker function which simply determines if the download was empty or not.

Usage

dmi_check_download(data)

Arguments

data

json The downloaded object from dmi_get_met or from dmi_get_climate

Value

Returns TRUE if download not empty FALSE otherwise


Get climate data from DMI

Description

Get climate data from either station or a cell from the 10km or 20km grids

Usage

dmi_get_climate(
  parameter = NULL,
  station_id = NULL,
  cell_id = NULL,
  date_start = NULL,
  date_end = NULL,
  time_resolution = NULL,
  limit = "10",
  api_key = NULL
)

Arguments

parameter

chr The parameter to be downloaded

station_id

chr The station ID

cell_id

chr The cell ID from the 10 km x 10 km grid "Det Danske Kvadratnet". See the documentation here. Use your browser to search for "cellId".

date_start

chr First date of observations to be downloaded. Use the format "2021-12-24".

date_end

chr Last date of observations to be downloaded. Use the format "2021-12-24"

time_resolution

chr Either day, month & year

limit

chr The max number of observations to download. Current max allowed by the API is 300000. To avoid possible issues with scientific notation in R this needs to be provided as character. Default is "10".

api_key

chr The API key to use in the call to the API. Use Sys.getenv() to supply your API key. Don't store the API in any of your @return A file (temporary) with the download.


Get gridded climate data from DMI

Description

Get gridded climate data from either 10km or the 20km grid. the 10 km x 10 km grid is also know as "Det Danske Kvadratnet".

Usage

dmi_get_grid(
  parameter = NULL,
  grid = NULL,
  date_start = NULL,
  date_end = NULL,
  time_resolution = NULL,
  limit = "10",
  api_key = NULL
)

Arguments

parameter

chr The parameter to be downloaded

grid

10km or 20km

date_start

chr First date of observations to be downloaded. Use the format "2021-12-24".

date_end

chr Last date of observations to be downloaded. Use the format "2021-12-24"

time_resolution

chr Either day, month & year

limit

chr The max number of observations to download. Current max allowed by the API is 300000. To avoid possible issues with scientific notation in R this needs to be provided as character. Default is "10".

api_key

chr The API key to use in the call to the API. Use Sys.getenv() to supply your API key. Don't store the API in any of your @return A file (temporary) with the download.

Value

A file (temporary) with the download.


Get meterological observations from DMI

Description

Get meterological observations from DMI

Usage

dmi_get_met(
  parameter = NULL,
  station_id = NULL,
  date_start = NULL,
  date_end = NULL,
  limit = NULL,
  api_key = NULL
)

Arguments

parameter

chr The parameter to be downloaded

station_id

chr The station ID

date_start

chr First date of observations to be downloaded. Use the format "2021-12-24"

date_end

chr Last date of observations to be downloaded. Use the format "2021-12-24"

limit

chr The max number of observations to download. Current max allowed by the API is 300000. To avoid possible issues with scientific notation in R this needs to be provided as character.

api_key

chr The API key to use in the call to the API. Use Sys.getenv() to supply your API key. Don't store the API in any of your scripts.

Value

A file (temporary) with the download.


Get stations from DMI

Description

Download all DMI stations from Denmark and Greenland via the API

Usage

dmi_get_stations(api_key = NULL)

Arguments

api_key

chr The API key to use in the call to the API. Use Sys.getenv() to supply your API key. Don't store the API key in any of your scripts.

Value

A Simple Feature data set with the stations


"Det Danske Kvadratnet" at 10 km resolution.

Description

The grid is available at DMI Open Data Made available via dmir for convenience.

Usage

grid_10km

Format

A Simple feature collection with 609 features two columns:

cell_id

chr, CellID from the DMI grid

dmu_dmi_cell_id

int, The cellID from the DMI grid avialable via the DMI service provided to AU via the NOVANA program. See novana.dmi.dk


"Det Danske Kvadratnet" at 20 km resolution.

Description

The grid is available at DMI Open Data Made available via dmir for convenience.

Usage

grid_20km

Format

A Simple feature collection with 178 features two columns:

cell_id

chr, CellID from the DMI grid

dmu_dmi_cell_id

int, The cellID from the DMI grid avialable via the DMI service provided to AU via the NOVANA program. See novana.dmi.dk