Blog

Friday, Dec 22, 2023

3D Spatial Modeling of Argo Dataset

The Argo dataset contains spatial data in three dimensions (3D). In this tutorial, you will learn how to model a spatial data in 3D using spatial statistics using the R software program. The following data analysis and modeling was conducted on a 2020 MacBook Pro with Apple M1 chip with 8 cores, 8GB in memory, and aarch64-apple-darwin20 (64-bit) platform running under macOS Sonoma 14.0. The source code can be found on GitHub at 3D_Spatial_Modeling_Argo_Dataset_tutorial_codes.R

Prepare the Argo dataset

  1. Download the 3D spatial Argo residuals dataset produced by Yarger et al. (2022)1 from this link: 3D spatial Argo residuals. This will download a file named jan_march_residuals.RData which contains the 3D spatial Argo residuals saved in an RData format.
  2. Open R or RStudio. A typical RStudio session looks like this:
    rstudio_session.png
    To keep track of R codes and also to prepare them for execution later, open the R Script window. This can be done by clicking on the 'New File' icon located at the topleft most portion of the RStudio window. Click on the 'R Script' option.
    rstudio_new_rscript.png
    The R Script window will appear on top of the R Console window.
    rstudio_script_window.png
  3. Locate where the .RData file was saved.
    1. On a MacBook, this can be done by right-clicking on the file and choosing the 'Get Info' option.
      locating_file_macbook_get_info.png
    2. Another window will appear containing several information about the file. The location and nested folders that contain the file is displayed in 'General -> Where:'.
      locating_file_macbook_general_where.png
    3. Highlight the location information and right-click on it. A dialog box will appear which you can click to copy the location information and save it as a Pathname (the exact address of the file on the computer). On my computer, the Pathname is /Users/laisalvana/Downloads
      locating_file_macbook_copy_pathname.png
    4. Store the Pathname as a variable in R. For example, define the variable filepath and paste the Pathname. This can be done by running the following codes on the R console:
      
      		      filepath <- '/Users/laisalvana/Downloads'
      		    
      rstudio_define_filepath_variable.png

1. Yarger, Drew, Stilian Stoev, and Tailen Hsing. "A functional-data approach to the Argo data." The Annals of Applied Statistics 16.1 (2022): 216-246. https://doi.org/10.1214/21-AOAS1477.

2. “Definition.” Merriam-Webster.com Dictionary, Merriam-Webster, https://www.merriam-webster.com/dictionary/definition. Accessed 18 May. 2020.