From 6c66baedf50af46f1270e08f36d00b3110e1c93a Mon Sep 17 00:00:00 2001 From: nickmckay Date: Sat, 6 Jul 2024 22:19:30 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20nickmcka?= =?UTF-8?q?y/lipdR@854e65a926156fdcb8232ed258bf3142aca44327=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- articles/Query.html | 60 ++++++++++++++++++++++--------------------- articles/Summary.html | 21 +++++++-------- pkgdown.yml | 2 +- 3 files changed, 43 insertions(+), 40 deletions(-) diff --git a/articles/Query.html b/articles/Query.html index 62ff142..d253582 100644 --- a/articles/Query.html +++ b/articles/Query.html @@ -98,8 +98,9 @@

LiPD Queries

Let’s get a sense for what the table holds

 dim(queryTable)
-#> Error in eval(expr, envir, enclos): object 'queryTable' not found
-names(queryTable)
+#> Error in eval(expr, envir, enclos): object 'queryTable' not found
+
+names(queryTable)
 #> Error in eval(expr, envir, enclos): object 'queryTable' not found

That’s a lot of rows! There’s a row for every time series in the LiPDverse database

@@ -111,7 +112,7 @@

LiPD Queries

session

If you tell queryLipdverse to skip.update once, it will not prompt you again in a given R session

-
+
 qt <- queryLipdverse(variable.name = c("δ18O"),
                      skip.update = TRUE)
 #> Based on your query parameters, there are 0 available time series in 0 datasets
@@ -119,12 +120,12 @@

LiPD Queries

Let’s have a look at the unique paleoData variable.name

We’ll just look at the first 250, there are quite a few

-
+
 unique(queryTable$paleoData_variableName)[1:250]
 #> Error in eval(expr, envir, enclos): object 'queryTable' not found

There’s quite a few notation styles, but they all have “18o” in common, so let’s try that

-
+
 qt <- queryLipdverse(variable.name = c("18o"))
 #> Based on your query parameters, there are 1688 available time series in 1069 datasets

Now that is a lot more data

@@ -135,7 +136,7 @@

LiPD Queries

For the variable.name parameter, multiple entries are combined with “OR” logic, so more entries will generally pull more datasets

-
+
 qt <- queryLipdverse(variable.name = c("δ18O", "d18O"))
 #> Based on your query parameters, there are 1688 available time series in 1069 datasets

This gets us almost the same result, but we see the simplified filter @@ -143,24 +144,24 @@

LiPD Queries

Also note that capitalization makes no difference here

The archive.type filter works similarly, let’s look at our options

-
+
 unique(queryTable$archiveType)
 #> Error in eval(expr, envir, enclos): object 'queryTable' not found

Note that we have distinct options: “Lake”, “LakeSediment”, “LakeDeposits”, “LakeDeposit”, and “Lake Sediment”

We can grab the archive.type names and search for all of them like this

-
+
 qt <- queryLipdverse(archive.type = unique(queryTable$archiveType)[c(2,3,5,6,39)])
 #> Error in eval(expr, envir, enclos): object 'queryTable' not found

Or we can use the simplification strategy again

-
+
 qt <- queryLipdverse(archive.type = c("lake"))
 #> Based on your query parameters, there are 46308 available time series in 2309 datasets

As we saw last time, the results are similar

We can also filter based on publications: Author, DOI, Title, etc. using pub.info

-
+
 qt <- queryLipdverse(pub.info = c("10.1016/j.quascirev.2008.09.005"))
 #> Based on your query parameters, there are 20 available time series in 7 datasets

This query can be a little slow if you don’t narrow the results with @@ -170,11 +171,11 @@

LiPD Queries

coord, country, continent, and ocean

Let’s grab all the North American datasets

-
+
 qt <- queryLipdverse(continent = "North America")
 #> Based on your query parameters, there are 46652 available time series in 1817 datasets

Let’s grab just those from Mexico

-
+
 qt <- queryLipdverse(country = c("Mexico"))
 #> Based on your query parameters, there are 512 available time series in 36 datasets

