Displaying 20 results from an estimated 1000 matches similar to: "Sum data according to date in sequence"
2023 Nov 03
2
Sum data according to date in sequence
Hi,
I tried this:
# extract date from the time stamp
dt1 <- cbind(as.Date(dt$EndDate, format="%m/%d/%Y"), dt$EnergykWh)
head(dt1)
colnames(dt1) <- c("date", "EnergykWh")
and
my dt1 becomes these, the dates are replace by numbers.
dt1 <- cbind(as.Date(dt$EndDate, format="%m/%d/%Y"), dt$EnergykWh)
dput(head(dt1))
colnames(dt1) <-
2023 Nov 03
1
Sum data according to date in sequence
Is this what you are after?
library(tidyverse)
library(lubridate)
input <- structure(list(StationName = c("PALO ALTO CA / CAMBRIDGE #1",
"PALO ALTO CA / CAMBRIDGE #1", "PALO ALTO CA / CAMBRIDGE #1",
"PALO ALTO CA / CAMBRIDGE #1", "PALO ALTO CA / CAMBRIDGE #1",
"PALO ALTO CA / CAMBRIDGE #1", "PALO ALTO CA / CAMBRIDGE
2023 Nov 04
2
Sum data according to date in sequence
?s 01:49 de 03/11/2023, roslinazairimah zakaria escreveu:
> Hi all,
>
> This is the data:
>
>> dput(head(dt1,20))structure(list(StationName = c("PALO ALTO CA / CAMBRIDGE #1",
> "PALO ALTO CA / CAMBRIDGE #1", "PALO ALTO CA / CAMBRIDGE #1",
> "PALO ALTO CA / CAMBRIDGE #1", "PALO ALTO CA / CAMBRIDGE #1",
> "PALO ALTO
2023 Nov 03
1
Sum data according to date in sequence
How about send a 'dput' of some sample data. My guess is that your date is
'character' and not 'Date'.
Thanks
Jim Holtman
*Data Munger Guru*
*What is the problem that you are trying to solve?Tell me what you want to
do, not how you want to do it.*
On Thu, Nov 2, 2023 at 4:24?PM roslinazairimah zakaria <roslinaump at gmail.com>
wrote:
> Dear all,
>
> I
2023 Nov 03
1
Sum data according to date in sequence
Hi all,
This is the data:
> dput(head(dt1,20))structure(list(StationName = c("PALO ALTO CA / CAMBRIDGE #1",
"PALO ALTO CA / CAMBRIDGE #1", "PALO ALTO CA / CAMBRIDGE #1",
"PALO ALTO CA / CAMBRIDGE #1", "PALO ALTO CA / CAMBRIDGE #1",
"PALO ALTO CA / CAMBRIDGE #1", "PALO ALTO CA / CAMBRIDGE #1",
"PALO ALTO CA / CAMBRIDGE
2024 Oct 04
1
Time series data decomposition from by minute data
Hallo
you can extract POSIX object
tv <- as.POSIXct(index(dt_train))
and use cut together with aggregate
cut(tv, "hour")
aggregate(dt_train, list(cut(tv, "hour")), mean)
2014-10-06 21:00:00 9.807692
2014-10-06 22:00:00 8.666667
Cheers.
Petr
?t 3. 10. 2024 v 17:25 odes?latel roslinazairimah zakaria <
roslinaump at gmail.com> napsal:
> Dear all,
>
> My
2024 Oct 03
1
Time series data decomposition from by minute data
Dear all,
My data is by minutes and I can see it has seasonal trend by daily and
weekly. How do I decompose the minute data into daily and weekly
some data:
> dput(tail(dt_train,100))structure(c(11L, 11L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L,
10L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L,
10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L,
10L, 11L, 11L, 10L,
2018 Apr 04
2
Plot data in sequence
Hi r-users,
I would like to draw line plots. However, the plot starts from 11121 data
and plot data ENTRY last in the plot.
Here is the code and data.
datn <- read.table(header=TRUE, text='
LEVEL STATUS CGPA
DIPLOMA ENTRY 3.32
DIPLOMA 11121 2.91
DIPLOMA 11122 2.90
DIPLOMA 12131 2.89
DIPLOMA 12132 2.89
DIPLOMA 13141 2.93
DIPLOMA 13142 2.96
DIPLOMA 14151 2.76
DIPLOMA 14152 2.73
STPM
2024 Oct 02
1
How to install this package
Hi Enrico, yes it works. I can also plot the graph.
Next question, how do I delete the date from 16 December until 31 December
2014?
Thank you very much.
> dt$time <- as.POSIXct(dt$time)> > dt_ts <- xts(dt$count, dt$time)> str(dt_ts)An xts object on 2014-01-01 / 2014-12-31 23:59:00 containing:
Data: integer [525600, 1]
Index: POSIXct,POSIXt [525600] (TZ: "")
2018 Apr 04
0
Plot data in sequence
Hi,
Thanks for the reproducible example.
Looking at
str(datn)
would give you a clue.
STATUS is a factor because it contains character values. Factor levels
by default are alphabetical with numbers first, but you can change
those.
> str(datn)
'data.frame': 36 obs. of 3 variables:
$ LEVEL : Factor w/ 4 levels "DIPLOMA","MATRIC",..: 1 1 1 1 1 1 1 1 1 4 ...
$
2024 Oct 04
1
Warning message: Removed 888 rows containing missing values or values outside the scale range (`geom_line()`)
Dear all,
I tried to rerun the examples given by Hyndman in otexts but keep on
getting errors and I have searched through google but no solution yet.
Thank you in advance for any help given.
library(fpp3)
library(lubridate)
library(xts)
library(fabletools)
library(ggplot2)
library(dplyr)
library(gridExtra)
> dput(head(new_us_retail_employment,100))structure(list(Month = structure(c(-11323,
2017 Oct 11
3
dput(treat)
I got advice here that I didn't understand! Can I ask to explain me the meaning of this procedure: first get the structure, and then assign it back. For what? Thanks!? (Great thanks to Moderator/Admin!)
You should learn to post in plain text and use dput to present your data structures. At your console do this
dput(treat)
# and this will appear. Copy it to your plain-text message:
2017 Jul 22
1
3-day moving average for block maxima
Dear r-users,
I would like to construct 3-day moving average for block maxima series.
I tried this:
bmthree <- lapply(split(dt, dt$Year), function(x) max(sapply(1:(nrow(x)-2),
function(i) with(x, mean(Amount[i:(i+2)],na.rm=TRUE)))))
bmthree
and got the following output.
$`1971`
[1] 70.81667
$`1972`
[1] 68.94553
$`1973`
[1] 102.7236
$`1974`
[1] 73.6625
$`1975`
[1]
2023 Jan 13
1
Customise Plot tick label on time series plot using date series
?s 05:11 de 13/01/2023, roslinazairimah zakaria escreveu:
> Hi,
>
> I would like to customise my date series on the plot. I tried this:
>
> dt_ts <- ts(dt)
> autoplot(dt_ts[,2]) + ylab("Charge counts") + xlab("Daily")
>
> but the label is not the date series.
>
> Tqvm for any help given.
>
>
>> dput(dt)
> structure(list(time
2008 Jan 06
3
need help
Hi,
I'm Roslina, PhD student of University of South Australia, Australia
from school Maths and Stats. I use S-Plus before and now has started
using R-package. I used
to analyse rainfall data using julian date. Is there any similar
function that you can suggest to me to be used in R-package? Thank you
so much for your attention and help
[[alternative HTML version deleted]]
2016 Apr 29
2
selecting columns from a data frame or data table by type, ie, numeric, integer
Good morning RGuru's
I have a data frame of 575 columns.? I want to extract only those columns that are numeric(double) or integer to do some machine learning with.? I have searched the web for a couple of days (off and on) and have not found anything that shows how to do this.?? Lots of ways to extract rows, but not columns.? I have attempted to use "(x == y)" indices extraction
2007 Jun 06
1
fixed effects anova in lme lmer
Can lme or lmer fit a plain regular fixed effects anova? Ie a model without a
random effect, or have there be at least one random effect in order for these
functions to work?
Trying to run such, (1) without specifying a random effect produces an error,
(2) specifying that there is no random effect does not produce the same output
as an anova run in lm(); (2b) specifying that there is no
2016 Apr 29
0
selecting columns from a data frame or data table by type, ie, numeric, integer
> dt1[ vapply(dt1, FUN=is.numeric, FUN.VALUE=NA) ]
a c
1 1 1.1
2 2 1.0
...
10 10 0.2
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Fri, Apr 29, 2016 at 9:19 AM, Carl Sutton via R-help <
r-help at r-project.org> wrote:
> Good morning RGuru's
> I have a data frame of 575 columns. I want to extract only those columns
> that are numeric(double) or integer to do
2010 Aug 22
4
how to implement string pattern extraction in R
Hi,
In perl, to get a substring matching a particular pattern can be
implemented like the following example:
$x = "AAAA.txt";
if ($x=~ /(.*?)\.txt/){
$prefix = $1;
}
So how to do the same thing in R?
Can someone provide me the code sample?
Thanks much in advance.
--
Waverley @ Palo Alto
2010 Sep 03
3
R program google search
Hi,
Can someone help as how to use R to program google search in the R
code? I know that other languages can allow or have the google search
API
If someone can give me some links or sample code I would greatly appreciate.
Thanks.
--
Waverley @ Palo Alto