Displaying 5 results from an estimated 5 matches for "reportd".
Did you mean:
reported
2017 Sep 11
4
Case statement in sqldf
Hi all,
I am trying to create a new variable called Fiscal Year (FY) using case expression in sqldf and I am getting a null FY , see the code below .
Please advise me as to how I can do this mutation.
library(zoo)
library(lubridate)
library(stringr)
library(RH2)
library(sqldf)
cr$ReportDate = as.Date(cr$ReportDate, format ='%Y-%m-%d')
> cr2 = sqldf(" select ReportDate
+ , case
+ when ReportDate between '2012-04-01' and '2013-03-31'
+ then '2012_13'
+...
2017 Sep 11
0
Case statement in sqldf
...as the number of days since
1970-01-01 -- corresponds to a particular character string; however,
the H2 database does have date types. See FAQ #4 on the sqldf github
home page for more info.
https://github.com/ggrothendieck/sqldf
)
This works:
library(sqldf)
library(RH2)
cr <- data.frame(ReportDate = as.Date("2017-09-11")) # input
cr2 = sqldf(" select ReportDate
, case
when ReportDate between '2012-04-01' and '2013-03-31'
then '2012_13'
when ReportDate bet...
2017 Sep 11
0
Case statement in sqldf
...able called Fiscal Year (FY) using case expression in sqldf and I am getting a null FY , see the code below .
>
> Please advise me as to how I can do this mutation.
>
> library(zoo)
> library(lubridate)
> library(stringr)
> library(RH2)
> library(sqldf)
>
> cr$ReportDate = as.Date(cr$ReportDate, format ='%Y-%m-%d')
>
>> cr2 = sqldf(" select ReportDate
> + , case
> + when ReportDate between '2012-04-01' and '2013-03-31'
> + then '2012_13'...
2010 Nov 05
1
as.xts
hey
I am trying to turn a dataframe into xts with the function:
as.xts,
but it returns the error:
Error in as.POSIXlt.character(x, tz, ...) :
character string is not in a standard unambiguous format
could someone give me some pointers please
the data is coming from a spreadsheet via the excel, and has 5 columns
of data (date (with the date and time), open, high, low, close) (excel
format)
ela
2013 Feb 15
1
Suggestion: Custom filename patterns for non-Sweave vignettes
...optional. (I can
see how R now scans for Rnw and Rmd files, checks them for a
\VignetteEngine{} markup, and then looks up the corresponding engine).
Continuing, the above would make it possible to process RSP vignettes
that have filenames:
reportA.tex.rsp
reportB.html.rsp
reportC.md.rsp
reportD.Rnw.rsp
where rspWeave() will produce the following files:
reportA.tex
reportB.html
reportC.html
reportD.tex
I included the latter case just to illustrate a special case where
rspWeave() first generates a reportC.Rnw (Sweave or knitr) which is
the processed using the corresponding weaver...