Note that the country and contient filters are not filtered based on @@ -185,12 +186,12 @@

LiPD Queries

continent with unique()

We can also use latitude and longitude directly with a bounding box

-
+
 qt <- queryLipdverse(coord = c(0,90,-180,-110))
 #> Based on your query parameters, there are 14062 available time series in 772 datasets

We can limit this to only marine data by setting ocean to TRUE

-
+
 qt <- queryLipdverse(coord = c(0,90,-180,-110),
          ocean = TRUE)
 #> Based on your query parameters, there are 1485 available time series in 85 datasets
@@ -199,11 +200,11 @@

LiPD Queries

unreliable in coastal areas

We can also grab all the data from a compilation, such as the Western North America (WNAm)

-
+
 qt <- queryLipdverse(compilation = c("wNAm"))
 #> Based on your query parameters, there are 392 available time series in 184 datasets

or multiple compilations

-
+
 qt <- queryLipdverse(compilation = c("wnam", "temp12k"))
 #> Based on your query parameters, there are 1717 available time series in 799 datasets

the compilation filter uses “OR” logic

@@ -212,13 +213,13 @@

LiPD Queries

We can pull summer, commonly defined as June, July, and August, for the Northern Hemisphere

seasonality input is taken as a list

-
+
 qt <- queryLipdverse(continent = "North America",
                seasonality = list("June", "July", "August"))
 #> Based on your query parameters, there are 1 available time series in 1 datasets

Okay, so this must not be a good choice of format, let’s see how LiPD authors define their seasons

-
+
 unique(queryTable$interpretation1_seasonality)
 #> Error in eval(expr, envir, enclos): object 'queryTable' not found

It looks like numeric months are most common. Season names, @@ -233,7 +234,7 @@

LiPD Queries

data with ANY of these months

Let’s try to get all of the summer datasets by entering a few different notations

-
+
 qt <- queryLipdverse(continent = "North America",
                seasonality = list(list("6", "7", "8"), list("summer"), list("JJA")))
 #> Based on your query parameters, there are 219 available time series in 165 datasets
@@ -244,7 +245,7 @@

LiPD Queries

season.not

The input for for season.not works the same as seasonality

-
+
 qt <- queryLipdverse(continent = "North America",
                seasonality = list(list("6", "7", "8"), list("summer"), list("JJA")),
                season.not = list(list("annual"), list("December"), list("12","1","2"), list("winter"), list("cold")))
@@ -256,15 +257,16 @@ 

LiPD Queries

These variables are expressed in two different formats: interpretation variable and interpretation detail

Each of these variables has four possible interpretation slots

-
+
 unique(queryTable$interp_Vars)
-#> Error in eval(expr, envir, enclos): object 'queryTable' not found
-
+#> Error in eval(expr, envir, enclos): object 'queryTable' not found
+
+
 unique(queryTable$interp_Details)
 #> Error in eval(expr, envir, enclos): object 'queryTable' not found

Let’s look at some marine interp.vars in the northeast Pacific

-
+
 qt <- queryLipdverse(coord = c(0,90,-180,-110),
                ocean = TRUE,
                interp.vars =  c("SST", "upwelling", "SSS"))
@@ -272,7 +274,7 @@ 

LiPD Queries

That gives us just a few datasets

Perhaps we’ll have more luck with interp.details, which is more standardized

-
+
 qt <- queryLipdverse(coord = c(0,90,-180,-110),
                ocean = TRUE,
                interp.details = c("sea@surface", "elNino"))
@@ -280,7 +282,7 @@ 

LiPD Queries

let’s see if we grab more using both

These inputs combine with “OR” logic, so we may gather more datasets by using both parameters

