Biweekly time series for raster stack in r The Next CEO of Stack OverflowRelative areas projection independent?How to read *.adf files into R?Processing vector to raster faster with RConverting .adf raster from UTM to lat/long without UTM zones in Rre: Grid Issue with environmental data-frame in RExport RGB data (from a tiff image) in excel formatAccess to attribute in rasterlayer in ROpening rotated raster in RRaster alignment doesn't produce aligned resultsUsing raster stack function time in R?
Does Germany produce more waste than the US?
Audio Conversion With ADS1243
Lucky Feat: How can "more than one creature spend a luck point to influence the outcome of a roll"?
What difference does it make using sed with/without whitespaces?
Can you teleport closer to a creature you are Frightened of?
Is French Guiana a (hard) EU border?
Is it okay to majorly distort historical facts while writing a fiction story?
In the "Harry Potter and the Order of the Phoenix" videogame, what potion is used to sabotage Umbridge's Speakers?
TikZ: How to fill area with a special pattern?
Can I board the first leg of the flight without having final country's visa?
Example of a Mathematician/Physicist whose Other Publications during their PhD eclipsed their PhD Thesis
Won the lottery - how do I keep the money?
Is dried pee considered dirt?
Is it ever safe to open a suspicious HTML file (e.g. email attachment)?
AB diagonalizable then BA also diagonalizable
Traduction de « Life is a roller coaster »
Is it correct to say moon starry nights?
How to get the last not-null value in an ordered column of a huge table?
How to properly draw diagonal line while using multicolumn inside tabular environment?
What does "shotgun unity" refer to here in this sentence?
Yu-Gi-Oh cards in Python 3
New carbon wheel brake pads after use on aluminum wheel?
Is it convenient to ask the journal's editor for two additional days to complete a review?
Iterate through multiline string line by line
Biweekly time series for raster stack in r
The Next CEO of Stack OverflowRelative areas projection independent?How to read *.adf files into R?Processing vector to raster faster with RConverting .adf raster from UTM to lat/long without UTM zones in Rre: Grid Issue with environmental data-frame in RExport RGB data (from a tiff image) in excel formatAccess to attribute in rasterlayer in ROpening rotated raster in RRaster alignment doesn't produce aligned resultsUsing raster stack function time in R?
I have a netcdf file with daily data and I calculate for each week some statistics, using the "apply.weekly" command in the "xts" library. However, I would like to calculate bi-weekly statistics, using daily data from every two weeks as input. How could i do this in R?
library("ncdf4")
library("rts")
library("xts")
#
prec = stack("pr.nc")
#
prec
#
class : RasterStack
dimensions : 12, 19, 228, 365 (nrow, ncol, ncell, nlayers)
resolution : 0.125, 0.125 (x, y)
extent : 21.75, 24.125, 39.875, 41.375 (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0
names : X2018.01.01, X2018.01.02, X2018.01.03, X2018.01.04, X2018.01.05, X2018.01.06, X2018.01.07, X2018.01.08, X2018.01.09, X2018.01.10, X2018.01.11, X2018.01.12, X2018.01.13, X2018.01.14, X2018.01.15, ...
min values : 1.062151e-13, 1.080165e-13, 1.061332e-13, 1.757816e-02, 4.101618e-02, 3.535164e-01, 2.539131e-02, 2.674782e-02, 1.932025e-02, 2.027835e-05, 2.576398e-06, 6.366093e-13, 7.227548e-05, 1.345976e-04, 2.202405e-08, ...
max values : 7.53125000, 0.69336098, 0.09375487, 9.00326061, 23.77886200, 16.37112999, 6.83587980, 4.03569651, 21.04327393, 6.23503065, 3.15138841, 1.24927104, 4.46353579, 3.46504283, 4.42247295, ...
#
indices = seq.Date(min(as.Date("2018-1-1")), max(as.Date("2018-12-31")), by="day")
#
prec_rt = rts(prec, indices)
#
rr_2018_weekly_sum = apply.weekly(prec_rt, sum)
raster r stack
add a comment |
I have a netcdf file with daily data and I calculate for each week some statistics, using the "apply.weekly" command in the "xts" library. However, I would like to calculate bi-weekly statistics, using daily data from every two weeks as input. How could i do this in R?
library("ncdf4")
library("rts")
library("xts")
#
prec = stack("pr.nc")
#
prec
#
class : RasterStack
dimensions : 12, 19, 228, 365 (nrow, ncol, ncell, nlayers)
resolution : 0.125, 0.125 (x, y)
extent : 21.75, 24.125, 39.875, 41.375 (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0
names : X2018.01.01, X2018.01.02, X2018.01.03, X2018.01.04, X2018.01.05, X2018.01.06, X2018.01.07, X2018.01.08, X2018.01.09, X2018.01.10, X2018.01.11, X2018.01.12, X2018.01.13, X2018.01.14, X2018.01.15, ...
min values : 1.062151e-13, 1.080165e-13, 1.061332e-13, 1.757816e-02, 4.101618e-02, 3.535164e-01, 2.539131e-02, 2.674782e-02, 1.932025e-02, 2.027835e-05, 2.576398e-06, 6.366093e-13, 7.227548e-05, 1.345976e-04, 2.202405e-08, ...
max values : 7.53125000, 0.69336098, 0.09375487, 9.00326061, 23.77886200, 16.37112999, 6.83587980, 4.03569651, 21.04327393, 6.23503065, 3.15138841, 1.24927104, 4.46353579, 3.46504283, 4.42247295, ...
#
indices = seq.Date(min(as.Date("2018-1-1")), max(as.Date("2018-12-31")), by="day")
#
prec_rt = rts(prec, indices)
#
rr_2018_weekly_sum = apply.weekly(prec_rt, sum)
raster r stack
use period.apply() to specify periods other than days, weeks, months
– JepsonNomad
2 days ago
add a comment |
I have a netcdf file with daily data and I calculate for each week some statistics, using the "apply.weekly" command in the "xts" library. However, I would like to calculate bi-weekly statistics, using daily data from every two weeks as input. How could i do this in R?
library("ncdf4")
library("rts")
library("xts")
#
prec = stack("pr.nc")
#
prec
#
class : RasterStack
dimensions : 12, 19, 228, 365 (nrow, ncol, ncell, nlayers)
resolution : 0.125, 0.125 (x, y)
extent : 21.75, 24.125, 39.875, 41.375 (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0
names : X2018.01.01, X2018.01.02, X2018.01.03, X2018.01.04, X2018.01.05, X2018.01.06, X2018.01.07, X2018.01.08, X2018.01.09, X2018.01.10, X2018.01.11, X2018.01.12, X2018.01.13, X2018.01.14, X2018.01.15, ...
min values : 1.062151e-13, 1.080165e-13, 1.061332e-13, 1.757816e-02, 4.101618e-02, 3.535164e-01, 2.539131e-02, 2.674782e-02, 1.932025e-02, 2.027835e-05, 2.576398e-06, 6.366093e-13, 7.227548e-05, 1.345976e-04, 2.202405e-08, ...
max values : 7.53125000, 0.69336098, 0.09375487, 9.00326061, 23.77886200, 16.37112999, 6.83587980, 4.03569651, 21.04327393, 6.23503065, 3.15138841, 1.24927104, 4.46353579, 3.46504283, 4.42247295, ...
#
indices = seq.Date(min(as.Date("2018-1-1")), max(as.Date("2018-12-31")), by="day")
#
prec_rt = rts(prec, indices)
#
rr_2018_weekly_sum = apply.weekly(prec_rt, sum)
raster r stack
I have a netcdf file with daily data and I calculate for each week some statistics, using the "apply.weekly" command in the "xts" library. However, I would like to calculate bi-weekly statistics, using daily data from every two weeks as input. How could i do this in R?
library("ncdf4")
library("rts")
library("xts")
#
prec = stack("pr.nc")
#
prec
#
class : RasterStack
dimensions : 12, 19, 228, 365 (nrow, ncol, ncell, nlayers)
resolution : 0.125, 0.125 (x, y)
extent : 21.75, 24.125, 39.875, 41.375 (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0
names : X2018.01.01, X2018.01.02, X2018.01.03, X2018.01.04, X2018.01.05, X2018.01.06, X2018.01.07, X2018.01.08, X2018.01.09, X2018.01.10, X2018.01.11, X2018.01.12, X2018.01.13, X2018.01.14, X2018.01.15, ...
min values : 1.062151e-13, 1.080165e-13, 1.061332e-13, 1.757816e-02, 4.101618e-02, 3.535164e-01, 2.539131e-02, 2.674782e-02, 1.932025e-02, 2.027835e-05, 2.576398e-06, 6.366093e-13, 7.227548e-05, 1.345976e-04, 2.202405e-08, ...
max values : 7.53125000, 0.69336098, 0.09375487, 9.00326061, 23.77886200, 16.37112999, 6.83587980, 4.03569651, 21.04327393, 6.23503065, 3.15138841, 1.24927104, 4.46353579, 3.46504283, 4.42247295, ...
#
indices = seq.Date(min(as.Date("2018-1-1")), max(as.Date("2018-12-31")), by="day")
#
prec_rt = rts(prec, indices)
#
rr_2018_weekly_sum = apply.weekly(prec_rt, sum)
raster r stack
raster r stack
asked 2 days ago
Maria KarypidouMaria Karypidou
163
163
use period.apply() to specify periods other than days, weeks, months
– JepsonNomad
2 days ago
add a comment |
use period.apply() to specify periods other than days, weeks, months
– JepsonNomad
2 days ago
use period.apply() to specify periods other than days, weeks, months
– JepsonNomad
2 days ago
use period.apply() to specify periods other than days, weeks, months
– JepsonNomad
2 days ago
add a comment |
0
active
oldest
votes
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "79"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f317176%2fbiweekly-time-series-for-raster-stack-in-r%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Geographic Information Systems Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f317176%2fbiweekly-time-series-for-raster-stack-in-r%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown

use period.apply() to specify periods other than days, weeks, months
– JepsonNomad
2 days ago