Displaying 13 results from an estimated 13 matches for "m_id".
Did you mean:
_id
2006 Jan 17
1
How to loop a Vobis sound ?
...eam);
m_bReleaseStream = true;
return true;
}
// ------------- Source.h
class GAL_API Source
{
public:
// 1. Set a loaded buffer as current buffer
void SetCurrentBuffer (Buffer *pBuf);
// 2. operations
virtual bool Play ();
virtual void Stop () { alSourceStop (m_id); }
virtual void Pause () { alSourcePause (m_id); }
virtual void Rewind () { alSourceRewind (m_id); }
// 3. Update if buffers are queued
virtual bool Update (); // Update Queued Buffers
bool IsPlaying ();
void Empty (); // Empty Queued Buffer
// play attribut...
2009 Apr 01
2
Matrix multiplication - code problem
...trouble in a matrix multiplication...
I have already checked some posts, but I didn't find my problem...
I have the following code...
But I am not getting the right multiplication...
I checked the dimension and they are fine...
id_y <- array(1:10,dim=c(2,1,5))
id_yt<-aperm(id_y,c(2,1,3))
m_id<-array(dim=c(dim(id_y)[1],dim(id_y)[1],dim(id_y)[3]))
for (i in 1:dim(id_y)[3]){
m_id[,,i]<-id_y[,,i]%*%id_yt[,,i]
}
m_id
--
View this message in context: http://www.nabble.com/Matrix-multiplication---code-problem-tp22835003p22835003.html
Sent from the R help mailing list archive at Nabble...
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 whi...
2010 Jul 12
2
exercise in frustration: applying a function to subsamples
...e plyr, or a combination of functions like split and lapply would
allow me to have a really short R script to analyze all my data (I have
reduced it to a couple hundred thousand records with about half a dozen
records.
I get the same result from ddply and split/lapply:
> ddply(moreinfo,c("m_id","sale_year","sale_week"),
> + function(df) data.frame(res = fitdist(df$elapsed_time,"exp"),est =
> res$estimate,sd = res$sd))
> Error in fitdist(df$elapsed_time, "exp") :
> data must be a numeric vector of length greater than 1
>...
2006 Jun 19
2
Function hints
...dley
hints <- function(x) {
db <- eval(utils:::.hsearch_db())
if (is.null(db)) {
help.search("abcd!", rebuild=TRUE, agrep=FALSE)
db <- eval(utils:::.hsearch_db())
}
base <- db$Base
alias <- db$Aliases
key <- db$Keywords
m <- all.methods(class=class(x))
m_id <- alias[match(m, alias[,1]), 2]
keywords <- lapply(m_id, function(id) key[key[,2] %in% id, 1])
f.names <- cbind(m, base[match(m_id, base[,3]), 4])
f.names <- unlist(lapply(1:nrow(f.names), function(i) {
if (is.na(f.names[i, 2])) return(f.names[i, 1])
a <- methodsplit(f.names...
2006 Jun 19
2
Function hints
...dley
hints <- function(x) {
db <- eval(utils:::.hsearch_db())
if (is.null(db)) {
help.search("abcd!", rebuild=TRUE, agrep=FALSE)
db <- eval(utils:::.hsearch_db())
}
base <- db$Base
alias <- db$Aliases
key <- db$Keywords
m <- all.methods(class=class(x))
m_id <- alias[match(m, alias[,1]), 2]
keywords <- lapply(m_id, function(id) key[key[,2] %in% id, 1])
f.names <- cbind(m, base[match(m_id, base[,3]), 4])
f.names <- unlist(lapply(1:nrow(f.names), function(i) {
if (is.na(f.names[i, 2])) return(f.names[i, 1])
a <- methodsplit(f.names...
2010 Jul 21
0
One problem with RMySQL and a query that returns an empty recordset
...Within Rgui, the script continues through to the end, but the loop
that is involved terminates at the line where this error occurs. The line
that results in this error is:
moreinfo <- dbGetQuery(con, x)
This statement occurs in a loop that ought to iterate over a few hundred
values for m_id (see the SQL below). Because of the above error, I never
see about 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 + DA...
2010 Jul 22
1
How do I get rid of list elements where the value is NULL before applying rbind?
Here is the function that makes the data.frames in the list:
funweek <- function(df)
if (length(df$elapsed_time) > 5) {
res = fitdist(df$elapsed_time,"exp")
year = df$sale_year[1]
sample = df$sale_week[1]
mid = df$m_id[1]
estimate = res$estimate
sd = res$sd
samplesize = res$n
loglik = res$loglik
aic = res$aic
bic = res$bic
chisq = res$chisq
chisqpvalue = res$chisqpvalue
chisqdf = res$chisqdf
if (!is.null(estimate) && !is.null(sd) && !is.null(loglik) &&am...
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 us...
2006 Jun 20
2
Documentation issues [Was: Function hints]
...help.search("abcd!", rebuild=TRUE, agrep=FALSE)
> > db <- eval(utils:::.hsearch_db())
> > }
> >
> > base <- db$Base
> > alias <- db$Aliases
> > key <- db$Keywords
> >
> > m <- all.methods(class=class(x))
> > m_id <- alias[match(m, alias[,1]), 2]
> > keywords <- lapply(m_id, function(id) key[key[,2] %in% id, 1])
> >
> > f.names <- cbind(m, base[match(m_id, base[,3]), 4])
> > f.names <- unlist(lapply(1:nrow(f.names), function(i) {
> > if (is.na(f.names[i, 2])) r...
2006 Jun 20
1
[R] Function hints
...help.search("abcd!", rebuild=TRUE, agrep=FALSE)
> > db <- eval(utils:::.hsearch_db())
> > }
> >
> > base <- db$Base
> > alias <- db$Aliases
> > key <- db$Keywords
> >
> > m <- all.methods(class=class(x))
> > m_id <- alias[match(m, alias[,1]), 2]
> > keywords <- lapply(m_id, function(id) key[key[,2] %in% id, 1])
> >
> > f.names <- cbind(m, base[match(m_id, base[,3]), 4])
> > f.names <- unlist(lapply(1:nrow(f.names), function(i) {
> > if (is.na(f.names[i, 2])) r...
2010 Jul 15
1
How do I combine lists of data.frames into a single data frame?
...rv$granularity = "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...
2010 Jul 16
1
Troubles with DBI's dbWriteTable in RMySQL
I am feeling rather dumb right now.
I created what I thought was a data.frame as follows:
aaa <- lapply(split(moreinfo,list(moreinfo$m_id),drop = TRUE), fun_m_id)
m_id_default_res <- do.call(rbind, aaa)
print("==========================================")
m_id_default_res
print("==========================================")
ndf <- m_id_default_res[, c('mid', 'estimate', 'sd', 'logli...