search for: diamonds

Displaying 20 results from an estimated 375 matches for "diamonds".

Did you mean: diamond
2018 Feb 08
2
sparse.model.matrix Generates Non-Existent Factor Levels if Ord.factor Columns Present
Good day, Sometimes, sparse.model.matrix outputs a dgCMatrix which has column names consisting of factor levels that were not in the original dataset. The first factor appears to be correctly transformed, but the following factors don't. For example: diamonds <- as.data.frame(ggplot2::diamonds) > colnames(sparse.model.matrix(~ . -1, diamonds)) [1] "carat" "cutFair" "cutGood" "cutVery Good" "cutPremium" "cutIdeal" "color.L" "color.Q" &q...
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 using ggplot ggdata <- d...
2003 Sep 25
1
Diamond graphs, again.
Some time ago I was allowed to discuss "Diamond Graphs", and whether they would be useful in R, in this mailing list. The August 2003 issue of The American Statistician has finally arrived here and I have been able to read the article. A number of points of interest arise. 1. The article is "A Diamond-Shaped Equiponderant Graphical Display of the Effects of Two
2003 Aug 21
3
Diamond graphs
...graphs this way: (1) Write a 2D table. - very old idea (2) Instead of numbers, put blobs of some kind where the size shows you the importance. - at least 3000 years old. (3) Rotate the table widdershins 45 degrees - swiped from 3D displays (4) Replace the blobs by truncated diamonds; height of bar or area of polygon or something shows value. - NOVELTY (5) Notice that it's not all that readable, so put the numbers back. The fact that someone would try to patent this strikes me as outrageous; the actual amount of novelty is so tiny. For R, I don'...
2011 Jun 01
1
Plotting from functions
I can plot to png's fine when i run this directly from the top-level script/console: png('diamonds.png');qplot(carat,price,data=diamonds);dev.off() But for some reason it's not working when that's in a function: (function(){png('diamonds.png');qplot(carat,price,data=diamonds);dev.off()})() I suspect this is because the qplot's return value must be "returned"...
2008 Mar 04
1
ggplot2 - Problem with grid plot
Hi R-help I'm trying to create a grid plot in which each plot in the grid contains two density plots (colored by factor) and two vertical lines at the respective medians (also colored by the factor). Using the diamonds dataset as an example, the following commands give me price density plots by factor cut in a single, ungridded plot. p <- ggplot(data=diamonds, aes(x=price)) + geom_density(aes(color=cut)) p I can add vertical lines at the medians of each density as follows. medians <- data.frame(cut=leve...
2009 May 07
1
I updated/reinstalled ggplot2 and the trouble started...
Hi Ian, Per your suggestion, I reinstalled R 2.9.0, then I reinstalled ggplot2 on top. The problem persists. Here's the what happens after the installation: > qplot (carat, price, data = diamonds, alpha = I(1/10)) Warning message: In grid.Call.graphics("L_points", x$x, x$y, x$pch, x$size) : semi-transparency is not supported on this device: reported only once per page The entire record of installing ggplot2 package, ending up with the line above is in the attached file....
2010 Jul 07
2
how to define method for "+" function in a new class
Dear R developers, I have a new class, which I called "Molecule", and have tried to define = a "+" operation for 2 objects of this class. This is what I have written so far, although the method is not complete = (I'm trying to look at it at intermediate stages): setMethod( f=3D"+", signature(x=3D"Molecule",y=3D"Molecule"),
2018 Feb 08
0
sparse.model.matrix Generates Non-Existent Factor Levels if Ord.factor Columns Present
...o Strbenac wrote: > Good day, > > Sometimes, sparse.model.matrix outputs a dgCMatrix which has column names consisting of factor levels that were not in the original dataset. The first factor appears to be correctly transformed, but the following factors don't. For example: > > diamonds <- as.data.frame(ggplot2::diamonds) >> colnames(sparse.model.matrix(~ . -1, diamonds)) > [1] "carat" "cutFair" "cutGood" "cutVery Good" "cutPremium" "cutIdeal" "color.L" "color.Q&quot...
2009 Feb 02
0
Error message when executing summary() with dataset diamonds in ggplot2
Hi: I am experiencing a problem with dataset diamonds in ggplot2. When trying execute the summary(diamonds) statement, the following error message is displayed: Error in summary(diamonds) : Cannot open file 'C:/Users/James/R_Pgms/R/R-2.8.1/library/ggplot2/data/Rdata.rdb': No such file or directory Can you please advise me? A complete hist...
2012 Jan 16
3
boxplot with diamond shape
Hi, I haven't found in R a possibility to draw a boxplot with a diamond shape (means and CI). Does anyone know how to plot it ? thanks,
2009 Mar 02
3
ways to put multiple graphs on single page (using ggplot2)
Hi, Here are three plots: library(ggplot2) data(diamonds) randind <- sample(nrow(diamonds),1000,replace=FALSE) dsmall <- diamonds[randind,] qplot(carat, data=dsmall, geom="histogram",binwidth=1) qplot(carat, data=dsmall, geom="histogram",binwidth=.1) qplot(carat, data=dsmall, geom="histogram",binwidth=.01) What are w...
2008 Oct 28
1
does qplot works with Sweave?
...\begin{document} \maketitle \section*{Examples of using ggplot2} The goal is to be able to import ggplot2 graphics into the annual report. Hadley Wickham has done a great job by creating this free R package. Let's get some data into R from one the built-in packages: We'll work with the diamonds data. This dataset is really large, it accounts for over 50.000 records. We will demostrate how to create nice and colorful graphics as well as creating some nice tabular tables with horizontal and vertical lines. <<dataAnalysis.R,echo=F>>= data(diamonds) attach(diamonds) dsmall &lt...
2009 Sep 06
5
ggplot2::qplot() -- arbitary transformations of coordinate system?
Hi, Does anyone know how to do a coord_trans() in which the y-axis is tranformed into (for example) -1000/y? Thanks, _____________________________ Professor Michael Kubovy University of Virginia Department of Psychology USPS: P.O.Box 400400 Charlottesville, VA 22904-4400 Parcels: Room 102 Gilmer Hall McCormick Road Charlottesville, VA 22903 Office: B011
2009 Dec 10
1
question about centroid-linkage (cluster analysis)
Dear R community, I would be greatful if somebody could shed light on the following. I have created a set of 6 points to check how centroid agglomeration works in cluster analysis: > Y <- data.frame(x=c(-1,1,1,-1,10,12),y=c(1,1,-1,-1,0,0)) It is quite intuitive to understand that the last clusters to be joined will be {1,2,3,4} with {5,6}. Now, the centroid for the first cluster has
2009 Nov 24
2
convex hull for cluster analysis
Dear R gurus and users, I seem to have problem finding the right tool for plotting convex hulls over 2D plots, after a cluster analysis. In fact I would like to draw a convex hull in 2D for a generic group of points. I found a "convhulln", but this doesn't seem to give me a convex hull. Here is what I do: > library(mvtnorm) > Mean <- c(2,1) > Sigma <-
2010 Sep 10
3
ggplot bar geom: control the filling in the colour legend
Hi all, Is it possible to change the filling of the squares used to represent the colour legend in a bar plot with ggplot? in this example, fillings are raven black, I'd like them white. ggplot(diamonds, aes(clarity, colour = cut)) + geom_bar() Regards -- ------------- Benoit Boulinguiez Ph.D student Ecole de Chimie de Rennes (ENSCR) Bureau 1.20 Equipe CIP UMR CNRS 6226 "Sciences Chimiques de Rennes" Avenue du G?n?ral Leclerc CS 50837 35708 Rennes CEDEX 7 Tel 33 (0)2 23 23 80 83 Fax 3...
2011 Feb 17
3
ggplot2, 'se' variable in geom_errorbar's limits?
Dear R-list I'm working with with geom_errorbar; specifically I'm trying to reproduce the example Hadley Wickham have on http://had.co.nz/ggplot2/geom_errorbar.html (all in the button of the page) where he makes an nice plot with errorbars and then draw lines between the points. What confuses me is the 'limits' he defines for the errorbars from the se variable. First he creates
2011 Sep 30
2
ggplot2 - extracting values of smooth
Suppose that I'm working on Hadley's diamond dataset and I want to review the relationship between price, colour and carat. I might run the following: library(ggplot2) #plot scatter and add some hex binning q<-qplot(carat,price,data=diamonds, geom=c("hex"), main="Variability of Diamond Prices by Carat and Colour") #facet to get one scatter for each colour, plus overlay a black coloured loess smoothed line showing the trends in the data q + facet_wrap(~color,ncol=2)+geom_smooth(aes(group=1),colour=...
2013 Aug 06
1
[LLVMdev] Potential SimplifyCFG optimization; hammock to diamond transformation
Message: 6 Date: Tue, 6 Aug 2013 10:46:19 -0400 From: Chad Rosier <chad.rosier at gmail.com<mailto:chad.rosier at gmail.com>> To: llvmdev <llvmdev at cs.uiuc.edu<mailto:llvmdev at cs.uiuc.edu>> Subject: [LLVMdev] Potential SimplifyCFG optimization; hammock to diamond transformation Message-ID: <CAMo3wbR6x1wBzb17=GrkERV7kvzx2RdpuheFzyxkQEs3BBvKaw at