Displaying 20 results from an estimated 300 matches similar to: "Eliminating For Loop in Comparison and Replacement"
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"),
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_len(ncol(dat2)),function(i)
2004 Sep 11
3
SAS to R migration questions
Hi,
I'd like to get away from SAS, but 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)
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] --
2003 Mar 20
1
Plot multi series on one plot
R help,
How can I plot the below data table by Data ~ Site and group by Grinder and Equip Id
so I get a chart like this Excel version? I have tried coplot with little success and lattice
makes a pretty good chart like I want, but I am using the DCOM so it does not display
correctly. I would like to make this using the base library if possible.
<<...OLE_Obj...>>
DATA TABLE
2006 Apr 26
5
accessing created_on causes type error
I assume that this is some newbie stupidity, but I haven''t found my
way around this problem. I have an ActiveRecord object fetched
from 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 =
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)
Hi Hemant,
Here is an example that might answer your questions. Please don't run
previous code as it might not work.
I define the break values as arguments to the function
(rbreaks,fbreaks,mbreaks) If you want the breaks to work, make sure that
they cover the range of the input values, otherwise you get NAs.
# expects a three (or more) column data frame where
# column 1 is customer ID,
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)
I'm getting all the rows as NA in Cscore and almost most of the
observation in R and F and M are also NA.
what can be the reason for this. also suggest me the appropriate solution.
On 9 October 2017 at 15:51, Jim Lemon <drjimlemon at gmail.com> wrote:
> Hi Hemant,
> Here is an example that might answer your questions. Please don't run
> previous code as it might not work.
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
2017 Oct 11
0
RFM analysis
Hi Hemant,
Let's take it one step at a time. Save this code as "qdrfm.R" in your
R working directory: It includes the comments I added last time and
fixes a bug in the recency scoring.
qdrfm<-function(x,rbreaks=3,fbreaks=3,mbreaks=3,
date.format="%Y-%m-%d",weights=c(1,1,1),finish=NA) {
# if no finish date is specified, use current date
if(is.na(finish))
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)
I seriously doubt that you are running the code I sent. What you have
probably done is to run your data, which has a different date format,
without changing the breaks or the date format arguments. As you
haven't provided any example that shows what you are doing, I can't
guess what the problem is.
Jim
On Mon, Oct 9, 2017 at 9:40 PM, Hemant Sain <hemantsain55 at gmail.com> wrote:
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)
Hello Jim,
i have converted all my variable data type according to your attached
example including date, and my dataset looks like this.
ID purchase date
1234 10.2 2017-02-18
3453 18.9 2017-03-22
7689 8 2017-03-24
but when I'm passing the data
2006 Jul 04
1
options_for_select - default nil value
I have a field in a view, like so:
<%= select_tag(''quoted_condition'',
options_for_select([''NEW'',''RETAIL'',''OEM'',''REFURB''], ''NEW'')) %>
This sets the ''selected'' value to ''NEW'' - however, I would like to have
a nil value here, 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",
2005 May 10
4
SIPURA SPA-2000 webserver dead after firmware upgrade
I just got a refurb Sipura SPA-2000 and was able to assign it an IP
address with DHCP and ping the device, but then I ran the firmware
upgrade utility to bring it up to spa2k-2.0.13g which seemed to
work just fine, but after it rebooted I cannot connect to its
webserver for configuration. I can still ping the unit. When
I use the built in voice menu it reads back the right IP address,
webserver
2006 Jan 29
1
New C7960 won't tftp?
Just received a new Cisco 7960 (not refurb, but brand new) and it won't
tftp the initial config file (OS79XX.TXT) from an FC3 box. The 7960 does
get an appropriate dhcp response including the tftp address.
Using a sniffer, I see the tftp request being sent from the 7960 to the
FC3 box, but the FC3 box responds with error code 4 (Illegal TFTP opertion)
and an error message of "Request not
2004 Apr 04
1
How to improve this code?
Hi all,
I've got some functioning code that I've literally taken hours to
write. My 'R' coding is getting better...it used to take days :)
I know I've done a poor job of optimizing the code. In addition, I'm
missing an important step and don't know where to put it.
So, three questions:
1) I'd like the resulting output to be sorted on distance (ascending)
and
2010 Dec 25
0
For sale Yamaha DGX-640 Grand Piano Keyboard for $450USD
We are wholesale supplier of DJ equipment here in Taiwan.We have various model in stock such as Guitar,Amps/Effects,Bass,Drums,Keyboards,Live Sound in stock.interested buyers should contact us at the below address
yangmiaofenggear at yahoo.com
yangmiaofenggear at hotmail.com
Pioneer DJM 909 ...................$500USD
PIoneer DJM 700 ...................$450USD
Pioneer DJM 800
2004 Dec 07
3
Continuance on Polycom issue, not ringing
Ok, so I emailed the list earlier about my polycom phone not ringing
when anyone called in. Well, polycom support said that is impossible
that this could happen because of a change in a configuration file.
However the new phone arrived today (a refurb.) and it also would not
ring. So I obviously got rather frustrated and blasted away all of my
configuration files from the FTP server. I then copied
2008 Apr 18
0
OT Nice IBM 1U Server Gets Along w/Old and New Digium Boards Cheap X305 $199
Just an FYI on a great server for cheap if anyone is looking for a
solid Asterisk platform. I don't work for these guys or have any
affiliation, I just saw this deal and used to use these and the X306s
for Asterisk deployments because they were trouble free as far as
hardware, IRQs, and OS. They were ~$1,000 a couple of years ago.
It is a refurb so YMMV.