Skip to contents

Updates the entire metadata for receivers and tags from Motus server. Contrary to tagme(), this function retrieves the entire set of metadata for tags and receivers, and not only those pertinent to the detections in your local file.

Usage

metadata(src, projectIDs = NULL, replace = TRUE, delete = FALSE)

Arguments

src

SQLite connection (result of tagme(XXX) or DBI::dbConnect(RSQLite::SQLite(), "XXX.motus"))

projectIDs

optional integer vector of Motus projects IDs for which metadata should be obtained; default: NULL, meaning obtain metadata for all tags and receivers that your permissions allow.

replace

logical scalar; if TRUE (default), existing data replace the existing metadata with the newly acquired ones.

delete

logical scalar; Default = FALSE. if TRUE, the entire metadata tables are cleared (for all projects) before re-importing the metadata.

See also

tagme() provides an option to update only the metadata relevant to a specific project or receiver file.

Examples


# download and access data from project 176 in sql format
# usename and password are both "motus.sample"
if (FALSE) sql.motus <- tagme(176, new = TRUE, update = TRUE)

# OR use example sql file included in `motus`
sql.motus <- tagme(176, update = FALSE, 
                   dir = system.file("extdata", package = "motus"))
                   
# Add extended metadata to your file
if (FALSE) metadata(sql.motus)
  
# Access different metadata tables
library(dplyr)
tbl(sql.motus, "species")
#> # Source:   table<species> [10 x 6]
#> # Database: sqlite 3.39.3 [/home/runner/work/_temp/Library/motus/extdata/project-176.motus]
#>       id english                french                       scien…¹ group  sort
#>    <int> <chr>                  <chr>                        <chr>   <chr> <int>
#>  1  4180 Semipalmated Plover    Pluvier semipalmé            Charad… BIRDS    NA
#>  2  4670 Red Knot               Bécasseau maubèche           Calidr… BIRDS    NA
#>  3  4680 Sanderling             Bécasseau sanderling         Calidr… BIRDS    NA
#>  4  4690 Semipalmated Sandpiper Bécasseau semipalmé          Calidr… BIRDS    NA
#>  5  4760 White-rumped Sandpiper Bécasseau à croupion blanc   Calidr… BIRDS    NA
#>  6  4780 Pectoral Sandpiper     Bécasseau à poitrine cendrée Calidr… BIRDS    NA
#>  7  4820 Dunlin                 Bécasseau variable           Calidr… BIRDS    NA
#>  8  4980 American Woodcock      Bécasse d'Amérique           Scolop… BIRDS    NA
#>  9 15560 Gray-cheeked Thrush    Grive à joues grises         Cathar… BIRDS    NA
#> 10 19050 White-crowned Sparrow  Bruant à couronne blanche    Zonotr… BIRDS    NA
#> # … with abbreviated variable name ¹​scientific
tbl(sql.motus, "projs")
#> # Source:   table<projs> [5 x 5]
#> # Database: sqlite 3.39.3 [/home/runner/work/_temp/Library/motus/extdata/project-176.motus]
#>      id name                                           label     tagsP…¹ senso…²
#>   <int> <chr>                                          <chr>       <int>   <int>
#> 1    47 Red Knot staging and migration ecology.        Niles          NA      NA
#> 2    57 Selva Colombia                                 Selva          NA      NA
#> 3    82 Maine - American Woodcock                      RBrownAM…      NA      NA
#> 4   146 Neonicotinoid insecticides and migratory birds NEONICS        NA      NA
#> 5   176 Sample Data                                    SampleDa…      NA      NA
#> # … with abbreviated variable names ¹​tagsPermissions, ²​sensorsPermissions
tbl(sql.motus, "tagDeps")
#> # Source:   table<tagDeps> [?? x 24]
#> # Database: sqlite 3.39.3 [/home/runner/work/_temp/Library/motus/extdata/project-176.motus]
#>    tagID deployID projectID tsStart  tsEnd defer…¹ speci…² marke…³ marke…⁴ sex  
#>    <int>    <int>     <int>   <dbl>  <dbl>   <dbl>   <int> <chr>   <chr>   <chr>
#>  1 10811     1077        47  1.41e9 1.44e9       0    4670 metal … U       NA   
#>  2 16011     1798       176  1.44e9 1.45e9       0    4690 metal … 246108… NA   
#>  3 17357     1818       176  1.44e9 1.45e9       0    4760 metal … 246114… NA   
#>  4 16035     1823       176  1.44e9 1.45e9       0    4690 metal … 246108… NA   
#>  5 16036     1824       176  1.44e9 1.45e9       0    4690 metal … 246108… NA   
#>  6 16037     1825       176  1.44e9 1.45e9       0    4690 metal … 246107… NA   
#>  7 16038     1826       176  1.44e9 1.45e9       0    4690 metal … 246107… NA   
#>  8 16039     1827       176  1.44e9 1.45e9       0    4690 metal … 246107… NA   
#>  9 16044     1832       176  1.44e9 1.45e9       0    4760 metal … 246114… NA   
#> 10 16047     1839       176  1.44e9 1.46e9       0    4670 metal … 135268… NA   
#> # … with more rows, 14 more variables: age <chr>, latitude <dbl>,
#> #   longitude <dbl>, elevation <dbl>, comments <chr>, test <int>,
#> #   attachment <chr>, tsStartCode <chr>, tsEndCode <chr>, bandNumber <chr>,
#> #   id <int>, bi <int>, fullID <chr>, status <chr>, and abbreviated variable
#> #   names ¹​deferSec, ²​speciesID, ³​markerType, ⁴​markerNumber
# Etc.