search for: risk_input

Displaying 4 results from an estimated 4 matches for "risk_input".

Did you mean: disk_input
2010 Jul 08
1
Query about using timestamps returned by SQL as 'factor' for split
I have a simple query as follows: "SELECT m_id,sale_date,YEAR(sale_date),WEEK(sale_date),return_type,DATEDIFF(return_date,sale_date) AS elapsed_time FROM risk_input" I can get, and view, all the data that that query returns. The question is, sale_date is a timestamp, and I need to call split to group this data by m_id and the week in which the sale occurred. Obviously, I would normally need both YEAR and WEEK so that data from April this year is not co...
2010 Jul 15
1
How do I combine lists of data.frames into a single data frame?
...anularity = "month" rv } It is basically the data.frame created by fitdist extended to include the variables used to distinguish one sample from another. I have the following statement that gets me a set of IDs from my db: ids <- dbGetQuery(con, "SELECT DISTINCT m_id FROM risk_input") And then I have a loop that allows me to analyze one dataset after another: for (i in 1:length(ids[,1])) { print(i) print(ids[i,1]) Then, after a set of statements that give me information about the dataset (such as its size), within a conditional block that ensures I apply the analys...
2010 Jul 21
0
One problem with RMySQL and a query that returns an empty recordset
...out two thirds of the results that ought to be produced. At the time that the error occurs, x contains the following SQL query: SELECT m_id,sale_date,YEAR(sale_date) AS sale_year,MONTH(sale_date) AS sale_month,return_type,0.0001 + DATEDIFF(return_date,sale_date) AS elapsed_time FROM `merchants2`.`risk_input` WHERE m_id = 361 AND return_type = 1 AND DATEDIFF(return_date,sale_date) IS NOT NULL; If I execute this SQL, I find the resultset is empty. So assigning the value returned by dbGetQuery to moreinfo works ONLY if the resultset is not empty. It fails with a fatal error if the resultset is empty....
2010 Jul 16
1
I need help making a data.fame comprised of selected columns of an original data frame.
I must have missed something simple, but still, i don't know what. I obtained my basic data as follows: x <- sprintf("SELECT m_id,sale_date,YEAR(sale_date) AS sale_year,WEEK(sale_date) AS sale_week,return_type,0.0001 + DATEDIFF(return_date,sale_date) AS elapsed_time FROM `merchants2`.`risk_input` WHERE DATEDIFF(return_date,sale_date) IS NOT NULL") moreinfo <- dbGetQuery(con, x) I then made the data frame I want to use as follows: fun_m_id <- function(df) if (length(df$elapsed_time) > 5) { rv = fitdist(df$elapsed_time,"exp") rv$mid = df$m_id[1] rv }...