Description Usage Arguments Details Value
processCSV will read in a csv file of SST and return the matrices needed for kmeans()
.
Notes: See also the tidy version.
1 | processCSV(file, aspect_ratio, lat_range, long_range, has.alt = FALSE)
|
file |
name of the csv file |
aspect_ratio |
c(width, height). This is |
lat_range |
What range to subset |
long_range |
What range to subset |
has.alt |
If TRUE, then remove 2nd column |
stats::kmeans()
wants a matrix where each row is a sample of your data. So we want each
row of our data matrix to be a date and the columns will be the pixels in the image.
The function returns dat.wide
which is the original data (in the specified lat/lon box)
where each row is a date and each column is a pixel in the image grid.
dat.wide
may have NAs (say from land if working with ocean
data). dat.clean
is the data with NA pixels (i.e. land) removed.
pos.loc
is the location of the
non-NA pixels (columns in dat.wide
) so that the image can be reconstructed after
k clustering is performed.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.