Displaying 6 results from an estimated 6 matches for "meanpric".
Did you mean:
meanprice
2009 Sep 11
1
bar chart with means - using ggplot
Like this?
# example using qplot
library(ggplot2)
meanprice <- tapply(diamonds$price, diamonds$cut, mean);meanprice
cut <- factor(levels(diamonds$cut), levels = levels(diamonds$cut))
qplot(cut, meanprice, geom="bar", stat="identity", fill = I("grey50"))
dev.new() # create a new graph to compare with qplot
# Example usin...
2018 May 26
3
Grouping by 3 variable and renaming groups
...a by 3
variables as follows
# group by lat (StoreX)/long (StoreY)
priceStore <- LapTopSales[,c(4,5,15,16)]
priceStore <- priceStore[complete.cases(priceStore), ] # keep only non NA
records
priceStore_Grps <- priceStore %>%
group_by(StorePC, StoreX, StoreY) %>%
summarize(meanPrice=(mean(RetailPrice)))
which results in .
> priceStore_Grps
# A tibble: 15 x 4
# Groups: StorePC, StoreX [?]
StorePC StoreX StoreY meanPrice
<fct> <int> <int> <dbl>
1 CR7 8LE 532714 168302 472.
2 E2 0RY 535652 182961 520.
3 E7...
2018 May 26
0
Grouping by 3 variable and renaming groups
...ong (StoreY)
>
> priceStore <- LapTopSales[,c(4,5,15,16)]
>
> priceStore <- priceStore[complete.cases(priceStore), ] # keep only non NA
> records
>
> priceStore_Grps <- priceStore %>%
>
> group_by(StorePC, StoreX, StoreY) %>%
>
> summarize(meanPrice=(mean(RetailPrice)))
>
>
>
> which results in .
>
>
>
>> priceStore_Grps
>
> # A tibble: 15 x 4
>
> # Groups: StorePC, StoreX [?]
>
> StorePC StoreX StoreY meanPrice
>
> <fct> <int> <int> <dbl...
2018 May 26
1
Grouping by 3 variable and renaming groups
...apTopSales[,c(4,5,15,16)]
>>
>> priceStore <- priceStore[complete.cases(priceStore), ]? # keep only
>> non NA
>> records
>>
>> priceStore_Grps <- priceStore %>%
>>
>> ?? group_by(StorePC, StoreX, StoreY) %>%
>>
>> ?? summarize(meanPrice=(mean(RetailPrice)))
>>
>>
>> which results in .
>>
>>
>>> priceStore_Grps
>>
>> # A tibble: 15 x 4
>>
>> # Groups:?? StorePC, StoreX [?]
>>
>> ??? StorePC? StoreX StoreY meanPrice
>>
>> ??? <fct>???? <...
2012 Jan 16
2
ggplot2 stacked bar - sum of values rather than count
Hi,
I'm trying to create a stacked bar plot using ggplot2. Rather than
plotting the count of each of the 13 "Bar" factors on the Y axis, I
would like to represent the sum of the Values associated with each of
the 13 "Bar" factors. Is there a way to do that? Given the following
data, that would obviously mean that there would be some negative sums
represented. Here's
2010 Jan 26
2
Large dataset importing, columns merging and splitting
Dear All,
I have a large data set that looks like this:
CVX 20070201 9 30 51 73.25 81400 0
CVX 20070201 9 30 51 73.25 100 0
CVX 20070201 9 30 51 73.25 100 0
CVX 20070201 9 30 51 73.25 300 0
First, I would like to import it by merging column 3 4 and 5, since that is
the timestamp. Then, I would like to aggregate the data by splitting them in
bins of 5 minutes size, therefore from 93000 up to