Forgot the year if you also want to summarise by that.
> x <- structure(list(X1986.01.01.10.30.00 = c(16.8181762695312,
16.8181762695312,
+ 18.8294372558594, 16
[TRUNCATED]
> library(tidyverse)
> library(lubridate)
> # convert to long form
> x_
try this:
> x <- structure(list(X1986.01.01.10.30.00 = c(16.8181762695312,
16.8181762695312,
+ 18.8294372558594, 16
[TRUNCATED]
> library(tidyverse)
> library(lubridate)
> # convert to long form
> x_long <- gather(x, key = 'date', value = "value
Hi Faradj,
Yes, the function expects at least three values for each country. Glad
it worked.
Jim
On Tue, May 29, 2018 at 10:53 PM, Faradj Koliev wrote:
> Dear Jim,
>
> wow! It worked! Thanks a lot.
>
> I did as you suggested and it worked well with the real data. Although it
> gave me this erro
RDCOM supports calling R from Excel. AFAIK you need to use the non-free
Statconn software [1] to get much done going the other way.
FWIW I have found my life to be much simpler only using packages that access
the data in Excel rather than trying to control the software remotely. More
OS-portab
Dear All,
I am using excel.link package to open and modify Excel files.
When I manually open Excel, all my add-ins are loaded without a problem.
But when I open Excel using excel.link package, like:
xls<-xl.get.excel()
xl.workbook.open("MyFile.xlsx")
some Excel add-ins are (installed but) not lo
Dear Petr,
Thanks for your reply and the solution. The example dataset contains data
for the first six days of the year 1986. "X1986.01.01.10.30.00" is 01
January 1986 and the rest of the variable is redundant information. The
last date is given as "X2016.12.31.10.30.00".
I realized that I missed
Hi
Based on your explanation I would advice to use
?cut.POSIXt
with breaks "week". However your data are rather strange, you have data frame
with names which looks like dates
names(test)
[1] "X1986.01.01.10.30.00" "X1986.01.02.10.30.00" "X1986.01.03.10.30.00"
[4] "X1986.01.04.10.30.00" "X1986.
Dear all,
I have daily data in wide-format from 01/01/1986 to 31/12/2016 by ID. I
would like to convert this to weekly average data. The data has been
generated by an algorithm.
I know that I can use the lubridate package but that would require me to
first convert the data to long-form (which is
Dear Jim,
wow! It worked! Thanks a lot.
I did as you suggested and it worked well with the real data. Although it gave
me this error: Error in if (!is.na(x$Y[i])) { : argument is of length zero. For
some reason the X1 produced less observations than it is in the data. But it's
not a big deal
9 matches
Mail list logo