# Changes between Version 19 and Version 20 of udg/ecoms/RPackage/examples

Ignore:
Timestamp:
May 20, 2013 11:34:21 AM (9 years ago)
Comment:

--

### Legend:

Unmodified
 v19 This is how we can check the spatial domain of the dataset: {{{ > lats = inv.iberiaNCEP$SLPd$Dimensions$lat$Values > lons = inv.iberiaNCEP$SLPd$Dimensions$lon$Values > plot(expand.grid(lons,lats), asp=1) # 'world' from library 'fields' > world(add=TRUE) }}} [[Image(iberiaNCEPextent.png)]] = loadData = Once the NcML dataset is created and we get an idea of the nature of the variables stored, the loadData function is used to retrieve the variables desired at selected dimensional slices. In this particular example, we will load the temperature data from the NCEP reanalysis in the Iberian Peninsula. We have a look again to the description of the variable temperature, as provided by the dataInventory: {{{ > str(inv.iberiaNCEP$T) List of 5$ Description: chr "Temperature" $DataType : chr "float"$ Units      : chr "K" $TimeStep :Class 'difftime' atomic [1:1] 24 .. ..- attr(*, "tzone")= chr "" .. ..- attr(*, "units")= chr "hours"$ Dimensions :List of 4 ..$level:List of 3 .. ..$ Type  : chr "Pressure" .. ..$Units : chr "millibar" .. ..$ Values: num 850 ..$time :List of 3 .. ..$ Type  : chr "Time" .. ..$Units : chr "days since 1950-01-01 00:00:00" .. ..$ Values: POSIXlt[1:16071], format: "1958-01-01" "1958-01-02" "1958-01-03" "1958-01-04" ... ..$lat :List of 3 .. ..$ Type  : chr "Lat" .. ..$Units : chr "degrees north" .. ..$ Values: num [1:6] 35 37.5 40 42.5 45 47.5 ..$lon :List of 3 .. ..$ Type  : chr "Lon" .. ..$Units : chr "degrees east" .. ..$ Values: num [1:9] -15 -12.5 -10 -7.5 -5 -2.5 0 2.5 5 }}} As we can see, the variable T has vertical levels. In this case, the only level available is at 850 mb. The variable is daily, as we can see in the TimeStep element of the list, and the original units are Kelvin. There are several options for spatial selection using the 'loadData` function. For instance, if we want the whole domain of teh dataset () = Using standard variables via vocabulary and dictionary =