Displaying 20 results from an estimated 400 matches similar to: "ggplot2 : commands on one line vs two lines."
2006 Mar 26
2
Problem with names() in a plot after ordering a data.frame. Syntax or stupidity?
I am a complete newbie in R .
Using R 2.2.0 Windows XP
This started as a simple exercise to see if I could
produce a simple
Cleveland style dotchart with a line from the '2' axis
to the dot rather
than a continuous line as do "dotchart" and
"dotchart2". At least I could not
find that option.
I got a crude program to work but it includes
unnecessary steps.
2006 Jul 24
6
error_messages_for not working
I have the following code and I am not able to get it working. The error
message is not coming on the top, it is just getting displayed on a
different page if I dont have the rescue block commented at the bottom.
Model: user.rb
require "digest/sha1"
class User < ActiveRecord::Base
validates_presence_of :eaddress, :fname, :passwd, :pcode, :country,
:day, :year, :month, :gender,
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
2012 Dec 12
1
ggplot: geom_line with only pairs of points connected
Dear list,
I've been using plotmeans {gplots} a lot before, and found the
"connect" argument to be quite useful.
I've moved to ggplot for several reasons, but would still like to
connect lines conditionally, somehow.
Is it possible to do?
Small example:
df <- data.frame(cat=LETTERS[1:4],num=rnorm(4))
ggplot(df, aes(x=cat, y=num)) + geom_point() +
2017 Dec 04
1
ggtern and bquote...
D'oh! Thanks for pointing this out. I blame caffeine depletion at the time...
-pd
> On 4 Dec 2017, at 15:48 , Eik Vettorazzi <E.Vettorazzi at uke.de> wrote:
>
> reading ?plotmath you might notice that "_" isn't the propper syntax for
> subscripts. This will work:
>
> ggtern(data=x11,aes(A,B,C,xend = c(0.7,.00,0.7),yend =
> c(.30,.50,.0),zend
2017 Dec 04
0
YNT: ggtern and bquote...
reading ?plotmath you might notice that "_" isn't the propper syntax for
subscripts. This will work:
ggtern(data=x11,aes(A,B,C,xend = c(0.7,.00,0.7),yend =
c(.30,.50,.0),zend =c(.0,.50,0.3)))+
geom_point()+
theme_showarrows()+geom_segment(size=.5)+
geom_text_viewport(x=c(.45,.27,.37),y=c(.32,.29,.22),label=c("P[a]","P[b]","P[c]"),
parse=TRUE)
2009 Nov 17
2
Lattice plot
Hi,
I was trying to get a graph in lattice with the following data frame (7 rows, 5 cols):
chr start1 end1 meth positive
1 1 10 20 1.5 y
2 2 12 18 -0.7 n
3 3 22 34 2.0 y
4 1 35 70 3.0 y
5 1 120 140 -1.3 n
6 1 180 190 0.2 y
7 2 220 300 0.4 y
I wanted the panels to be organized by 'chr' -
2017 Dec 04
1
YNT: ggtern and bquote...
Hi,
My example code is this;
x11<-data.frame(A=c(.6,.6,.6),B=c(.20,.20,.20),C=c(0.20,.20,.20))
ggtern(data=x11,aes(A,B,C,xend = c(0.7,.00,0.7),yend = c(.30,.50,.0),zend =c(.0,.50,0.3)))+
geom_point()+
theme_showarrows()+geom_segment(size=.5)+
geom_text_viewport(x=c(.45,.27,.37),y=c(.32,.29,.22),label=as.expression("P_a","P_b","P_c"))
2009 Aug 01
2
Add columns in a dataframe and fill them from another table according to a criteria
Deare R users
I am new to R.
What I want to do is explained below;-
I have table called States.Prob which is given below:-
This table gives the probabilities of the changes in the swap curve
depending on the state of the swap curve. I want to put these probabilities
in my dataframe mydata(given after the prob table).
Prob of States
Changes State1 State2 State3 State4
a
2008 May 21
2
Search a string and modify it in a .txt file
Hi there,
I use R and I would like to be able to modify a file .txt "init_file" like this one :
# ---------------------------------------------------------------------------- #
# Parameters A
# ---------------------------------------------------------------------------- #
# Parameter 1
PA1 = 15
# Parameter 2
PA2 = 3
# Parameter 3
PA3 = 2
#
2012 Jun 08
2
Percent of a given subset
How would I find the Percent of FuelTypeNum within the Band given
AvailableMW?
example:
type 1 is 1% of PB0
type 2 is 54% of PB0
type 4 is 4% of PB0
type 5 is 42% of PB0
Note: the Bands and fuel types are not always constant.
Data:
FuelTypeNum Bands AvailableMW AvailableMWNewFormat
1 PB0 185319 185.319
2 PB0 18352000 18352
4 PB0 1338785 1338.785
5 PB0 14189756 14189.756
2 PB1
2006 Jul 14
1
auto completion with composite field
How can auto completion be done for a composite field ?
Concrete problem : Suppose the class Person with reference to a City
object.
The City has a name and a postal code.
When entering a Person I want to enter the city in one text field that
shows a composition of the city name and the postal :
"city (postal)". And this with auto complete (and should afterwards be
linked to the
2010 Aug 05
1
Reproducible HVM DomU reboot Xen3.2 (Debian Stable)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
I''ve been using xen for a number of years now without issues, but now
have a problem.
First, the problem:
I have a Windows Server 2008 Standard 64bit DomU, I''ve installed a
number of applications, and it works quite well and runs stable for
weeks at a time so far (ie, has never crashed yet).
I tried to install QuickBooks
2009 Jul 31
1
Fill dataframe from a table according to a criteria
Deare R users
I am new to R.
What I want to do is explained below;-
I have table called States.Prob which is given below
Prob of States
Changes State1 State2 State3 State4
A Pa1 Pa2 Pa3 Pa4
B Pb1 Pb2 Pb3 Pb4
C Pc1 Pc2 Pc3 Pc4
D Pd1 Pd2 Pd3 Pd4
and I have a dataframe called
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
2013 Mar 15
0
ggplot2, arrows and polar coordinates
Dear R users,
The following issue has been already documented, but, if I am not
mistaken, not yet solved.
This issue appears while trying to plot arrows with "geom_segment"
(package ggplot2), with polar coordinates ("coord_polar"). The direction
of some arrows is wrong (red rectangle). Please find herewith an example.
Does someone know how to deal with that issue?
Best
2012 Jun 06
5
ggplot incorrect legend
How do I create a legend with ggplot?
I think should be getting the FuelTypeNum in the legend.
Plot:
http://r.789695.n4.nabble.com/file/n4632471/Rplot.jpeg
My code is:
ggplot(data=tempTable, aes(x=Bands8, y=SubPercent, fill=FuelTypeNum)) +
geom_bar(position="stack", stat="identity") +
scale_colour_hue('my legend', breaks = levels(tempTable$FuelTypeNum),
2019 Jul 18
4
Gráfico tiempos de supervivencia
Hola,
Sí, lo puedes hacer de esta forma...
#-----------------
set.seed(20)
DATOS <- data.frame (
ID = c (1:10)
, TIEMPO = sample(1:40, 10, replace=F)
, DEF = as.factor(sample(c(0,1), 10, replace=T))
)
library(ggplot2)
ggplot( data = DATOS ) +
geom_point( aes(x = TIEMPO, y = ID , shape = DEF, color = DEF), size = 5
) +
geom_segment( aes( x = 0, y = ID, xend =
2007 Sep 27
3
Plotting from different data sources on the same plot (with ggplot2)
Hello everyone (and Hadley in particular),
I often need to plot data from multiple datasets on the same graph. A
common example is when mapping some values: I want to plot the
underlying map and then add the points. I currently do it with base
graphics, by recording the maximum region in which my map+point will
fit, plotting both with these xlim and ylim parameters, adding par
(new=T)
2012 Apr 05
1
issue with base:::namespaceImportMethods
Hi,
I've noticed an issue with S4 methods and namespaces which only arises in
particular, difficult to reproduce configurations. One example is the ggbio
package in Bioconductor, which currently emits these warnings when its
namespace is loaded:
----------------------
library(ggbio)
Loading required package: ggplot2
Attaching package: ‘ggbio’
The following object(s) are masked from