Displaying 20 results from an estimated 3000 matches similar to: "transaction object - how to coerce this data"
2012 Mar 18
2
word frequency count
Hi:
I have a dataframe containing comma seperated group of words such as
milk,bread
bread,butter
beer,diaper
beer,diaper
milk,bread
beer,diaper
I want to output the frequency of occurrence of comma separated words
for each row and collapse duplicate rows, to make the output as shown
in the following dataframe:
milk,bread 2
bread,butter 1
beer,diaper 3
milk,bread 2
Thanks for help!
deb
2007 Oct 17
1
How to save association rules generated by arules package
Hi,
I have been able to generate association rules for Market Basket Analysis
using the following codes:
****************************************************************************
*******************************************
library("arules")
rules <- read.csv("write1.csv",na.strings=c(".", "NA", "", "?"),header=TRUE)
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)
2006 Nov 01
4
extract values from a vector
Hello,
I'm looking for a solution for the following problem:
I have two vectors
V1 <- c("apple","honey","milk","bread","butter")
V2 <- c("bread","milk")
now, I would like to know for each element in V1 if it's equal to one of
the elements in V2
I could do:
which(V1 == V2[1] | V1 == V2[2])
but what if I
2009 Aug 10
2
ggplot: colours to geom_segments
Just as an exercise I am tying to add colours to a geom_segment command. I can get one colour but not a sequence of colours.
Can anyone suggest how I can get the green lines in the plot below to be different colours? I thought I could use a palatte of colours but that did not seem to work.
Thanks
=========================================================================
library(ggplot2)
xx
2002 Apr 30
3
Labeling matrix data
Hello all -
I am sorry if this simple question is addressed in somewhere else. But, I couldn't find it. It's been for about a week using R. . .
My problem is:
Reading matrix data with "scan" does not seem to allow me to incorporate matrix labels (columns, and rows).
If I use read.table, I can import the lables. But, the problem is, I don't know how I make this data as
2012 Feb 29
1
ggplot2 dot chart-start at zero
I am trying to create a simple dot-plot in ggplot2 with a solid line from the y-axis to the dot, something I first saw in Cleveland's 1984 book
What I would like is to have the graph start at zero on the x-axis but leave some space on the right side of the plot area.
I assumed that I should be able to do this with expand() in scale_x_continuous() but either I'm wrong or just don't
2015 Apr 28
2
答复: I love NUT
Carsten,
This is a common issue in technology when you have complex products
that the majority of consumers of those products do not understand how
they operate.
If most UPS customers understood the importance of standardization they
would have refused to purchase non-standard UPSes and all UPSes would
have long ago standardized on a single management protocol.
The normal thing is that product
2017 Sep 04
1
Dataframe Manipulation
Hello Ulrik,
Can you please explain this code means how and what this code is doing
because I'm not able to understand it, if you can explain it i can use it
in future by doing some Lil bit manipulation.
Thanks
data_help <-
data_help %>%
mutate(Purchase_ID = 1:n()) %>%
group_by(Purchase_ID) %>%
do(split_items(.))
cat_help %>% gather("Foo",
2017 Aug 30
1
Dataframe Manipulation
by using these two tables we have to create third table in this format
where categories will be on the top and transaction will be in the rows,
On 30 August 2017 at 16:42, Hemant Sain <hemantsain55 at gmail.com> wrote:
> Hello Ulrik,
> Can you please once check this code again on the following data set
> because it doesn't giving same output to me due to absence of quantity,a
2017 Aug 31
0
Dataframe Manipulation
Hi Hemant,
the solution is really quite similar, and the logic is identical:
library(readr)
library(dplyr)
library(stringr)
library(tidyr)
data_help <- read_csv("data_help.csv")
cat_help <- read_csv("cat_help.csv")
# Helper function to split the Items and create a data_frame
split_items <- function(items){
x <- items$Items_purchased_on_Receipts %>%
2017 Nov 01
1
Creating Tag
i want to tag categories to its menuname.
i have a csv containing menu item name and in other csv i have a column
containing some strings,
i want to pick that strings from categories and look into menu items if
any menu item containing that string i want to create a new column next to
menu item name flagged as 1 otherwise 0
and the only condition is once a menu item flagged as 1 i don't need
2010 Jun 26
1
All a column to a data frame with a specific condition
Hi, folks,
Please first look at the codes:
plan_a=c('apple','orange','apple','apple','pear','bread')
plan_b=c('bread','bread','orange','bread','bread','yogurt')
value=1:6
data=data.frame(plan_a,plan_b,value)
library(plyr)
library(reshape)
mm=melt(data, id=c('plan_a','plan_b'))
2005 Apr 15
1
Factor Analysis Biplot
Dear R help
I am having difficulty doing a biplot of the first two factors of a factor
analysis. I presume it is because the values in factor 2 for Milk and NUTS
are not displayed in the component loadings.
Loadings:
Factor1 Factor2
RedMeat 0.561 -0.112
WhiteMeat 0.593 -0.432
Eggs 0.839 -0.195
Milk 0.679
Fish 0.300 0.951
Cereals -0.902 -0.267
2012 Jan 04
6
Combining characters
Hi all,
I'm trying to combine exhaustively several character arrays in R like:
x=c("one","two","three")
y=c("yellow","blue","green")
z=c("apple","cheese")
in order to get concatenation of
x[1] y[1] z[1] ("one yellow apple")
x[1] y[1] z[2] ("one yellow cheese")
x[1] y[2] z[1]("one blue
2006 May 04
5
I''m writing an article about Rails and I need help
Hi to everybody, I''m writing an article about Ruby on Rails and I need
to gather some information about the project and the community of core
developers. In particular I''d like to know something about the
organization of the project (how are decisions taken, who decides what
goes into the project, conflict resolution, contributions acceptance...)
and something more technical
2006 Dec 10
1
Use of bread() function
Hello,
I am trying to extract an estimator for the bread of the sandwich
function. I used bread(fitted model) however it seems that I have missed
something as an error message "no applicable method for "bread" appears.
My fitted model is a Spatial simultaneous autoregressive error
model.(errorsarlm in spdep package)
Can anyone please tell me what I might be doing wrong?
Your
2015 Jun 11
0
答复: I love NUT
Many Thanks for your explanation, Ted!
All the necessaries to produce (and live from) new UPS-Equippment I
understand. Because of this I decided years ago to sell MGE-UPS. MGE did
have the greatness to pay Arnaud Quette to improve the Metasoftware NUT.
So we have one Software for brand new models and over 20years old IT
dinosaur. We earn money with replacement of accumulators and save in
2007 Oct 30
1
Some matrix and sandwich questions
Dear R-help,
I have a four-part question about regression, matrices, and sandwich package.
1) In the sandwich package, I would like to better understand the
meat() function.
>From the bread() documentation, for a simple OLS regression, bread() returns
(1/n * X'X)^(-1)
That is, for a simple regression (per the documentation on bread()):
MyLM <- lm(y ~ x)
bread(MyLM)
2000 Mar 10
1
logit and polytomous data
I am new to generalized linear models and studying
McCullagh & Nelder (1989). Especially, I have a problem
resembling the \"cheese taste\" example (5.3.1. p. 109) of
the book. I tried to analyse the cheese example with R but
failed to do so because R allowed me to use logit link
function only with binary family that supposes 0 <= y <= 1.
Do I need to scale the y\'s or