Description Usage Arguments Value Author(s) Examples

Extracts all variables from a netcdf file matching Longitude, Latitude, and UTC coordinates in given dataframe

1 2 3 4 5 6 7 8 9 |

`data` |
dataframe containing Longitude, Latitude, and UTC to extract matching variables from the netcdf file |

`nc` |
name of a netcdf file |

`buffer` |
vector of Longitude, Latitude, and Time (seconds) to buffer around each datapoint. All values within the buffer will be used to report the mean, median, and standard deviation |

`FUN` |
a vector or list of functions to apply to the data. Default is to apply mean, median, and standard deviation calculations |

`raw` |
logical flag to return only the raw values of the variables. If |

`progress` |
logical flag to show progress bar for matching data |

`verbose` |
logical flag to show warning messages for possible coordinate mismatch |

original dataframe with three attached columns for each variable in the netcdf file, one for each of mean, median, and standard deviation of all values within the buffer

Taiki Sakai taiki.sakai@noaa.gov

1 2 3 4 5 6 7 8 9 10 11 12 | ```
data <- data.frame(Latitude = 32, Longitude = -117,
UTC = as.POSIXct('2005-01-01 00:00:00', tz='UTC'))
nc <- system.file('extdata', 'sst.nc', package='PAMmisc')
# calculate mean median and stdev
ncToData(data, nc = nc)
# calculate only median
ncToData(data, nc=nc, FUN=median, buffer = c(.01, .01, 86400))
# custom function
meanPlusOne <- function(x) {
mean(x, na.rm=TRUE) + 1
}
ncToData(data, nc=nc, FUN=c(mean, meanPlusOne))
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.