search for: custid

Displaying 20 results from an estimated 21 matches for "custid".

2013 Sep 02
1
R dataframe and looping help
HI, You may try this: dat1<- read.table(text=" CustID TripDate Store Bread Butter Milk Eggs 1 2-Jan-12 a 2 0 2 1 1 6-Jan-12 c 0 3 3 0 1 9-Jan-12 a 3 3 0 0 1 31-Mar-13 a 3 0 0 0 2 31-Aug-12 a 0 3 3 0 2 24-Sep-12 a 3 3 0 0 2 25-Sep-12 b 3 0 0 0 ",sep="",header=TRUE,stringsAsFactors=FALSE) dat2<- dat1[,-c(1:3)] res<- lapply(seq_le...
2006 Apr 26
5
accessing created_on causes type error
...om the database, and I need to evaluate the contents of the updated_on field. However, *any* attempt to access that data in the program results in a TypeError with the message ''no implicit conversion from nil to integer''. cust = Customer.find(:first, :conditions => ["custid = ?", custid] if cust.updated_on.nil? ...never gets here end Any help would be much appreciated Ken -- I use the words you taught me. If they don''t mean anything any more, teach me others. Or let me be silent. Samuel Beckett (Clov, Endgame)
2004 Sep 11
3
SAS to R migration questions
...t I don't really know R well enough at this point to know if it would be good for this project. I tried to describe the essence of the project below without getting bogged down in details. It starts when I receive a data flat file. There's lots of columns, but the relevant ones are: custid (customer ID number) saledt (date of sale) salepx (sale price) Step 1: I read in this data into a SAS dataset. Some of these flat files hold several gigabytes of data. SAS allows indexes to be created on columns which really speeds up queries. I read the R import/export doc and it...
2010 Jun 05
1
Problem with GROUP()
Hello list, using asterisk 1.4.30 and trying GROUP() and GROUP_COUNT() for the first time... Having some troubles. This the dialplan (using a sub) : exten => s,n,Set(_custID=${custID}) exten => s,n,GROUP(${custID}) exten => s,n,NoOp(grouppcount = GROUP_COUNT(${custID})) exten => s,n,GoToIf($[ ${GROUP_COUNT(${custID})} > 2 ]?maxreached) The CLI shows : [Jun 5 16:06:26] -- Executing [s at sub-settings:4] Set("IAX2/testlocal-2669", "_cus...
2018 Feb 25
1
reshaping column items into rows per unique ID
Hi Allaisone, I took a slightly different approach but you might find this either as or more useful than your approach, or at least a start on the path to a solution you need. df1 <- data.frame(CustId=c(1,1,1,2,3,3,4,4,4),DietType=c("a","c","b","f","a","j","c","c","f"), stringsAsFactors=FALSE) custs <- unique(df1$CustId) dtype <- unique(df1$DietType) nc <- length(custs) nd...
2017 Oct 09
1
Help RFM analysis in R (i want a code where i can define my own breaks instead of system defined breaks used in auto_RFM package)
...quot;, weights=c(1,1,1),finish=NA) { # if no finish date is specified, use current date if(is.na(finish)) finish<-as.Date(date(), "%a %b %d %H:%M:%S %Y") x$rscore<-as.numeric(finish-as.Date(x[,3],date.format)) x$rscore<-as.numeric(cut(x$rscore,breaks=rbreaks,labels=FALSE)) custIDs<-unique(x[,1]) ncust<-length(custIDs) rfmout<-data.frame(custID=custIDs,rscore=rep(0,ncust), fscore=rep(0,ncust),mscore=rep(0,ncust)) rfmout$rscore<-cut(by(x$rscore,x[,1],min),breaks=rbreaks,labels=FALSE) rfmout$fscore<-cut(table(x[,1]),breaks=fbreaks,labels=FALSE) rfmout$msc...
2017 Oct 09
2
Help RFM analysis in R (i want a code where i can define my own breaks instead of system defined breaks used in auto_RFM package)
...t; # if no finish date is specified, use current date >> if(is.na(finish)) finish<-as.Date(date(), "%a %b %d %H:%M:%S %Y") >> x$rscore<-as.numeric(finish-as.Date(x[,3],date.format)) >> x$rscore<-as.numeric(cut(x$rscore,breaks=rbreaks,labels=FALSE)) >> custIDs<-unique(x[,1]) >> ncust<-length(custIDs) >> rfmout<-data.frame(custID=custIDs,rscore=rep(0,ncust), >> fscore=rep(0,ncust),mscore=rep(0,ncust)) >> rfmout$rscore<-cut(by(x$rscore,x[,1],min),breaks=rbreaks,labels=FALSE) >> rfmout$fscore<-cut(table(x[...
2017 Oct 09
0
Help RFM analysis in R (i want a code where i can define my own breaks instead of system defined breaks used in auto_RFM package)
...sh=NA) { > > # if no finish date is specified, use current date > if(is.na(finish)) finish<-as.Date(date(), "%a %b %d %H:%M:%S %Y") > x$rscore<-as.numeric(finish-as.Date(x[,3],date.format)) > x$rscore<-as.numeric(cut(x$rscore,breaks=rbreaks,labels=FALSE)) > custIDs<-unique(x[,1]) > ncust<-length(custIDs) > rfmout<-data.frame(custID=custIDs,rscore=rep(0,ncust), > fscore=rep(0,ncust),mscore=rep(0,ncust)) > rfmout$rscore<-cut(by(x$rscore,x[,1],min),breaks=rbreaks,labels=FALSE) > rfmout$fscore<-cut(table(x[,1]),breaks=fbreaks,...
2009 Jun 07
2
How do I construct a one matrix from another? (newbie)
Apologies if this is an obvious question but I am teaching myself R and the occasional push in the right direction is much appreciated? I have a data.frame containing data that looks like this CustID itemID 1 a 1 b 2 c 3 a 3 c I want to assemble the vector of all the items bought by a particular customer and can't quite see how to do it. What is the best way to represent the answers for a single customer and by all customers? Thanks. -- View this messa...
2018 Feb 25
0
reshaping column items into rows per unique ID
I believe you need to spend time with an R tutorial or two: a data frame (presumably the "table" data structure you describe) can *not* contain "blanks" -- all columns must be the same length, which means NA's are filled in as needed. Also, 8e^5 * 7e^4 = 5.6e^10, which almost certainly will not fit into any local version of R (maybe it would in some server version --
2017 Oct 10
0
Help RFM analysis in R (i want a code where i can define my own breaks instead of system defined breaks used in auto_RFM package)
...ate is specified, use current date > >> if(is.na(finish)) finish<-as.Date(date(), "%a %b %d %H:%M:%S %Y") > >> x$rscore<-as.numeric(finish-as.Date(x[,3],date.format)) > >> x$rscore<-as.numeric(cut(x$rscore,breaks=rbreaks,labels=FALSE)) > >> custIDs<-unique(x[,1]) > >> ncust<-length(custIDs) > >> rfmout<-data.frame(custID=custIDs,rscore=rep(0,ncust), > >> fscore=rep(0,ncust),mscore=rep(0,ncust)) > >> rfmout$rscore<-cut(by(x$rscore,x[,1],min),breaks=rbreaks,labels=FALSE) > >> rfmou...
2006 May 04
0
Eliminating For Loop in Comparison and Replacement
Hi, I have two dataframes: (Fails, Refurb) each is identical in structure. The structure has columns consisting of the following: EquipID(Equipment Identification), CustID(Customer Identification), FailTimes(Time Equipment Failed). The for loop below is part of a larger Monte Carlo simulation involving the reliability of equipment and customers. for (i in 1:length(Fails$CustID)){ j<-1 while (j <= length(Refurb$CustID)){ if (Refurb$FailTimes[j] <...
2017 Oct 11
0
RFM analysis
...x$rscore<-as.numeric(finish-as.Date(x[,3],date.format)) cat("Range of purchase recency",range(x$rscore),"\n") cat("Range of purchase freqency",range(table(x[,1])),"\n") cat("Range of purchase amount",range(by(x[,2],x[,1],sum)),"\n") custIDs<-unique(x[,1]) ncust<-length(custIDs) # initialize a data frame to hold the output rfmout<-data.frame(custID=custIDs,rscore=rep(0,ncust), fscore=rep(0,ncust),mscore=rep(0,ncust)) # categorize the minimum number of days # since last purchase for each customer rfmout$rscore<-cut(...
2018 Feb 25
4
reshaping column items into rows per unique ID
Hi All I have a datafram which looks like this : CustomerID DietType 1 a 1 c 1 b 2 f 2 a 3 j 4 c 4 c 4 f And I would like to reshape this so I can
2010 Sep 09
1
syntax error, unexpected '<token>'
Hello list, getting warning : *syntax error, unexpected '<token>'* dialplan : exten => pbx,n,Macro(CheckNetworkProblems,${custID}) exten => pbx,n,NoOp(status = ${STATUS}) exten => pbx,n,GoToIf($["${STATUS}"="congestion"]?backup:nocongestion) CLI : [Sep 9 12:27:07] -- Executing [pbx at cust:15] NoOp("SIP/test13-0000002a", "status = "congestion"") in new stack *[...
2007 Oct 24
7
NameError in CustomersController#index
I''m new to Rails. I finished the Cookbook tut. no problem. I''m trying to start a project of my own, follow the same instructions but the difference is I created the database myself. After I create the scaffolds and try them out I get this error NameError in CustomersController#index uninitialized constant Customer RAILS_ROOT: ./script/../config/.. Application Trace |
2017 Oct 06
3
Help RFM analysis in R (i want a code where i can define my own breaks instead of system defined breaks used in auto_RFM package)
I'm trying to perform an RFM analysis on the attached dataset, I'm able to get the results using the auto_rfm function but i want to define my own breaks for RFM. as follow r <-c(30,60,90) f <-c(2,5,8) m <-c(10,20,30) but when i tried to define my own breaks i got the identical result for RFM i.e 111 for every ID. please help me with this with working R script so that i can get
2010 Feb 24
4
identify the costumer
Hi People, I work in a company that are using asterisk as pbx. I need a way to identify what client my employees are calling. For example: - For each call that an employee of my company make to a customer, must identify the client name in the CDR table. - Is there a way of my employee enter a code to identify the client and then enter a phone number to make the call? I would like to identify
2004 Apr 04
1
How to improve this code?
...= 1)) #Generate Customer List customerlist <- cbind(1:10000,matrix(rnorm(10000, mean = -60, sd = 20), ncol = 1), matrix(rnorm(10000, mean = 50, sd = 10), ncol = 1)) #Output file outfile <- "c:\\output.txt" outfilecolnames <- c("rank","storeid","custid","distance") write.table(t(outfilecolnames), file = outfile, append=TRUE, sep=",",row.names=FALSE, col.names=FALSE) #Trade Area Size TAsize <- c(100) custlatlon <- customerlist[, 2:3] for(i in 1:length(TAsize)){ for(j in 1:nrow(storelist)){ cat("Store: &quo...
2005 Jan 24
3
cepstral integration with * using AGI?
Hi, I've looked at the Wiki for this, have seen the Swift.agi details, but has anyone got a current script for Cepstral and an example of integraton in * please? I'm a * and linux newbie, so please be gentle ;-) Thanks John