Note that there are some explanatory texts on larger screens.

plurals
  1. POsubset data frame for the the last week data
    primarykey
    data
    text
    <p>I have a time series data frame like below. I would like to subset this data for the last week Sunday-Saturday day. Is there a known function to calculate the last week, regardless of when the function is ran?</p> <pre><code> dput(head(y,100)) structure(list(DATE = structure(c(15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15809, 15810, 15810, 15810, 15810), class = "Date"), Time = structure(c(1365984840, 1365985740, 1365986640, 1365987540, 1365988440, 1365989340, 1365990240, 1365991140, 1365992040, 1365992940, 1365993840, 1365994740, 1365995640, 1365996540, 1365997440, 1365998340, 1365912840, 1365913740, 1365914640, 1365915540, 1365916440, 1365917340, 1365918240, 1365919140, 1365920040, 1365920940, 1365921840, 1365922740, 1365923640, 1365924540, 1365925440, 1365926340, 1365927240, 1365928140, 1365929040, 1365929940, 1365930840, 1365931740, 1365932640, 1365933540, 1365934440, 1365935340, 1365936240, 1365937140, 1365938040, 1365938940, 1365939840, 1365940740, 1365941640, 1365942540, 1365943440, 1365944340, 1365945240, 1365946140, 1365947040, 1365947940, 1365948840, 1365949740, 1365950640, 1365951540, 1365952440, 1365953340, 1365954240, 1365955140, 1365956040, 1365956940, 1365957840, 1365958740, 1365959640, 1365960540, 1365961440, 1365962340, 1365963240, 1365964140, 1365965040, 1365965940, 1365966840, 1365967740, 1365968640, 1365969540, 1365970440, 1365971340, 1365972240, 1365973140, 1365974040, 1365974940, 1365975840, 1365976740, 1365977640, 1365978540, 1365979440, 1365980340, 1365981240, 1365982140, 1365983040, 1365983940, 1366071240, 1366072140, 1366073040, 1366073940), class = c("POSIXct", "POSIXt" ), tzone = ""), CPU = c(30.4333333333333, 30.0666666666667, 29.9666666666667, 31.0333333333333, 29.9666666666667, 27.0333333333333, 24.6, 23.1666666666667, 24.5, 21.8, 20.1333333333333, 20.6333333333333, 22.4, 20.8333333333333, 20.2333333333333, 19.7333333333333, 20.2857142857143, 15.4, 17.1666666666667, 14.6333333333333, 20, 15.8666666666667, 14.6, 16.0333333333333, 15, 13.9666666666667, 13.7, 11.3666666666667, 11.6666666666667, 10.5666666666667, 19.2333333333333, 21.6, 21.9666666666667, 21.1, 18.8666666666667, 20.5, 19.7666666666667, 17.1666666666667, 15.6333333333333, 10.2666666666667, 9.33333333333333, 8.73333333333333, 9.4, 10, 12.2333333333333, 12.8666666666667, 13.6333333333333, 14.4333333333333, 15.6666666666667, 15.6666666666667, 16.6, 17.9333333333333, 20.0666666666667, 20.2, 21.4666666666667, 22.4333333333333, 25.0333333333333, 24.6, 25.0333333333333, 25.8666666666667, 25.9666666666667, 21.2, 23.2333333333333, 30.2758620689655, 30.3666666666667, 29.5666666666667, 29, 29.9666666666667, 30.0666666666667, 29.8666666666667, 28.8333333333333, 29, 29.5, 29.4, 28.9333333333333, 28.5, 28.4, 29.3, 27.1666666666667, 26.7, 27.5333333333333, 27.3333333333333, 26.6333333333333, 26.8333333333333, 26.9, 26.4666666666667, 26.1, 26.0333333333333, 26.4, 26.4333333333333, 25.8, 25.7666666666667, 32.4333333333333, 26.6666666666667, 25.7333333333333, 26.8333333333333, 39.4666666666667, 34.2666666666667, 29.3333333333333, 28.2666666666667), Time1 = c("20:14", "20:29", "20:44", "20:59", "21:14", "21:29", "21:44", "21:59", "22:14", "22:29", "22:44", "22:59", "23:14", "23:29", "23:44", "23:59", "00:14", "00:29", "00:44", "00:59", "01:14", "01:29", "01:44", "01:59", "02:14", "02:29", "02:44", "02:59", "03:14", "03:29", "03:44", "03:59", "04:14", "04:29", "04:44", "04:59", "05:14", "05:29", "05:44", "05:59", "06:14", "06:29", "06:44", "06:59", "07:14", "07:29", "07:44", "07:59", "08:14", "08:29", "08:44", "08:59", "09:14", "09:29", "09:44", "09:59", "10:14", "10:29", "10:44", "10:59", "11:14", "11:29", "11:44", "11:59", "12:14", "12:29", "12:44", "12:59", "13:14", "13:29", "13:44", "13:59", "14:14", "14:29", "14:44", "14:59", "15:14", "15:29", "15:44", "15:59", "16:14", "16:29", "16:44", "16:59", "17:14", "17:29", "17:44", "17:59", "18:14", "18:29", "18:44", "18:59", "19:14", "19:29", "19:44", "19:59", "20:14", "20:29", "20:44", "20:59")), .Names = c("DATE", "Time", "CPU", "Time1"), row.names = 4205:4304, class = "data.frame") </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload