Skip to contents

Find a "Météo France" station using a description, code or name.

Usage

findStationMF(desc = NULL, id = NULL, name = NULL, one = TRUE)

Arguments

desc

A character string to be matched against the description of the station.

id

A character string to be matched against the identifier (id) of the station.

name

A character string to be matched against the name of the station. Character case and accents are likely to generate problems.

one

Logical. If TRUE the selection must correspond to exactly one station.

Value

A one-row data frame with several elements giving the code, the name, the directory name for the station. The column Dir gives the (a possible) name of for a directory containing the data.

Note

By construction, this function can only find one function in order to allow automated treatments. When several stations match, an error with a suitable message is thrown.

Author

Yves Deville

Examples


findStationMF(desc = "rennes-st")
#>                Desc    Id              Name      Lat    Lon Alt
#> 1 rennes-st-jacques 07130 RENNES-ST JACQUES 48.06883 -1.734  36
#>                       Dir
#> 1 07130_rennes-st-jacques
findStationMF(desc = "troy")
#>              Desc    Id            Name      Lat  Lon Alt                   Dir
#> 1 troyes-barberey 07168 TROYES-BARBEREY 48.32467 4.02 112 07168_troyes-barberey
## error
try(findStationMF(desc = "tro"))
#> Several matches found:
#> 1 troyes-barberey 07168
#> 2 serge-frolow-ile-tromelin 61976
#> Error in findStationMF(desc = "tro") : 
#>   several stations match. Hint. use 'id ='