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?










1















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)









share|improve this question






















  • use period.apply() to specify periods other than days, weeks, months

    – JepsonNomad
    2 days ago















1















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)









share|improve this question






















  • use period.apply() to specify periods other than days, weeks, months

    – JepsonNomad
    2 days ago













1












1








1








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)









share|improve this question














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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 2 days ago









Maria KarypidouMaria Karypidou

163




163












  • 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





use period.apply() to specify periods other than days, weeks, months

– JepsonNomad
2 days ago










0






active

oldest

votes












Your Answer








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
);



);













draft saved

draft discarded


















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















draft saved

draft discarded
















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Magento 1.9 observer on only new product added ( no updated product )Admin Create New Order ObserverObserver checkout_cart_product_add_after get product quantity in cartHow can I differentiate between product creation and saving existing products?How to get the original price Product SaveBeforeMagento Observer for Admin Sales order Address updateHow do i get quantity in a product_save_after event observer magento2?Using observer event to get updated customer infoSave product observer - detect availabilityEvent not triggered when new product added in admin : Magento 2magento 1.9 observer on quantity product change

Does an object always see its latest internal state irrespective of thread? The 2019 Stack Overflow Developer Survey Results Are InDoes a finally block always get executed in Java?Java: serial thread confinement questionJava difference between fixed threadpool and scheduled threadpoolJackrabbit and concurrent modificationHow to stop a Runnable scheduled for repeated execution after a certain number of executionsMultiple threads accessing inner classHow can a loop be completed by two thread? say loop from count=1 to count=4 by ist thread and count =5 to 8 by 2nd thread?If I keep a reference to a Runnable, when does the Thread it ran on get released?How to stop a schedule ScheduledExecutorServiceHow to implement a singleThreadedScheduledExcecutor in wildfly

Adding contour labels to SpatialLinesDataFrame or sf object? The Next CEO of Stack OverflowTearing of SpatialLinesDataFrame and problem with gClip functionAutomatically adjusting map labelsExtracting data.frame from simple features object in RR convert sf object back to SpatialPolygonsDataFrameSimplify polygons of sf objectlines of a SpatialLinesDataFrame corresponding to pointsCropping sf object in R?Pattern matching with grepl on SpatialPolygonsDataFrame object in RHow to create and empty SpatialLinesDataFrame in RWarning message in raster::rotate(): “this does not look like an appropriate object for this function”