-
+
 qt <- queryLipdverse(coord = c(0,90,-180,-110),
                ocean = TRUE,
                interp.details = c("sea@surface", "elNino"),
@@ -292,7 +294,7 @@ 

LiPD Queries

We’ll look for marine archives in the northeast Pacific, with interpretations related to marine climate variables in the summer months only

-
+
 qt <- queryLipdverse(coord = c(0,90,-180,-110),
                archive.type = c("marine", "ocean"),
                ocean = TRUE,
@@ -305,7 +307,7 @@ 

LiPD Queries

have what effect on filtering

We’ll narrow the results further by adding author names to find within the publication info

-
+
 qt <- queryLipdverse(coord = c(0,90,-180,-110),
                archive.type = c("marine", "ocean"),
                ocean = TRUE,
@@ -349,7 +351,7 @@ 

LiPD Queries

When you’re satisfied with the query results, we can simply put the filtered query table into the readLipd() function to download the datasets

-
+
 D <- readLipd(qt)
 #> Error in value[[3L]](cond): Error: get_src_or_dst: Error in if (!dir.exists(path)) {: argument is of length zero
diff --git a/articles/Summary.html b/articles/Summary.html index 165d122..3e10418 100644 --- a/articles/Summary.html +++ b/articles/Summary.html @@ -396,8 +396,9 @@

Storing the summary table#> filter, lag #> The following objects are masked from 'package:base': #> -#> intersect, setdiff, setequal, union -arrange(MLSummary,desc(NumEns)) +#> intersect, setdiff, setequal, union

+
+arrange(MLSummary,desc(NumEns))
 #> # A tibble: 47 × 8
 #>    Dataset                  `Archive Type` NumPalTabs NumChrTabs NumEns AgeMin        AgeMax           `Paleo Vars`                                                                                                                                                                                                                                                                                                                                                                                                 
 #>    <chr>                    <chr>               <dbl>      <dbl>  <dbl> <chr>         <chr>            <chr>                                                                                                                                                                                                                                                                                                                                                                                                        
@@ -417,7 +418,7 @@ 

Storing the summary table

NPM: we might have to kill this section because of the gt package, or just not show that.

-
+
 library(gt)
 MLSummary %>% 
   select(-starts_with("Num"),-"Paleo Vars") %>% 
@@ -1167,17 +1168,17 @@ 

LiPD Timeseries objects -
+
 

Let’s quickly check the size of this tibble

-
+
 dim(tibTS)
 #> [1] 583 382

Wow - that’s pretty big. That means that there are 583 variables across all our datasets, and 382 data or metadata fields present in one or more of the datasets.

Again, let’s print out a quick overview:

-
+
 tibTS
 #> LiPD TS object containing 47 datasets
 #> 583 variables and 382 data and metadata fields.
@@ -1195,7 +1196,7 @@ 

LiPD Timeseries objectssummary(). This works the same for lipd_ts and lipd_ts_tibble objects. Let’s limit the table to show details of the first 10 rows only

-
+
 summary(tibTS, print.length = 10)
 #> LiPD TS object containing 47 datasets
 #> 583 variables and 382 data and metadata fields.
@@ -1224,7 +1225,7 @@ 

LiPD Timeseries objectsadd.variable parameter.

-
+
 summary(tibTS,
         print.length = 10, 
         add.variable = c("archiveType", "paleoData_meanValue12k","geo_continent", "geo_elevation", "agesPerKyr", "dataSetName"))
@@ -1272,7 +1273,7 @@ 

Filtering the TS objectcover the early Holocene
  • Have some climate interpretation
  • -
    +
     library(magrittr) #We'll use the pipe for clarity
     subsetTs <- tibTS %>% 
       filter(between(geo_latitude,30,50),
    @@ -1283,7 +1284,7 @@ 

    Filtering the TS objectGreat - we found 29 timeseries that meet these criteria. Let’s explore their interpretations in a bit more detail by saving the table output.

    -
    +
     sumTable <- summary(subsetTs,
                         add.variable = c("interpretation1_variable",
                                          "interpretation1_variableDetail",
    diff --git a/pkgdown.yml b/pkgdown.yml
    index 3bcb75e..6bd4e5d 100644
    --- a/pkgdown.yml
    +++ b/pkgdown.yml
    @@ -5,5 +5,5 @@ articles:
       lipd2neotoma: lipd2neotoma.html
       Query: Query.html
       Summary: Summary.html
    -last_built: 2024-05-14T00:43Z
    +last_built: 2024-07-06T22:18Z