Re: [R] Plot R graphs in aws

2023-04-23 Thread Hasan Diwan
Alternatively, you can put R-studio server on AWS by going to
https://www.louisaslett.com/RStudio_AMI/. -- H

On Thu, 20 Apr 2023 at 04:58, Duncan Murdoch 
wrote:

> On 20/04/2023 7:43 a.m., Naresh Gurbuxani wrote:
> > In my Amazon Web Services (AWS) account, I use R via emacs launched from
> terminal. While R computations work well, viewing graphs is inconvenient.
> I am not able to use screen device.  I can send graphs to a png or pdf
> file, then open the file.
> >
> > I would like a setup where code is run in one window while graphs are
> displayed in another window.  Has anyone created a setup like this?
>
> You don't say which OS's you are running, but if you can run an X server
> on your local machine, the remote R process should be able to display
> graphs there (as long as it is running on a Unix-alike).
>
> Duncan Murdoch
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>


-- 
OpenPGP: https://hasan.d8u.us/openpgp.asc
If you wish to request my time, please do so using
*bit.ly/hd1AppointmentRequest
*.
Si vous voudrais faire connnaisance, allez a *bit.ly/hd1AppointmentRequest
*.

Sent
from my mobile device
Envoye de mon portable

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Plot R graphs in aws

2023-04-20 Thread Duncan Murdoch

On 20/04/2023 7:43 a.m., Naresh Gurbuxani wrote:

In my Amazon Web Services (AWS) account, I use R via emacs launched from 
terminal. While R computations work well, viewing graphs is inconvenient.  I am 
not able to use screen device.  I can send graphs to a png or pdf file, then 
open the file.

I would like a setup where code is run in one window while graphs are displayed 
in another window.  Has anyone created a setup like this?


You don't say which OS's you are running, but if you can run an X server 
on your local machine, the remote R process should be able to display 
graphs there (as long as it is running on a Unix-alike).


Duncan Murdoch

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Plot R graphs in aws

2023-04-20 Thread Naresh Gurbuxani
In my Amazon Web Services (AWS) account, I use R via emacs launched from 
terminal. While R computations work well, viewing graphs is inconvenient.  I am 
not able to use screen device.  I can send graphs to a png or pdf file, then 
open the file.  

I would like a setup where code is run in one window while graphs are displayed 
in another window.  Has anyone created a setup like this?

Thanks,
Naresh
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] graphs, need urgent help (deadline :( )

2015-06-11 Thread Rosa Oliveira
 have 9 lines
 3 red (1 dash, 1 thin, 1 thick) - concerning factor a (dash for sample 
 size 50, thin for sample size 250 and thick for sample size 1000)
 3 blue (1 dash, 1 thin, 1 thick) - concerning factor b (dash for sample 
 size 50, thin for sample size 250 and thick for sample size 1000)
 3 green (1 dash, 1 thin, 1 thick) - concerning factor c (dash for sample 
 size 50, thin for sample size 250 and thick for sample size 1000)
 
 
 
 Hope this time is clear.
 
 
 I also though about doing 3 different graphs, each one for 1 different 
 sample size, and in that case I should have 3 graphs each one with 3 lines
 1 red to factor a, 1 blue to factor b and 1 green to factor c.
 
 Do you all think is better?
 
 A matter of style perhaps but I would use dotplots because you have only 
 two data points for each “line”.  The lines will be misleading.  You also 
 could use 
 panel plots, but given your skill set (unless someone wants to spend a 
 fair bit of time with you), it’s probably best to stay as simple as 
 possible.
 
 But given your original post (cleaned up)   # untested: apologies for any 
 typos
 
region  sample  factora  factorb   
 factorc
   0.1 10   0.895  0.903   
 0.378
   0.2 10  0.8110.865  
  0.688
   0.1 20  0.735   0.966   
 0.611
   0.2 20   0.777   0.732  
  0.653
   0.1 30  0.600   0.778   
 0.694
   0.2 30   0.466   174.592
 0.461
   0.1 40   0.446  0.432   
 0.693
   0.2 40   0.392  0.294   
  0.686
 
 plot(my.data$region[my.data$sample==10],my.data$factora[my.data$sample==10],col=4,type=“l”,ylim=c(0,1),xlab=“region”,ylab=“factor)
 lines(my.data$region[my.data$sample==10],my.data$factorb[my.data$sample==10],col=2)
 lines(my.data$region[my.data$sample==10],my.data$factorc[my.data$sample==10],col=3)
 
 lines(my.data$region[my.data$sample==20],my.data$factora[my.data$sample==20],col=4,lty=2)
 lines(my.data$region[my.data$sample==20],my.data$factorb[my.data$sample==20],col=2,lty=2)
 lines(my.data$region[my.data$sample==20],my.data$factorc[my.data$sample==20],col=3,lty=2)
 
 #  Now do two more groups of 3, changing the parameter “lty” to 3 and then 
 4
 
 # Look at the syntax and note what changes and what stays constant. Do you 
 see how this works?
 # there will be what looks like a vertical line where sample = 30 and 
 factorb = 174.592.  Do you see why?
 
 # then you will need a legend
 
 Nonetheless I can’t do it :(
 
 best,
 RO
 
 
 
 Atenciosamente,
 Rosa Oliveira
 
 -- 
 
  
 smile.jpg
 Rosa Celeste dos Santos Oliveira, 
 
 E-mail: rosit...@gmail.com
 Tlm: +351 939355143 
 Linkedin: https://pt.linkedin.com/in/rosacsoliveira
 
 Many admire, few know
 Hippocrates
 
 On 10 Jun 2015, at 14:13, John Kane jrkrid...@inbox.com wrote:
 
 Hi Jim,
 
 I was looking at that last night and had the same problem of visualizing 
 what Rosa needed.  
 
 Hi Rosa
 This is nothing like what you wanted and I really don't understand your 
 data but would something like this work as a substitute or am I 
 completely lost?
 
 
 dat1  -  structure(list(region = c(0.1, 0.2, 0.1, 0.2, 0.1, 0.2, 0.1, 
 0.2), sample = c(10L, 10L, 20L, 20L, 30L, 30L, 40L, 40L), factora = 
 c(0.895, 
 0.811, 0.735, 0.777, 0.6, 0.466, 0.446, 0.392), factorb = c(0.903,
 0.865, 0.966, 0.732, 0.778, 0.592, 0.432, 0.294), factorc = c(0.37, 
 0.688, 0.611, 0.653, 0.694, 0.461, 0.693, 0.686)), .Names = c(region, 
 sample, factora, factorb, factorc), class = data.frame, 
 row.names = c(NA, 
 -8L))
 
 
 mdat1  -   melt(dat1, id.var = c(region, sample),
variable.name = factor,
value.name = value)
 str(mdat1)
 
 ggplot(mdat1, aes(region, value, colour = factor)) +
geom_line() + facet_grid(sample ~ .)
 
 John Kane
 Kingston ON Canada
 
 
 -Original Message-
 From: drjimle...@gmail.com
 Sent: Wed, 10 Jun 2015 20:51:52 +1000
 To: rosit...@gmail.com
 Subject: Re: [R] graphs, need urgent help (deadline :( )
 
 Hi Rosa,
 Like Don, I can't work out what you want and I don't even have the
 picture. For example, your specification of color and line type leaves
 only one point for each color and line type, and the line from one
 point to the same point is not going to show up. Here is a possibility
 that may lead (eventually) to a solution.
 
 library(plotrix)
 par(tcl=-0.1)
 gap.plot(x=rep(seq(10,45,by=5),3),
 y=unlist(my.data[,c(factora

Re: [R] graphs, need urgent help (deadline :( )

2015-06-11 Thread Don McKenzie
Thanks John!  My eyes aren't good enough to see that. I actually checked (I 
thought). This was the default window on Mac console, for others who might care.

Sent from my iPad

 On Jun 10, 2015, at 6:17 PM, John Kane jrkrid...@inbox.com wrote:
 
 You have curly quotes rather than plain ones here : 
 col=4,type=“l”,xlab=“Region”,ylab=“factor)
 
 
 
 John Kane
 Kingston ON Canada
 
 -Original Message-
 From: d...@u.washington.edu
 Sent: Wed, 10 Jun 2015 11:32:59 -0700
 To: rosit...@gmail.com
 Subject: Re: [R] graphs, need urgent help (deadline :( )
 
 You were caught by a mysterious issue that I don’t understand either.
 
 plot(therapy.df$Region[therapy.df$sample==50],therapy.df$factor.a[therapy.df$sample==50],col=4,type=“l”,xlab=“Region”,ylab=“factor)
 
 Error: unexpected input in 
 plot(therapy.df$Region[therapy.df$sample==50],therapy.df$factor.a[therapy.df$sample==50],col=4,type=‚”
 
 but if I change the order of arguments to plot(), it’s fine
 
 plot(therapy.df$Region[therapy.df$sample==50],therapy.df$factor.a[therapy.df$sample==50],type=l,col=4,xlab=Region,ylab=factor”)
 
 I don’t know what to tell you.  If someone wiser than I is still reading, 
 maybe s(he) can explain.  Possibly a bug has crept into the call to “par”, 
 but “bugs suspected by non-experts like me usually turn out to be naive user 
 errors.  
 
 For your purposes, use the one that works.  :-)
 
 On Jun 10, 2015, at 11:03 AM, Rosa Oliveira rosit...@gmail.com wrote:
 
 Sorry,
 
 I taught I attached the cvs file :)
 
 therapy.csv
 
 Don,
 
 I tried, but I got an error:
 
 my.data$Region
 
  [1]  1  2  3  4  5  6  7  8  9 10  1  2  3  4  5  6  7  8  9 10  1  2  3  4  
 5  6  7  8  9 10
 
 my.data$sample
 
  [1]   50   50   50   50   50   50   50   50   50   50  250  250  250  250  
 250  250  250  250  250  250 1000 1000 1000 1000 1000 1000 1000 1000
 
 [29] 1000 1000
 
 my.data$factor.a
 
  [1] 0.895 0.811 0.685 0.777 0.600 0.466 0.446 0.392 0.256 0.198 0.136 0.121 
 0.875 0.777 0.685 0.626 0.550 0.466 0.384 0.330 0.060 0.138 0.065
 
 [24] 0.034 0.931 0.124 0.060 0.028 0.017 0.014
 
 plot(my.data$Region[my.data$sample==50],my.data$factor.a[my.data$sample==50],col=4,type=“l”,xlab=“Region”,ylab=“factor)
 
 Error: unexpected input in 
 plot(my.data$Region[my.data$sample==50],my.data$factor.a[my.data$sample==50],col=4,type=�”
 
 I’m really naive, right?
 
 Best,
 
 RO
 
 Atenciosamente,
 Rosa Oliveira
 
 -- 
 
 
 smile.jpg
 
 Rosa Celeste dos Santos Oliveira, 
 
 E-mail: rosit...@gmail.com
 Tlm: +351 939355143 
 Linkedin: https://pt.linkedin.com/in/rosacsoliveira 
 [https://pt.linkedin.com/in/rosacsoliveira]
 
 
 Many admire, few know
 Hippocrates
 
 On 10 Jun 2015, at 18:10, Don McKenzie d...@u.washington.edu wrote:
 
 For a legend, try (untested)
 
 legend(0.15,0.9,c(factora,factorb,factorc),col=c(4,2,3),lty=1)
 
 If it overlaps data points move the first two arguments (0.15 and 0.9) 
 around, or change the “ylim” argument in the plot() to ~1.2.
 
 to avoid clutter, put the line-types information in the figure caption (IMO)
 
 On Jun 10, 2015, at 10:03 AM, Don McKenzie d...@u.washington.edu wrote:
 
 On Jun 10, 2015, at 9:08 AM, Rosa Oliveira rosit...@gmail.com wrote:
 
 Dear All,
 
 I attach my data.
 
 Dear Jim, 
 
 when I run your code (even the one you send me, not in my data), I get: 
 
 Don't know how to automatically pick scale for object of type function. 
 Defaulting to continuous
 
 Error in data.frame(x = c(0.1, 0.2, 0.1, 0.2, 0.1, 0.2, 0.1, 0.2, 0.1,  : 
 
   arguments imply differing number of rows: 24, 0
 
 Dear Don,
 
 It’s meant that I will have 12 lines: 
 
 3 factors - lines colors
 
 with 3 different values of “sample” for each - line types
 
 [Three colors, one for each factor,
 and  three line types (lty=1,2,3), one for eachvalue of “sample - preferable 
 dash, thin and thick).
 
 in the X - I should have region (because I have 10 regions)
 
 for each region I have the outcome of 3 different treatments (factor)
 
 for each region and each treatment I have 3 different sample size.
 
 But in your original post you had 4 sample sizes: 10,20,30,40.
 
 I need to “see” the the influence of the region in the treatment outcome for 
 each sample size.
 
 So, at the end I should have 9 lines
 
 3 red (1 dash, 1 thin, 1 thick) - concerning factor a (dash for sample size 
 50, thin for sample size 250 and thick for sample size 1000)
 
 3 blue (1 dash, 1 thin, 1 thick) - concerning factor b (dash for sample size 
 50, thin for sample size 250 and thick for sample size 1000)
 
 3 green (1 dash, 1 thin, 1 thick) - concerning factor c (dash for sample size 
 50, thin for sample size 250 and thick for sample size 1000)
 
 Hope this time is clear.
 
 I also though about doing 3 different graphs, each one for 1 different sample 
 size, and in that case I should have 3 graphs each

Re: [R] graphs, need urgent help (deadline :( )

2015-06-11 Thread Jim Lemon
Rosa Oliveira wrote:

 Dear Jim,

 when I run your code (even the one you send me, not in my data), I get:

 Don't know how to automatically pick scale for object of type function. 
 Defaulting to continuous
 Error in data.frame(x = c(0.1, 0.2, 0.1, 0.2, 0.1, 0.2, 0.1, 0.2, 0.1,  :
  arguments imply differing number of rows: 24, 0

Well, let's agree on the data first. Using your original dataset:

my.data-read.table(text=region sample factora factorb factorc
 0.1  10  0.895   0.903   0.378
 0.2  10  0.811   0.865   0.688
 0.1  20  0.735   0.966   0.611
 0.2  20  0.777   0.732   0.653
 0.1  30  0.600   0.778   0.694
 0.2  30  0.466   174.592 0.461
 0.1  40  0.446   0.432   0.693
 0.2  40  0.392   0.294   0.686,header=TRUE)
library(plotrix)
par(tcl=-0.1)
gap.plot(x=rep(seq(10,45,by=5),3),
 y=unlist(my.data[,c(factora,factorb,factorc)]),
 main=A plot of factorial mystery,
 gap=c(1.1,174),ylim=c(0,175),ylab=factor score,xlab=Group,
 xticlab=c( \n0.1\n10, \n0.2\n10, \n0.1\n20, \n0.2\n20,
   \n0.1\n30, \n0.2\n30, \n0.1\n40, \n0.2\n40),
 ytics=c(0,0.5,1,174.59),pch=rep(1:3,each=8),col=rep(c(4,2,3),each=8))
mtext(c(Region,Sample),side=1,at=6,line=c(0,1))
lines(seq(10,45,by=5),my.data$factora,col=4)
lines(seq(10,45,by=5),my.data$factorb[c(1:5,NA,7,8)],col=2)
lines(seq(10,45,by=5),my.data$factorc,col=3)
legend(18,1.8,c(factora,factorb,factorc),pch=1:3,col=c(4,2,3))

This produces a plot, and I realize that it is not the one you
describe. As before, if you can let us know what is wrong with it,
maybe we can fix it.

Jim

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] graphs, need urgent help (deadline :( )

2015-06-10 Thread Jim Lemon
Hi Rosa,
Like Don, I can't work out what you want and I don't even have the
picture. For example, your specification of color and line type leaves
only one point for each color and line type, and the line from one
point to the same point is not going to show up. Here is a possibility
that may lead (eventually) to a solution.

library(plotrix)
par(tcl=-0.1)
gap.plot(x=rep(seq(10,45,by=5),3),
 y=unlist(my.data[,c(factora,factorb,factorc)]),
 main=A plot of factorial mystery,
 gap=c(1.1,174),ylim=c(0,175),ylab=factor score,xlab=Group,
 xticlab=c( \n0.1\n10, \n0.2\n10, \n0.1\n20, \n0.2\n20,
   \n0.1\n30, \n0.2\n30, \n0.1\n40, \n0.2\n40),
 ytics=c(0,0.5,1,174.59),pch=rep(1:3,each=8),col=rep(c(4,2,3),each=8))
mtext(c(Region,Sample),side=1,at=6,line=c(0,1))
lines(seq(10,45,by=5),my.data$factora,col=4)
lines(seq(10,45,by=5),my.data$factorb[c(1:5,NA,7,8)],col=2)
lines(seq(10,45,by=5),my.data$factorc,col=3)

Jim


On Wed, Jun 10, 2015 at 10:53 AM, Rosa Oliveira rosit...@gmail.com wrote:
 Dear Don and all,

 I’ve read the tutorial and tried several codes before posting :)
 I’m really naive.



 what I was trying to :  is something like the graph in the picture I drawee.




 Is it more clear now?

 Atenciosamente,
 Rosa Oliveira

 --
 


 Rosa Celeste dos Santos Oliveira,

 E-mail: rosit...@gmail.com mailto:rosit...@gmail.com
 Tlm: +351 939355143
 Linkedin: https://pt.linkedin.com/in/rosacsoliveira 
 https://pt.linkedin.com/in/rosacsoliveira
 
 Many admire, few know
 Hippocrates

 On 09 Jun 2015, at 19:23, Don McKenzie d...@u.washington.edu 
 mailto:d...@u.washington.edu wrote:

 The answer lies in learning to use the help (and knowing where to start).  
 Did you look at the tutorial that comes with the R installation?

 ?plot
 ?lines

 ?par

 In the last, look for the descriptions of “col” and “lty”.

 Using plot() and lines(), and subsetting the four unique values of “sample”, 
 you can create your lines.

 Here is a crude start, assuming your columns are part of a data frame called 
 “my.data”.   Untested...

 plot(my.data$region[my.data$sample==10],my.data$factora[my.data$sample==10],col=4)
  # blue line, not dashed
 .
 .
 .
 lines(my.data$region[my.data$sample==20],my.data$factorb[my.data$sample==20],col=2,lty=2)
# red dashed line


 On Jun 9, 2015, at 10:36 AM, Rosa Oliveira rosit...@gmail.com 
 mailto:rosit...@gmail.com wrote:

 Hi,

 another naive question (i’m pretty sure :( )


 I’m trying to plot a multiple line graph:

 region  sample  factora  factorb
 factorc
 0.1  10  0.895   0.903   0.378
 0.2  10  0.811   0.865   0.688
 0.1  20  0.735   0.966   0.611
 0.2  20  0.777   0.732   0.653
 0.1  30  0.600   0.778   0.694
 0.2  30  0.466   174.592 0.461
 0.1  40  0.446   0.432   0.693
 0.2  40  0.392   0.294   0.686



 The first column should be the independent variable, the second should 
 compute a bold line for sample(10) and dash line for sample 20.

 What about the other two values of “sample”?

 The others variables are outcomes for each of the first scenarios, and so 
 it should: the 3rd, 4th and 5th columns should be blue, red and green 
 respectively.


 Resume :)

 I should have a graph, in the x-axe should have the region and in the y 
 axe, the factor.
 Lines:
  1 - blue and bold for region 0.1, sample 10 and factor a
  2 - blue and dash for region 0.2, sample 10 and factor a
  3 - red and bold for region 0.1, sample 10 and factor b
  4 - red and dash for region 0.2, sample 10 and factor b
  5 - green and bold for region 0.1, sample 10 and factor c
  6 - green and dash for region 0.2, sample 10 and factor c

 Not consistent with what you said above. These are no longer lines, but 
 points.

 nonetheless the independent variable is nominal, I should plot a line graph.

 Can anyone help me please?
 I have my file as a cvs file, so I first read that file (that I know how to 
 do :)).

 But I have it in that format.

 Best,
 RO



 Atenciosamente,
 Rosa Oliveira

 --
 


 Rosa Celeste dos Santos Oliveira,

 E-mail: rosit...@gmail.com mailto:rosit...@gmail.com
 Tlm: +351 939355143
 Linkedin: https://pt.linkedin.com/in/rosacsoliveira 
 https://pt.linkedin.com/in/rosacsoliveira
 
 Many admire, few know
 Hippocrates


  [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailto:R-help@r-project.org mailing list -- To 
 UNSUBSCRIBE and more, see
 https://stat.ethz.ch/mailman/listinfo/r-help 
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide 
 http://www.R-project.org/posting-guide.html 
 

Re: [R] graphs, need urgent help (deadline :( )

2015-06-10 Thread John Kane
Hi Jim,

I was looking at that last night and had the same problem of visualizing what 
Rosa needed.  

Hi Rosa
This is nothing like what you wanted and I really don't understand your data 
but would something like this work as a substitute or am I completely lost?


dat1  -  structure(list(region = c(0.1, 0.2, 0.1, 0.2, 0.1, 0.2, 0.1, 
0.2), sample = c(10L, 10L, 20L, 20L, 30L, 30L, 40L, 40L), factora = c(0.895, 
0.811, 0.735, 0.777, 0.6, 0.466, 0.446, 0.392), factorb = c(0.903, 
0.865, 0.966, 0.732, 0.778, 0.592, 0.432, 0.294), factorc = c(0.37, 
0.688, 0.611, 0.653, 0.694, 0.461, 0.693, 0.686)), .Names = c(region, 
sample, factora, factorb, factorc), class = data.frame, row.names = 
c(NA, 
-8L))


mdat1  -   melt(dat1, id.var = c(region, sample),
variable.name = factor,
value.name = value)
str(mdat1)
 
ggplot(mdat1, aes(region, value, colour = factor)) +
geom_line() + facet_grid(sample ~ .)

John Kane
Kingston ON Canada


 -Original Message-
 From: drjimle...@gmail.com
 Sent: Wed, 10 Jun 2015 20:51:52 +1000
 To: rosit...@gmail.com
 Subject: Re: [R] graphs, need urgent help (deadline :( )
 
 Hi Rosa,
 Like Don, I can't work out what you want and I don't even have the
 picture. For example, your specification of color and line type leaves
 only one point for each color and line type, and the line from one
 point to the same point is not going to show up. Here is a possibility
 that may lead (eventually) to a solution.
 
 library(plotrix)
 par(tcl=-0.1)
 gap.plot(x=rep(seq(10,45,by=5),3),
  y=unlist(my.data[,c(factora,factorb,factorc)]),
  main=A plot of factorial mystery,
  gap=c(1.1,174),ylim=c(0,175),ylab=factor score,xlab=Group,
  xticlab=c( \n0.1\n10, \n0.2\n10, \n0.1\n20, \n0.2\n20,
\n0.1\n30, \n0.2\n30, \n0.1\n40, \n0.2\n40),
  ytics=c(0,0.5,1,174.59),pch=rep(1:3,each=8),col=rep(c(4,2,3),each=8))
 mtext(c(Region,Sample),side=1,at=6,line=c(0,1))
 lines(seq(10,45,by=5),my.data$factora,col=4)
 lines(seq(10,45,by=5),my.data$factorb[c(1:5,NA,7,8)],col=2)
 lines(seq(10,45,by=5),my.data$factorc,col=3)
 
 Jim
 
 
 On Wed, Jun 10, 2015 at 10:53 AM, Rosa Oliveira rosit...@gmail.com
 wrote:
 Dear Don and all,
 
 I’ve read the tutorial and tried several codes before posting :)
 I’m really naive.
 
 
 
 what I was trying to :  is something like the graph in the picture I
 drawee.
 
 
 
 
 Is it more clear now?
 
 Atenciosamente,
 Rosa Oliveira
 
 --
 
 
 
 Rosa Celeste dos Santos Oliveira,
 
 E-mail: rosit...@gmail.com mailto:rosit...@gmail.com
 Tlm: +351 939355143
 Linkedin: https://pt.linkedin.com/in/rosacsoliveira
 https://pt.linkedin.com/in/rosacsoliveira
 
 Many admire, few know
 Hippocrates
 
 On 09 Jun 2015, at 19:23, Don McKenzie d...@u.washington.edu
 mailto:d...@u.washington.edu wrote:
 
 The answer lies in learning to use the help (and knowing where to
 start).  Did you look at the tutorial that comes with the R
 installation?
 
 ?plot
 ?lines
 
 ?par
 
 In the last, look for the descriptions of “col” and “lty”.
 
 Using plot() and lines(), and subsetting the four unique values of
 “sample”, you can create your lines.
 
 Here is a crude start, assuming your columns are part of a data frame
 called “my.data”.   Untested...
 
plot(my.data$region[my.data$sample==10],my.data$factora[my.data$sample==10],col=4)
 # blue line, not dashed
 .
 .
 .
lines(my.data$region[my.data$sample==20],my.data$factorb[my.data$sample==20],col=2,lty=2)
 # red dashed line
 
 
 On Jun 9, 2015, at 10:36 AM, Rosa Oliveira rosit...@gmail.com
 mailto:rosit...@gmail.com wrote:
 
 Hi,
 
 another naive question (i’m pretty sure :( )
 
 
 I’m trying to plot a multiple line graph:
 
 region  sample  factora  factorb
 factorc
 0.1  10  0.895   0.903   0.378
 0.2  10  0.811   0.865   0.688
 0.1  20  0.735   0.966   0.611
 0.2  20  0.777   0.732   0.653
 0.1  30  0.600   0.778   0.694
 0.2  30  0.466   174.592 0.461
 0.1  40  0.446   0.432   0.693
 0.2  40  0.392   0.294   0.686
 
 
 
 The first column should be the independent variable, the second should
 compute a bold line for sample(10) and dash line for sample 20.
 
 What about the other two values of “sample”?
 
 The others variables are outcomes for each of the first scenarios, and
 so it should: the 3rd, 4th and 5th columns should be blue, red and
 green respectively.
 
 
 Resume :)
 
 I should have a graph, in the x-axe should have the region and in the
 y axe, the factor.
 Lines:
  1 - blue and bold for region 0.1, sample 10 and factor a
  2 - blue and dash for region 0.2, sample 10 and factor a
  3 - red and bold for region 0.1, sample 10 and factor b
  4 - red and dash for region 0.2, sample 10 and factor b
  5 - green and bold for region 0.1, sample 10 and factor c
  6

Re: [R] graphs, need urgent help (deadline :( )

2015-06-10 Thread Don McKenzie
The answer lies in learning to use the help (and knowing where to start).  Did 
you look at the tutorial that comes with the R installation?

?plot
?lines

?par   

In the last, look for the descriptions of “col” and “lty”.

Using plot() and lines(), and subsetting the four unique values of “sample”, 
you can create your lines.

Here is a crude start, assuming your columns are part of a data frame called 
“my.data”.   Untested...

plot(my.data$region[my.data$sample==10],my.data$factora[my.data$sample==10],col=4)
 # blue line, not dashed
.
.
.
lines(my.data$region[my.data$sample==20],my.data$factorb[my.data$sample==20],col=2,lty=2)
   # red dashed line


 On Jun 9, 2015, at 10:36 AM, Rosa Oliveira rosit...@gmail.com wrote:
 
 Hi,
 
 another naive question (i’m pretty sure :( )
 
 
 I’m trying to plot a multiple line graph:
 
 region   sample  factora  factorb
 factorc
 0.1   10  0.895   0.903   0.378
 0.2   10  0.811   0.865   0.688
 0.1   20  0.735   0.966   0.611
 0.2   20  0.777   0.732   0.653
 0.1   30  0.600   0.778   0.694
 0.2   30  0.466   174.592 0.461
 0.1   40  0.446   0.432   0.693
 0.2   40  0.392   0.294   0.686
 
 
 
 The first column should be the independent variable, the second should 
 compute a bold line for sample(10) and dash line for sample 20.

What about the other two values of “sample”?  

 The others variables are outcomes for each of the first scenarios, and so it 
 should: the 3rd, 4th and 5th columns should be blue, red and green 
 respectively. 
 
 
 Resume :)
 
 I should have a graph, in the x-axe should have the region and in the y axe, 
 the factor.
 Lines:
   1 - blue and bold for region 0.1, sample 10 and factor a
   2 - blue and dash for region 0.2, sample 10 and factor a
   3 - red and bold for region 0.1, sample 10 and factor b
   4 - red and dash for region 0.2, sample 10 and factor b
   5 - green and bold for region 0.1, sample 10 and factor c
   6 - green and dash for region 0.2, sample 10 and factor c

Not consistent with what you said above. These are no longer lines, but points.
 
 nonetheless the independent variable is nominal, I should plot a line graph.
 
 Can anyone help me please?
 I have my file as a cvs file, so I first read that file (that I know how to 
 do :)).
 
 But I have it in that format.
 
 Best,
 RO
 
 
 
 Atenciosamente,
 Rosa Oliveira
 
 -- 
 
 
 
 Rosa Celeste dos Santos Oliveira, 
 
 E-mail: rosit...@gmail.com
 Tlm: +351 939355143 
 Linkedin: https://pt.linkedin.com/in/rosacsoliveira
 
 Many admire, few know
 Hippocrates
 
 
   [[alternative HTML version deleted]]
 
 __
 R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.



__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Re: [R] graphs, need urgent help (deadline :( )

2015-06-10 Thread Rosa Oliveira
Dear Don and all,

I’ve read the tutorial and tried several codes before posting :)
I’m really naive.



what I was trying to :  is something like the graph in the picture I drawee.




Is it more clear now? 

Atenciosamente,
Rosa Oliveira

-- 



Rosa Celeste dos Santos Oliveira, 

E-mail: rosit...@gmail.com mailto:rosit...@gmail.com
Tlm: +351 939355143 
Linkedin: https://pt.linkedin.com/in/rosacsoliveira 
https://pt.linkedin.com/in/rosacsoliveira

Many admire, few know
Hippocrates

 On 09 Jun 2015, at 19:23, Don McKenzie d...@u.washington.edu 
 mailto:d...@u.washington.edu wrote:
 
 The answer lies in learning to use the help (and knowing where to start).  
 Did you look at the tutorial that comes with the R installation?
 
 ?plot
 ?lines
 
 ?par   
 
 In the last, look for the descriptions of “col” and “lty”.
 
 Using plot() and lines(), and subsetting the four unique values of “sample”, 
 you can create your lines.
 
 Here is a crude start, assuming your columns are part of a data frame called 
 “my.data”.   Untested...
 
 plot(my.data$region[my.data$sample==10],my.data$factora[my.data$sample==10],col=4)
  # blue line, not dashed
 .
 .
 .
 lines(my.data$region[my.data$sample==20],my.data$factorb[my.data$sample==20],col=2,lty=2)
# red dashed line
 
 
 On Jun 9, 2015, at 10:36 AM, Rosa Oliveira rosit...@gmail.com 
 mailto:rosit...@gmail.com wrote:
 
 Hi,
 
 another naive question (i’m pretty sure :( )
 
 
 I’m trying to plot a multiple line graph:
 
 region  sample  factora  factorb
 factorc
 0.1  10  0.895   0.903   0.378
 0.2  10  0.811   0.865   0.688
 0.1  20  0.735   0.966   0.611
 0.2  20  0.777   0.732   0.653
 0.1  30  0.600   0.778   0.694
 0.2  30  0.466   174.592 0.461
 0.1  40  0.446   0.432   0.693
 0.2  40  0.392   0.294   0.686
 
 
 
 The first column should be the independent variable, the second should 
 compute a bold line for sample(10) and dash line for sample 20.
 
 What about the other two values of “sample”?  
 
 The others variables are outcomes for each of the first scenarios, and so it 
 should: the 3rd, 4th and 5th columns should be blue, red and green 
 respectively. 
 
 
 Resume :)
 
 I should have a graph, in the x-axe should have the region and in the y axe, 
 the factor.
 Lines:
  1 - blue and bold for region 0.1, sample 10 and factor a
  2 - blue and dash for region 0.2, sample 10 and factor a
  3 - red and bold for region 0.1, sample 10 and factor b
  4 - red and dash for region 0.2, sample 10 and factor b
  5 - green and bold for region 0.1, sample 10 and factor c
  6 - green and dash for region 0.2, sample 10 and factor c
 
 Not consistent with what you said above. These are no longer lines, but 
 points.
 
 nonetheless the independent variable is nominal, I should plot a line graph.
 
 Can anyone help me please?
 I have my file as a cvs file, so I first read that file (that I know how to 
 do :)).
 
 But I have it in that format.
 
 Best,
 RO
 
 
 
 Atenciosamente,
 Rosa Oliveira
 
 -- 
 
 
 
 Rosa Celeste dos Santos Oliveira, 
 
 E-mail: rosit...@gmail.com mailto:rosit...@gmail.com
 Tlm: +351 939355143 
 Linkedin: https://pt.linkedin.com/in/rosacsoliveira 
 https://pt.linkedin.com/in/rosacsoliveira
 
 Many admire, few know
 Hippocrates
 
 
  [[alternative HTML version deleted]]
 
 __
 R-help@r-project.org mailto:R-help@r-project.org mailing list -- To 
 UNSUBSCRIBE and more, see
 https://stat.ethz.ch/mailman/listinfo/r-help 
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html 
 http://www.r-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.
 
 PastedGraphic-1.tiff
 

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Re: [R] graphs, need urgent help [from Rosa Oliveira]

2015-06-10 Thread Don McKenzie
The R function plot() will draw the first line and the two axes.  You need to 
tell it which subsample of your data to plot, as in my example below.
So start with those two observations for which “sample” = 10.  But if you want 
separate lines for each unique value of “sample”, your lines will connect
only two data points, because you have only two instances of each of those 
unique values, unlike the lines in your hand-drawn graph.

Another issue is that you have a huge outlier (value very much larger than the 
others) in the 6th row of “factorb”.  Is this an error?  If not, your other 
lines will be indistinguishable when you try to plot everything.

Part of the reason no one else has responded may be that it appears that you 
are confused about your own data in a way that makes it very difficult for 
us to help you.  Can you get some basic advice from someone local?  I or 
someone else on the list could give you the code line-by-line that we THINK you 
need,
but it could be wrong, given the inconsistencies in what you have shown us, and 
that would make everything worse.

 plot(my.data$region[my.data$sample==10],my.data$factora[my.data$sample==10],col=4)
  # blue line, not dashed

Did you try plotting just this line?  What happened?


 On Jun 9, 2015, at 5:53 PM, Rosa Oliveira rosit...@gmail.com wrote:
 
 Dear Don and all,
 
 I’ve read the tutorial and tried several codes before posting :)
 I’m really naive.
 
 
 
 what I was trying to :  is something like the graph in the picture I drawee.
 
 
 FullSizeRender.jpg
 
 Is it more clear now? 
 
 Atenciosamente,
 Rosa Oliveira
 
 -- 
 
  
 smile.jpg
 Rosa Celeste dos Santos Oliveira, 
 
 E-mail: rosit...@gmail.com mailto:rosit...@gmail.com
 Tlm: +351 939355143 
 Linkedin: https://pt.linkedin.com/in/rosacsoliveira 
 https://pt.linkedin.com/in/rosacsoliveira
 
 Many admire, few know
 Hippocrates
 
 On 09 Jun 2015, at 19:23, Don McKenzie d...@u.washington.edu 
 mailto:d...@u.washington.edu wrote:
 
 The answer lies in learning to use the help (and knowing where to start).  
 Did you look at the tutorial that comes with the R installation?
 
 ?plot
 ?lines
 
 ?par   
 
 In the last, look for the descriptions of “col” and “lty”.
 
 Using plot() and lines(), and subsetting the four unique values of “sample”, 
 you can create your lines.
 
 Here is a crude start, assuming your columns are part of a data frame called 
 “my.data”.   Untested...
 
 plot(my.data$region[my.data$sample==10],my.data$factora[my.data$sample==10],col=4)
  # blue line, not dashed

Did you try plotting just this line?  What happened?

 .
 .
 .
 lines(my.data$region[my.data$sample==20],my.data$factorb[my.data$sample==20],col=2,lty=2)
# red dashed line
 
 
 On Jun 9, 2015, at 10:36 AM, Rosa Oliveira rosit...@gmail.com 
 mailto:rosit...@gmail.com wrote:
 
 Hi,
 
 another naive question (i’m pretty sure :( )
 
 
 I’m trying to plot a multiple line graph:
 
 region sample  factora  factorb
 factorc
 0.1 10  0.895   0.903   0.378
 0.2 10  0.811   0.865   0.688
 0.1 20  0.735   0.966   0.611
 0.2 20  0.777   0.732   0.653
 0.1 30  0.600   0.778   0.694
 0.2 30  0.466   174.592 0.461
 0.1 40  0.446   0.432   0.693
 0.2 40  0.392   0.294   0.686
 
 
 
 The first column should be the independent variable, the second should 
 compute a bold line for sample(10) and dash line for sample 20.
 
 What about the other two values of “sample”?  
 
 The others variables are outcomes for each of the first scenarios, and so 
 it should: the 3rd, 4th and 5th columns should be blue, red and green 
 respectively. 
 
 
 Resume :)
 
 I should have a graph, in the x-axe should have the region and in the y 
 axe, the factor.
 Lines:
 1 - blue and bold for region 0.1, sample 10 and factor a
 2 - blue and dash for region 0.2, sample 10 and factor a
 3 - red and bold for region 0.1, sample 10 and factor b
 4 - red and dash for region 0.2, sample 10 and factor b
 5 - green and bold for region 0.1, sample 10 and factor c
 6 - green and dash for region 0.2, sample 10 and factor c
 
 Not consistent with what you said above. These are no longer lines, but 
 points.
 
 nonetheless the independent variable is nominal, I should plot a line graph.
 
 Can anyone help me please?
 I have my file as a cvs file, so I first read that file (that I know how to 
 do :)).
 
 But I have it in that format.
 
 Best,
 RO
 
 
 
 Atenciosamente,
 Rosa Oliveira
 
 -- 
 
 
 
 Rosa Celeste dos Santos Oliveira, 
 
 E-mail: rosit...@gmail.com mailto:rosit...@gmail.com
 Tlm: +351 939355143 
 Linkedin: https://pt.linkedin.com/in/rosacsoliveira 
 https://pt.linkedin.com/in/rosacsoliveira
 

Re: [R] graphs, need urgent help [from Rosa Oliveira]

2015-06-10 Thread Rosa Oliveira
Dear Don,

I done the plot and the lines, and it’s  fine.
I’ll have 10 values on sample. It’s generating (on simulation), that’s why that 
huge outlier, and the other missing points.

The graph I’ve done, is just an example, just to illustrate what I have to get, 
but off course with 10 points in sample, and all the other specificityies.

Best,
RO

Atenciosamente,
Rosa Oliveira

-- 



Rosa Celeste dos Santos Oliveira, 

E-mail: rosit...@gmail.com
Tlm: +351 939355143 
Linkedin: https://pt.linkedin.com/in/rosacsoliveira

Many admire, few know
Hippocrates

 On 10 Jun 2015, at 02:41, Don McKenzie d...@u.washington.edu wrote:
 
 The R function plot() will draw the first line and the two axes.  You need to 
 tell it which subsample of your data to plot, as in my example below.
 So start with those two observations for which “sample” = 10.  But if you 
 want separate lines for each unique value of “sample”, your lines will connect
 only two data points, because you have only two instances of each of those 
 unique values, unlike the lines in your hand-drawn graph.
 
 Another issue is that you have a huge outlier (value very much larger than 
 the others) in the 6th row of “factorb”.  Is this an error?  If not, your 
 other lines will be indistinguishable when you try to plot everything.
 
 Part of the reason no one else has responded may be that it appears that you 
 are confused about your own data in a way that makes it very difficult for 
 us to help you.  Can you get some basic advice from someone local?  I or 
 someone else on the list could give you the code line-by-line that we THINK 
 you need,
 but it could be wrong, given the inconsistencies in what you have shown us, 
 and that would make everything worse.
 
 plot(my.data$region[my.data$sample==10],my.data$factora[my.data$sample==10],col=4)
  # blue line, not dashed
 
 Did you try plotting just this line?  What happened?
 
 
 On Jun 9, 2015, at 5:53 PM, Rosa Oliveira rosit...@gmail.com 
 mailto:rosit...@gmail.com wrote:
 
 Dear Don and all,
 
 I’ve read the tutorial and tried several codes before posting :)
 I’m really naive.
 
 
 
 what I was trying to :  is something like the graph in the picture I drawee.
 
 
 FullSizeRender.jpg
 
 Is it more clear now? 
 
 Atenciosamente,
 Rosa Oliveira
 
 -- 
 
  
 smile.jpg
 Rosa Celeste dos Santos Oliveira, 
 
 E-mail: rosit...@gmail.com mailto:rosit...@gmail.com
 Tlm: +351 939355143 
 Linkedin: https://pt.linkedin.com/in/rosacsoliveira 
 https://pt.linkedin.com/in/rosacsoliveira
 
 Many admire, few know
 Hippocrates
 
 On 09 Jun 2015, at 19:23, Don McKenzie d...@u.washington.edu 
 mailto:d...@u.washington.edu wrote:
 
 The answer lies in learning to use the help (and knowing where to start).  
 Did you look at the tutorial that comes with the R installation?
 
 ?plot
 ?lines
 
 ?par   
 
 In the last, look for the descriptions of “col” and “lty”.
 
 Using plot() and lines(), and subsetting the four unique values of 
 “sample”, you can create your lines.
 
 Here is a crude start, assuming your columns are part of a data frame 
 called “my.data”.   Untested...
 
 plot(my.data$region[my.data$sample==10],my.data$factora[my.data$sample==10],col=4)
  # blue line, not dashed
 
 Did you try plotting just this line?  What happened?
 
 .
 .
 .
 lines(my.data$region[my.data$sample==20],my.data$factorb[my.data$sample==20],col=2,lty=2)
# red dashed line
 
 
 On Jun 9, 2015, at 10:36 AM, Rosa Oliveira rosit...@gmail.com 
 mailto:rosit...@gmail.com wrote:
 
 Hi,
 
 another naive question (i’m pretty sure :( )
 
 
 I’m trying to plot a multiple line graph:
 
 regionsample  factora  factorb
 factorc
 0.110  0.895   0.903   0.378
 0.210  0.811   0.865   0.688
 0.120  0.735   0.966   0.611
 0.220  0.777   0.732   0.653
 0.130  0.600   0.778   0.694
 0.230  0.466   174.592 0.461
 0.140  0.446   0.432   0.693
 0.240  0.392   0.294   0.686
 
 
 
 The first column should be the independent variable, the second should 
 compute a bold line for sample(10) and dash line for sample 20.
 
 What about the other two values of “sample”?  
 
 The others variables are outcomes for each of the first scenarios, and so 
 it should: the 3rd, 4th and 5th columns should be blue, red and green 
 respectively. 
 
 
 Resume :)
 
 I should have a graph, in the x-axe should have the region and in the y 
 axe, the factor.
 Lines:
1 - blue and bold for region 0.1, sample 10 and factor a
2 - blue and dash for region 0.2, sample 10 and factor a
3 - red and bold for region 0.1, sample 10 and factor 

Re: [R] graphs, need urgent help (deadline :( )

2015-06-10 Thread Don McKenzie
 “line”.  The lines will be misleading.  You also 
 could use 
 panel plots, but given your skill set (unless someone wants to spend a fair 
 bit of time with you), it’s probably best to stay as simple as possible.
 
 But given your original post (cleaned up)   # untested: apologies for any 
 typos
 
region  sample  factora  factorb
 factorc
0.1 10   0.895  0.903   
 0.378
0.2 10  0.8110.865  
  0.688
0.1 20  0.735   0.966   
 0.611
0.2 20   0.777   0.732  
  0.653
0.1 30  0.600   0.778   
 0.694
0.2 30   0.466   174.592
 0.461
0.1 40   0.446  0.432   
 0.693
0.2 40   0.392  0.294   
  0.686
 
 plot(my.data$region[my.data$sample==10],my.data$factora[my.data$sample==10],col=4,type=“l”,ylim=c(0,1),xlab=“region”,ylab=“factor)
 lines(my.data$region[my.data$sample==10],my.data$factorb[my.data$sample==10],col=2)
 lines(my.data$region[my.data$sample==10],my.data$factorc[my.data$sample==10],col=3)
 
 lines(my.data$region[my.data$sample==20],my.data$factora[my.data$sample==20],col=4,lty=2)
 lines(my.data$region[my.data$sample==20],my.data$factorb[my.data$sample==20],col=2,lty=2)
 lines(my.data$region[my.data$sample==20],my.data$factorc[my.data$sample==20],col=3,lty=2)
 
 #  Now do two more groups of 3, changing the parameter “lty” to 3 and then 4
 
 # Look at the syntax and note what changes and what stays constant. Do you 
 see how this works?
 # there will be what looks like a vertical line where sample = 30 and 
 factorb = 174.592.  Do you see why?
 
 # then you will need a legend
 
 Nonetheless I can’t do it :(
 
 best,
 RO
 
 
 
 Atenciosamente,
 Rosa Oliveira
 
 -- 
 
  
 smile.jpg
 Rosa Celeste dos Santos Oliveira, 
 
 E-mail: rosit...@gmail.com
 Tlm: +351 939355143 
 Linkedin: https://pt.linkedin.com/in/rosacsoliveira
 
 Many admire, few know
 Hippocrates
 
 On 10 Jun 2015, at 14:13, John Kane jrkrid...@inbox.com wrote:
 
 Hi Jim,
 
 I was looking at that last night and had the same problem of visualizing 
 what Rosa needed.  
 
 Hi Rosa
 This is nothing like what you wanted and I really don't understand your 
 data but would something like this work as a substitute or am I 
 completely lost?
 
 
 dat1  -  structure(list(region = c(0.1, 0.2, 0.1, 0.2, 0.1, 0.2, 0.1, 
 0.2), sample = c(10L, 10L, 20L, 20L, 30L, 30L, 40L, 40L), factora = 
 c(0.895, 
 0.811, 0.735, 0.777, 0.6, 0.466, 0.446, 0.392), factorb = c(0.903, 
 0.865, 0.966, 0.732, 0.778, 0.592, 0.432, 0.294), factorc = c(0.37, 
 0.688, 0.611, 0.653, 0.694, 0.461, 0.693, 0.686)), .Names = c(region, 
 sample, factora, factorb, factorc), class = data.frame, 
 row.names = c(NA, 
 -8L))
 
 
 mdat1  -   melt(dat1, id.var = c(region, sample),
variable.name = factor,
value.name = value)
 str(mdat1)
 
 ggplot(mdat1, aes(region, value, colour = factor)) +
geom_line() + facet_grid(sample ~ .)
 
 John Kane
 Kingston ON Canada
 
 
 -Original Message-
 From: drjimle...@gmail.com
 Sent: Wed, 10 Jun 2015 20:51:52 +1000
 To: rosit...@gmail.com
 Subject: Re: [R] graphs, need urgent help (deadline :( )
 
 Hi Rosa,
 Like Don, I can't work out what you want and I don't even have the
 picture. For example, your specification of color and line type leaves
 only one point for each color and line type, and the line from one
 point to the same point is not going to show up. Here is a possibility
 that may lead (eventually) to a solution.
 
 library(plotrix)
 par(tcl=-0.1)
 gap.plot(x=rep(seq(10,45,by=5),3),
 y=unlist(my.data[,c(factora,factorb,factorc)]),
 main=A plot of factorial mystery,
 gap=c(1.1,174),ylim=c(0,175),ylab=factor score,xlab=Group,
 xticlab=c( \n0.1\n10, \n0.2\n10, \n0.1\n20, \n0.2\n20,
   \n0.1\n30, \n0.2\n30, \n0.1\n40, \n0.2\n40),
 ytics=c(0,0.5,1,174.59),pch=rep(1:3,each=8),col=rep(c(4,2,3),each=8))
 mtext(c(Region,Sample),side=1,at=6,line=c(0,1))
 lines(seq(10,45,by=5),my.data$factora,col=4)
 lines(seq(10,45,by=5),my.data$factorb[c(1:5,NA,7,8)],col=2)
 lines(seq(10,45,by=5),my.data$factorc,col=3)
 
 Jim
 
 
 On Wed, Jun 10, 2015 at 10:53 AM, Rosa Oliveira rosit...@gmail.com
 wrote:
 Dear Don and all,
 
 I’ve read the tutorial and tried several codes before posting :)
 I’m really naive.
 
 
 
 what I was trying to :  is something like the graph in the picture I
 drawee.
 
 
 
 
 Is it more clear now

Re: [R] graphs, need urgent help (deadline :( )

2015-06-10 Thread Don McKenzie
 up)   # untested: apologies for any 
 typos
 
region  sample  factora  factorb
 factorc
0.1 10   0.895  0.903   
 0.378
0.2 10  0.8110.865  
  0.688
0.1 20  0.735   0.966   
 0.611
0.2 20   0.777   0.732  
  0.653
0.1 30  0.600   0.778   
 0.694
0.2 30   0.466   174.592
 0.461
0.1 40   0.446  0.432   
 0.693
0.2 40   0.392  0.294   
  0.686
 
 
 plot(my.data$region[my.data$sample==10],my.data$factora[my.data$sample==10],col=4,type=“l”,ylim=c(0,1),xlab=“region”,ylab=“factor)
 lines(my.data$region[my.data$sample==10],my.data$factorb[my.data$sample==10],col=2)
 lines(my.data$region[my.data$sample==10],my.data$factorc[my.data$sample==10],col=3)
 
 lines(my.data$region[my.data$sample==20],my.data$factora[my.data$sample==20],col=4,lty=2)
 lines(my.data$region[my.data$sample==20],my.data$factorb[my.data$sample==20],col=2,lty=2)
 lines(my.data$region[my.data$sample==20],my.data$factorc[my.data$sample==20],col=3,lty=2)
 
 #  Now do two more groups of 3, changing the parameter “lty” to 3 and then 4
 
 
 # Look at the syntax and note what changes and what stays constant. Do you 
 see how this works?
 # there will be what looks like a vertical line where sample = 30 and 
 factorb = 174.592.  Do you see why?
 
 # then you will need a legend
 
 Nonetheless I can’t do it :(
 
 best,
 RO
 
 
 
 Atenciosamente,
 Rosa Oliveira
 
 -- 
 
  
 smile.jpg
 Rosa Celeste dos Santos Oliveira, 
 
 E-mail: rosit...@gmail.com mailto:rosit...@gmail.com
 Tlm: +351 939355143 
 Linkedin: https://pt.linkedin.com/in/rosacsoliveira 
 https://pt.linkedin.com/in/rosacsoliveira
 
 Many admire, few know
 Hippocrates
 
 On 10 Jun 2015, at 14:13, John Kane jrkrid...@inbox.com 
 mailto:jrkrid...@inbox.com wrote:
 
 Hi Jim,
 
 I was looking at that last night and had the same problem of visualizing 
 what Rosa needed.  
 
 Hi Rosa
 This is nothing like what you wanted and I really don't understand your 
 data but would something like this work as a substitute or am I 
 completely lost?
 
 
 dat1  -  structure(list(region = c(0.1, 0.2, 0.1, 0.2, 0.1, 0.2, 0.1, 
 0.2), sample = c(10L, 10L, 20L, 20L, 30L, 30L, 40L, 40L), factora = 
 c(0.895, 
 0.811, 0.735, 0.777, 0.6, 0.466, 0.446, 0.392), factorb = c(0.903, 
 0.865, 0.966, 0.732, 0.778, 0.592, 0.432, 0.294), factorc = c(0.37, 
 0.688, 0.611, 0.653, 0.694, 0.461, 0.693, 0.686)), .Names = c(region, 
 sample, factora, factorb, factorc), class = data.frame, 
 row.names = c(NA, 
 -8L))
 
 
 mdat1  -   melt(dat1, id.var = c(region, sample),
variable.name = factor,
value.name = value)
 str(mdat1)
 
 ggplot(mdat1, aes(region, value, colour = factor)) +
geom_line() + facet_grid(sample ~ .)
 
 John Kane
 Kingston ON Canada
 
 
 -Original Message-
 From: drjimle...@gmail.com mailto:drjimle...@gmail.com
 Sent: Wed, 10 Jun 2015 20:51:52 +1000
 To: rosit...@gmail.com mailto:rosit...@gmail.com
 Subject: Re: [R] graphs, need urgent help (deadline :( )
 
 Hi Rosa,
 Like Don, I can't work out what you want and I don't even have the
 picture. For example, your specification of color and line type leaves
 only one point for each color and line type, and the line from one
 point to the same point is not going to show up. Here is a possibility
 that may lead (eventually) to a solution.
 
 library(plotrix)
 par(tcl=-0.1)
 gap.plot(x=rep(seq(10,45,by=5),3),
 y=unlist(my.data[,c(factora,factorb,factorc)]),
 main=A plot of factorial mystery,
 gap=c(1.1,174),ylim=c(0,175),ylab=factor score,xlab=Group,
 xticlab=c( \n0.1\n10, \n0.2\n10, \n0.1\n20, \n0.2\n20,
   \n0.1\n30, \n0.2\n30, \n0.1\n40, \n0.2\n40),
 ytics=c(0,0.5,1,174.59),pch=rep(1:3,each=8),col=rep(c(4,2,3),each=8))
 mtext(c(Region,Sample),side=1,at=6,line=c(0,1))
 lines(seq(10,45,by=5),my.data$factora,col=4)
 lines(seq(10,45,by=5),my.data$factorb[c(1:5,NA,7,8)],col=2)
 lines(seq(10,45,by=5),my.data$factorc,col=3)
 
 Jim
 
 
 On Wed, Jun 10, 2015 at 10:53 AM, Rosa Oliveira rosit...@gmail.com 
 mailto:rosit...@gmail.com
 wrote:
 Dear Don and all,
 
 I’ve read the tutorial and tried several codes before posting :)
 I’m really naive.
 
 
 
 what I was trying to :  is something like the graph in the picture I
 drawee.
 
 
 
 
 Is it more clear now?
 
 Atenciosamente,
 Rosa Oliveira

Re: [R] graphs, need urgent help (deadline :( )

2015-06-10 Thread Rosa Oliveira
Dear All,


I attach my data.

Dear Jim, 

when I run your code (even the one you send me, not in my data), I get: 

Don't know how to automatically pick scale for object of type function. 
Defaulting to continuous
Error in data.frame(x = c(0.1, 0.2, 0.1, 0.2, 0.1, 0.2, 0.1, 0.2, 0.1,  : 
  arguments imply differing number of rows: 24, 0



Dear Don,

It’s meant that I will have 12 lines: 
3 factors - lines colors
with 3 different values of “sample” for each - line types


[Three colors, one for each factor,
and  three line types (lty=1,2,3), one for eachvalue of “sample - preferable 
dash, thin and thick).


in the X - I should have region (because I have 10 regions)
for each region I have the outcome of 3 different treatments (factor)
for each region and each treatment I have 3 different sample size.

I need to “see” the the influence of the region in the treatment outcome for 
each sample size.

So, at the end I should have 9 lines
3 red (1 dash, 1 thin, 1 thick) - concerning factor a (dash for sample size 50, 
thin for sample size 250 and thick for sample size 1000)
3 blue (1 dash, 1 thin, 1 thick) - concerning factor b (dash for sample size 
50, thin for sample size 250 and thick for sample size 1000)
3 green (1 dash, 1 thin, 1 thick) - concerning factor c (dash for sample size 
50, thin for sample size 250 and thick for sample size 1000)



Hope this time is clear.


I also though about doing 3 different graphs, each one for 1 different sample 
size, and in that case I should have 3 graphs each one with 3 lines
1 red to factor a, 1 blue to factor b and 1 green to factor c.

Do you all think is better?
Nonetheless I can’t do it :(

best,
RO



Atenciosamente,
Rosa Oliveira

-- 



Rosa Celeste dos Santos Oliveira, 

E-mail: rosit...@gmail.com
Tlm: +351 939355143 
Linkedin: https://pt.linkedin.com/in/rosacsoliveira

Many admire, few know
Hippocrates

 On 10 Jun 2015, at 14:13, John Kane jrkrid...@inbox.com wrote:
 
 Hi Jim,
 
 I was looking at that last night and had the same problem of visualizing what 
 Rosa needed.  
 
 Hi Rosa
 This is nothing like what you wanted and I really don't understand your data 
 but would something like this work as a substitute or am I completely lost?
 
 
 dat1  -  structure(list(region = c(0.1, 0.2, 0.1, 0.2, 0.1, 0.2, 0.1,
 0.2), sample = c(10L, 10L, 20L, 20L, 30L, 30L, 40L, 40L), factora = c(0.895, 
 0.811, 0.735, 0.777, 0.6, 0.466, 0.446, 0.392), factorb = c(0.903, 
 0.865, 0.966, 0.732, 0.778, 0.592, 0.432, 0.294), factorc = c(0.37, 
 0.688, 0.611, 0.653, 0.694, 0.461, 0.693, 0.686)), .Names = c(region,
 sample, factora, factorb, factorc), class = data.frame, row.names = 
 c(NA, 
 -8L))
 
 
 mdat1  -   melt(dat1, id.var = c(region, sample),
variable.name = factor,
value.name = value)
 str(mdat1)
 
 ggplot(mdat1, aes(region, value, colour = factor)) +
geom_line() + facet_grid(sample ~ .)
 
 John Kane
 Kingston ON Canada
 
 
 -Original Message-
 From: drjimle...@gmail.com
 Sent: Wed, 10 Jun 2015 20:51:52 +1000
 To: rosit...@gmail.com
 Subject: Re: [R] graphs, need urgent help (deadline :( )
 
 Hi Rosa,
 Like Don, I can't work out what you want and I don't even have the
 picture. For example, your specification of color and line type leaves
 only one point for each color and line type, and the line from one
 point to the same point is not going to show up. Here is a possibility
 that may lead (eventually) to a solution.
 
 library(plotrix)
 par(tcl=-0.1)
 gap.plot(x=rep(seq(10,45,by=5),3),
 y=unlist(my.data[,c(factora,factorb,factorc)]),
 main=A plot of factorial mystery,
 gap=c(1.1,174),ylim=c(0,175),ylab=factor score,xlab=Group,
 xticlab=c( \n0.1\n10, \n0.2\n10, \n0.1\n20, \n0.2\n20,
   \n0.1\n30, \n0.2\n30, \n0.1\n40, \n0.2\n40),
 ytics=c(0,0.5,1,174.59),pch=rep(1:3,each=8),col=rep(c(4,2,3),each=8))
 mtext(c(Region,Sample),side=1,at=6,line=c(0,1))
 lines(seq(10,45,by=5),my.data$factora,col=4)
 lines(seq(10,45,by=5),my.data$factorb[c(1:5,NA,7,8)],col=2)
 lines(seq(10,45,by=5),my.data$factorc,col=3)
 
 Jim
 
 
 On Wed, Jun 10, 2015 at 10:53 AM, Rosa Oliveira rosit...@gmail.com
 wrote:
 Dear Don and all,
 
 I’ve read the tutorial and tried several codes before posting :)
 I’m really naive.
 
 
 
 what I was trying to :  is something like the graph in the picture I
 drawee.
 
 
 
 
 Is it more clear now?
 
 Atenciosamente,
 Rosa Oliveira
 
 --
 
 
 
 Rosa Celeste dos Santos Oliveira,
 
 E-mail: rosit...@gmail.com mailto:rosit...@gmail.com
 Tlm: +351 939355143
 Linkedin: https://pt.linkedin.com/in/rosacsoliveira
 https://pt.linkedin.com/in/rosacsoliveira
 
 Many admire, few know
 Hippocrates
 
 On 09 Jun

Re: [R] graphs, need urgent help (deadline :( )

2015-06-10 Thread Don McKenzie
   0.778   
 0.694
   0.2 30   0.466   174.592
 0.461
   0.1 40   0.446  0.432   
 0.693
   0.2 40   0.392  0.294   
  0.686
 
 
 plot(my.data$region[my.data$sample==10],my.data$factora[my.data$sample==10],col=4,type=“l”,ylim=c(0,1),xlab=“region”,ylab=“factor)
 lines(my.data$region[my.data$sample==10],my.data$factorb[my.data$sample==10],col=2)
 lines(my.data$region[my.data$sample==10],my.data$factorc[my.data$sample==10],col=3)
 
 lines(my.data$region[my.data$sample==20],my.data$factora[my.data$sample==20],col=4,lty=2)
 lines(my.data$region[my.data$sample==20],my.data$factorb[my.data$sample==20],col=2,lty=2)
 lines(my.data$region[my.data$sample==20],my.data$factorc[my.data$sample==20],col=3,lty=2)
 
 #  Now do two more groups of 3, changing the parameter “lty” to 3 and then 
 4
 
 
 # Look at the syntax and note what changes and what stays constant. Do you 
 see how this works?
 # there will be what looks like a vertical line where sample = 30 and 
 factorb = 174.592.  Do you see why?
 
 # then you will need a legend
 
 Nonetheless I can’t do it :(
 
 best,
 RO
 
 
 
 Atenciosamente,
 Rosa Oliveira
 
 -- 
 
  
 smile.jpg
 Rosa Celeste dos Santos Oliveira, 
 
 E-mail: rosit...@gmail.com mailto:rosit...@gmail.com
 Tlm: +351 939355143 
 Linkedin: https://pt.linkedin.com/in/rosacsoliveira 
 https://pt.linkedin.com/in/rosacsoliveira
 
 Many admire, few know
 Hippocrates
 
 On 10 Jun 2015, at 14:13, John Kane jrkrid...@inbox.com 
 mailto:jrkrid...@inbox.com wrote:
 
 Hi Jim,
 
 I was looking at that last night and had the same problem of visualizing 
 what Rosa needed.  
 
 Hi Rosa
 This is nothing like what you wanted and I really don't understand your 
 data but would something like this work as a substitute or am I 
 completely lost?
 
 
 dat1  -  structure(list(region = c(0.1, 0.2, 0.1, 0.2, 0.1, 0.2, 0.1, 
 0.2), sample = c(10L, 10L, 20L, 20L, 30L, 30L, 40L, 40L), factora = 
 c(0.895, 
 0.811, 0.735, 0.777, 0.6, 0.466, 0.446, 0.392), factorb = c(0.903, 
 0.865, 0.966, 0.732, 0.778, 0.592, 0.432, 0.294), factorc = c(0.37, 
 0.688, 0.611, 0.653, 0.694, 0.461, 0.693, 0.686)), .Names = c(region, 
 sample, factora, factorb, factorc), class = data.frame, 
 row.names = c(NA, 
 -8L))
 
 
 mdat1  -   melt(dat1, id.var = c(region, sample),
variable.name = factor,
value.name = value)
 str(mdat1)
 
 ggplot(mdat1, aes(region, value, colour = factor)) +
geom_line() + facet_grid(sample ~ .)
 
 John Kane
 Kingston ON Canada
 
 
 -Original Message-
 From: drjimle...@gmail.com mailto:drjimle...@gmail.com
 Sent: Wed, 10 Jun 2015 20:51:52 +1000
 To: rosit...@gmail.com mailto:rosit...@gmail.com
 Subject: Re: [R] graphs, need urgent help (deadline :( )
 
 Hi Rosa,
 Like Don, I can't work out what you want and I don't even have the
 picture. For example, your specification of color and line type leaves
 only one point for each color and line type, and the line from one
 point to the same point is not going to show up. Here is a possibility
 that may lead (eventually) to a solution.
 
 library(plotrix)
 par(tcl=-0.1)
 gap.plot(x=rep(seq(10,45,by=5),3),
 y=unlist(my.data[,c(factora,factorb,factorc)]),
 main=A plot of factorial mystery,
 gap=c(1.1,174),ylim=c(0,175),ylab=factor score,xlab=Group,
 xticlab=c( \n0.1\n10, \n0.2\n10, \n0.1\n20, \n0.2\n20,
   \n0.1\n30, \n0.2\n30, \n0.1\n40, \n0.2\n40),
 ytics=c(0,0.5,1,174.59),pch=rep(1:3,each=8),col=rep(c(4,2,3),each=8))
 mtext(c(Region,Sample),side=1,at=6,line=c(0,1))
 lines(seq(10,45,by=5),my.data$factora,col=4)
 lines(seq(10,45,by=5),my.data$factorb[c(1:5,NA,7,8)],col=2)
 lines(seq(10,45,by=5),my.data$factorc,col=3)
 
 Jim
 
 
 On Wed, Jun 10, 2015 at 10:53 AM, Rosa Oliveira rosit...@gmail.com 
 mailto:rosit...@gmail.com
 wrote:
 Dear Don and all,
 
 I’ve read the tutorial and tried several codes before posting :)
 I’m really naive.
 
 
 
 what I was trying to :  is something like the graph in the picture I
 drawee.
 
 
 
 
 Is it more clear now?
 
 Atenciosamente,
 Rosa Oliveira
 
 --
 
 
 
 Rosa Celeste dos Santos Oliveira,
 
 E-mail: rosit...@gmail.com mailto:rosit...@gmail.com 
 mailto:rosit...@gmail.com mailto:rosit...@gmail.com
 Tlm: +351 939355143
 Linkedin: https://pt.linkedin.com/in/rosacsoliveira 
 https://pt.linkedin.com/in/rosacsoliveira
 https://pt.linkedin.com/in/rosacsoliveira 
 https://pt.linkedin.com/in/rosacsoliveira
 
 Many admire, few know
 Hippocrates
 
 On 09 Jun 2015, at 19:23, Don McKenzie d...@u.washington.edu

Re: [R] graphs, need urgent help (deadline :( )

2015-06-10 Thread Rosa Oliveira
$sample==10],my.data$factorb[my.data$sample==10],col=2)
 lines(my.data$region[my.data$sample==10],my.data$factorc[my.data$sample==10],col=3)
 
 lines(my.data$region[my.data$sample==20],my.data$factora[my.data$sample==20],col=4,lty=2)
 lines(my.data$region[my.data$sample==20],my.data$factorb[my.data$sample==20],col=2,lty=2)
 lines(my.data$region[my.data$sample==20],my.data$factorc[my.data$sample==20],col=3,lty=2)
 
 #  Now do two more groups of 3, changing the parameter “lty” to 3 and then 4
 
 
 # Look at the syntax and note what changes and what stays constant. Do you 
 see how this works?
 # there will be what looks like a vertical line where sample = 30 and 
 factorb = 174.592.  Do you see why?
 
 # then you will need a legend
 
 Nonetheless I can’t do it :(
 
 best,
 RO
 
 
 
 Atenciosamente,
 Rosa Oliveira
 
 -- 
 
  
 smile.jpg
 Rosa Celeste dos Santos Oliveira, 
 
 E-mail: rosit...@gmail.com mailto:rosit...@gmail.com
 Tlm: +351 939355143 
 Linkedin: https://pt.linkedin.com/in/rosacsoliveira 
 https://pt.linkedin.com/in/rosacsoliveira
 
 Many admire, few know
 Hippocrates
 
 On 10 Jun 2015, at 14:13, John Kane jrkrid...@inbox.com 
 mailto:jrkrid...@inbox.com wrote:
 
 Hi Jim,
 
 I was looking at that last night and had the same problem of visualizing 
 what Rosa needed.  
 
 Hi Rosa
 This is nothing like what you wanted and I really don't understand your 
 data but would something like this work as a substitute or am I completely 
 lost?
 
 
 dat1  -  structure(list(region = c(0.1, 0.2, 0.1, 0.2, 0.1, 0.2, 0.1, 
 0.2), sample = c(10L, 10L, 20L, 20L, 30L, 30L, 40L, 40L), factora = 
 c(0.895, 
 0.811, 0.735, 0.777, 0.6, 0.466, 0.446, 0.392), factorb = c(0.903, 
 0.865, 0.966, 0.732, 0.778, 0.592, 0.432, 0.294), factorc = c(0.37,
 0.688, 0.611, 0.653, 0.694, 0.461, 0.693, 0.686)), .Names = c(region, 
 sample, factora, factorb, factorc), class = data.frame, 
 row.names = c(NA, 
 -8L))
 
 
 mdat1  -   melt(dat1, id.var = c(region, sample),
variable.name = factor,
value.name = value)
 str(mdat1)
 
 ggplot(mdat1, aes(region, value, colour = factor)) +
geom_line() + facet_grid(sample ~ .)
 
 John Kane
 Kingston ON Canada
 
 
 -Original Message-
 From: drjimle...@gmail.com mailto:drjimle...@gmail.com
 Sent: Wed, 10 Jun 2015 20:51:52 +1000
 To: rosit...@gmail.com mailto:rosit...@gmail.com
 Subject: Re: [R] graphs, need urgent help (deadline :( )
 
 Hi Rosa,
 Like Don, I can't work out what you want and I don't even have the
 picture. For example, your specification of color and line type leaves
 only one point for each color and line type, and the line from one
 point to the same point is not going to show up. Here is a possibility
 that may lead (eventually) to a solution.
 
 library(plotrix)
 par(tcl=-0.1)
 gap.plot(x=rep(seq(10,45,by=5),3),
 y=unlist(my.data[,c(factora,factorb,factorc)]),
 main=A plot of factorial mystery,
 gap=c(1.1,174),ylim=c(0,175),ylab=factor score,xlab=Group,
 xticlab=c( \n0.1\n10, \n0.2\n10, \n0.1\n20, \n0.2\n20,
   \n0.1\n30, \n0.2\n30, \n0.1\n40, \n0.2\n40),
 ytics=c(0,0.5,1,174.59),pch=rep(1:3,each=8),col=rep(c(4,2,3),each=8))
 mtext(c(Region,Sample),side=1,at=6,line=c(0,1))
 lines(seq(10,45,by=5),my.data$factora,col=4)
 lines(seq(10,45,by=5),my.data$factorb[c(1:5,NA,7,8)],col=2)
 lines(seq(10,45,by=5),my.data$factorc,col=3)
 
 Jim
 
 
 On Wed, Jun 10, 2015 at 10:53 AM, Rosa Oliveira rosit...@gmail.com 
 mailto:rosit...@gmail.com
 wrote:
 Dear Don and all,
 
 I’ve read the tutorial and tried several codes before posting :)
 I’m really naive.
 
 
 
 what I was trying to :  is something like the graph in the picture I
 drawee.
 
 
 
 
 Is it more clear now?
 
 Atenciosamente,
 Rosa Oliveira
 
 --
 
 
 
 Rosa Celeste dos Santos Oliveira,
 
 E-mail: rosit...@gmail.com mailto:rosit...@gmail.com 
 mailto:rosit...@gmail.com mailto:rosit...@gmail.com
 Tlm: +351 939355143
 Linkedin: https://pt.linkedin.com/in/rosacsoliveira 
 https://pt.linkedin.com/in/rosacsoliveira
 https://pt.linkedin.com/in/rosacsoliveira 
 https://pt.linkedin.com/in/rosacsoliveira
 
 Many admire, few know
 Hippocrates
 
 On 09 Jun 2015, at 19:23, Don McKenzie d...@u.washington.edu 
 mailto:d...@u.washington.edu
 mailto:d...@u.washington.edu mailto:d...@u.washington.edu wrote:
 
 The answer lies in learning to use the help (and knowing where to
 start).  Did you look at the tutorial that comes with the R
 installation?
 
 ?plot
 ?lines
 
 ?par
 
 In the last, look for the descriptions of “col” and “lty”.
 
 Using plot() and lines(), and subsetting the four unique values of
 “sample”, you can create your lines.
 
 Here is a crude start, assuming your columns

Re: [R] graphs, need urgent help (deadline :( )

2015-06-10 Thread Don McKenzie
0.1 40   0.446  0.432   
 0.693
0.2 40   0.392  0.294   
  0.686
 
 
 plot(my.data$region[my.data$sample==10],my.data$factora[my.data$sample==10],col=4,type=“l”,ylim=c(0,1),xlab=“region”,ylab=“factor)
 lines(my.data$region[my.data$sample==10],my.data$factorb[my.data$sample==10],col=2)
 lines(my.data$region[my.data$sample==10],my.data$factorc[my.data$sample==10],col=3)
 
 lines(my.data$region[my.data$sample==20],my.data$factora[my.data$sample==20],col=4,lty=2)
 lines(my.data$region[my.data$sample==20],my.data$factorb[my.data$sample==20],col=2,lty=2)
 lines(my.data$region[my.data$sample==20],my.data$factorc[my.data$sample==20],col=3,lty=2)
 
 #  Now do two more groups of 3, changing the parameter “lty” to 3 and then 4
 
 
 # Look at the syntax and note what changes and what stays constant. Do you 
 see how this works?
 # there will be what looks like a vertical line where sample = 30 and 
 factorb = 174.592.  Do you see why?
 
 # then you will need a legend
 
 Nonetheless I can’t do it :(
 
 best,
 RO
 
 
 
 Atenciosamente,
 Rosa Oliveira
 
 -- 
 
  
 smile.jpg
 Rosa Celeste dos Santos Oliveira, 
 
 E-mail: rosit...@gmail.com mailto:rosit...@gmail.com
 Tlm: +351 939355143 
 Linkedin: https://pt.linkedin.com/in/rosacsoliveira 
 https://pt.linkedin.com/in/rosacsoliveira
 
 Many admire, few know
 Hippocrates
 
 On 10 Jun 2015, at 14:13, John Kane jrkrid...@inbox.com 
 mailto:jrkrid...@inbox.com wrote:
 
 Hi Jim,
 
 I was looking at that last night and had the same problem of visualizing 
 what Rosa needed.  
 
 Hi Rosa
 This is nothing like what you wanted and I really don't understand your 
 data but would something like this work as a substitute or am I 
 completely lost?
 
 
 dat1  -  structure(list(region = c(0.1, 0.2, 0.1, 0.2, 0.1, 0.2, 0.1, 
 0.2), sample = c(10L, 10L, 20L, 20L, 30L, 30L, 40L, 40L), factora = 
 c(0.895, 
 0.811, 0.735, 0.777, 0.6, 0.466, 0.446, 0.392), factorb = c(0.903, 
 0.865, 0.966, 0.732, 0.778, 0.592, 0.432, 0.294), factorc = c(0.37, 
 0.688, 0.611, 0.653, 0.694, 0.461, 0.693, 0.686)), .Names = c(region, 
 sample, factora, factorb, factorc), class = data.frame, 
 row.names = c(NA, 
 -8L))
 
 
 mdat1  -   melt(dat1, id.var = c(region, sample),
variable.name = factor,
value.name = value)
 str(mdat1)
 
 ggplot(mdat1, aes(region, value, colour = factor)) +
geom_line() + facet_grid(sample ~ .)
 
 John Kane
 Kingston ON Canada
 
 
 -Original Message-
 From: drjimle...@gmail.com mailto:drjimle...@gmail.com
 Sent: Wed, 10 Jun 2015 20:51:52 +1000
 To: rosit...@gmail.com mailto:rosit...@gmail.com
 Subject: Re: [R] graphs, need urgent help (deadline :( )
 
 Hi Rosa,
 Like Don, I can't work out what you want and I don't even have the
 picture. For example, your specification of color and line type leaves
 only one point for each color and line type, and the line from one
 point to the same point is not going to show up. Here is a possibility
 that may lead (eventually) to a solution.
 
 library(plotrix)
 par(tcl=-0.1)
 gap.plot(x=rep(seq(10,45,by=5),3),
 y=unlist(my.data[,c(factora,factorb,factorc)]),
 main=A plot of factorial mystery,
 gap=c(1.1,174),ylim=c(0,175),ylab=factor score,xlab=Group,
 xticlab=c( \n0.1\n10, \n0.2\n10, \n0.1\n20, \n0.2\n20,
   \n0.1\n30, \n0.2\n30, \n0.1\n40, \n0.2\n40),
 ytics=c(0,0.5,1,174.59),pch=rep(1:3,each=8),col=rep(c(4,2,3),each=8))
 mtext(c(Region,Sample),side=1,at=6,line=c(0,1))
 lines(seq(10,45,by=5),my.data$factora,col=4)
 lines(seq(10,45,by=5),my.data$factorb[c(1:5,NA,7,8)],col=2)
 lines(seq(10,45,by=5),my.data$factorc,col=3)
 
 Jim
 
 
 On Wed, Jun 10, 2015 at 10:53 AM, Rosa Oliveira rosit...@gmail.com 
 mailto:rosit...@gmail.com
 wrote:
 Dear Don and all,
 
 I’ve read the tutorial and tried several codes before posting :)
 I’m really naive.
 
 
 
 what I was trying to :  is something like the graph in the picture I
 drawee.
 
 
 
 
 Is it more clear now?
 
 Atenciosamente,
 Rosa Oliveira
 
 --
 
 
 
 Rosa Celeste dos Santos Oliveira,
 
 E-mail: rosit...@gmail.com mailto:rosit...@gmail.com 
 mailto:rosit...@gmail.com mailto:rosit...@gmail.com
 Tlm: +351 939355143
 Linkedin: https://pt.linkedin.com/in/rosacsoliveira 
 https://pt.linkedin.com/in/rosacsoliveira
 https://pt.linkedin.com/in/rosacsoliveira 
 https://pt.linkedin.com/in/rosacsoliveira
 
 Many admire, few know
 Hippocrates
 
 On 09 Jun 2015, at 19:23, Don McKenzie d...@u.washington.edu 
 mailto:d...@u.washington.edu
 mailto:d...@u.washington.edu mailto:d...@u.washington.edu wrote:
 
 The answer lies in learning to use the help

Re: [R] graphs, need urgent help (deadline :( )

2015-06-10 Thread Don McKenzie
, 
 0.811, 0.735, 0.777, 0.6, 0.466, 0.446, 0.392), factorb = c(0.903, 
 0.865, 0.966, 0.732, 0.778, 0.592, 0.432, 0.294), factorc = c(0.37, 
 0.688, 0.611, 0.653, 0.694, 0.461, 0.693, 0.686)), .Names = c(region, 
 sample, factora, factorb, factorc), class = data.frame, row.names 
 = c(NA, 
 -8L))
 
 
 mdat1  -   melt(dat1, id.var = c(region, sample),
variable.name = factor,
value.name = value)
 str(mdat1)
 
 ggplot(mdat1, aes(region, value, colour = factor)) +
geom_line() + facet_grid(sample ~ .)
 
 John Kane
 Kingston ON Canada
 
 
 -Original Message-
 From: drjimle...@gmail.com mailto:drjimle...@gmail.com
 Sent: Wed, 10 Jun 2015 20:51:52 +1000
 To: rosit...@gmail.com mailto:rosit...@gmail.com
 Subject: Re: [R] graphs, need urgent help (deadline :( )
 
 Hi Rosa,
 Like Don, I can't work out what you want and I don't even have the
 picture. For example, your specification of color and line type leaves
 only one point for each color and line type, and the line from one
 point to the same point is not going to show up. Here is a possibility
 that may lead (eventually) to a solution.
 
 library(plotrix)
 par(tcl=-0.1)
 gap.plot(x=rep(seq(10,45,by=5),3),
 y=unlist(my.data[,c(factora,factorb,factorc)]),
 main=A plot of factorial mystery,
 gap=c(1.1,174),ylim=c(0,175),ylab=factor score,xlab=Group,
 xticlab=c( \n0.1\n10, \n0.2\n10, \n0.1\n20, \n0.2\n20,
   \n0.1\n30, \n0.2\n30, \n0.1\n40, \n0.2\n40),
 ytics=c(0,0.5,1,174.59),pch=rep(1:3,each=8),col=rep(c(4,2,3),each=8))
 mtext(c(Region,Sample),side=1,at=6,line=c(0,1))
 lines(seq(10,45,by=5),my.data$factora,col=4)
 lines(seq(10,45,by=5),my.data$factorb[c(1:5,NA,7,8)],col=2)
 lines(seq(10,45,by=5),my.data$factorc,col=3)
 
 Jim
 
 
 On Wed, Jun 10, 2015 at 10:53 AM, Rosa Oliveira rosit...@gmail.com 
 mailto:rosit...@gmail.com
 wrote:
 Dear Don and all,
 
 I’ve read the tutorial and tried several codes before posting :)
 I’m really naive.
 
 
 
 what I was trying to :  is something like the graph in the picture I
 drawee.
 
 
 
 
 Is it more clear now?
 
 Atenciosamente,
 Rosa Oliveira
 
 --
 
 
 
 Rosa Celeste dos Santos Oliveira,
 
 E-mail: rosit...@gmail.com mailto:rosit...@gmail.com 
 mailto:rosit...@gmail.com mailto:rosit...@gmail.com
 Tlm: +351 939355143
 Linkedin: https://pt.linkedin.com/in/rosacsoliveira 
 https://pt.linkedin.com/in/rosacsoliveira
 https://pt.linkedin.com/in/rosacsoliveira 
 https://pt.linkedin.com/in/rosacsoliveira
 
 Many admire, few know
 Hippocrates
 
 On 09 Jun 2015, at 19:23, Don McKenzie d...@u.washington.edu 
 mailto:d...@u.washington.edu
 mailto:d...@u.washington.edu mailto:d...@u.washington.edu wrote:
 
 The answer lies in learning to use the help (and knowing where to
 start).  Did you look at the tutorial that comes with the R
 installation?
 
 ?plot
 ?lines
 
 ?par
 
 In the last, look for the descriptions of “col” and “lty”.
 
 Using plot() and lines(), and subsetting the four unique values of
 “sample”, you can create your lines.
 
 Here is a crude start, assuming your columns are part of a data frame
 called “my.data”.   Untested...
 
 plot(my.data$region[my.data$sample==10],my.data$factora[my.data$sample==10],col=4)
 # blue line, not dashed
 .
 .
 .
 lines(my.data$region[my.data$sample==20],my.data$factorb[my.data$sample==20],col=2,lty=2)
 # red dashed line
 
 
 On Jun 9, 2015, at 10:36 AM, Rosa Oliveira rosit...@gmail.com 
 mailto:rosit...@gmail.com
 mailto:rosit...@gmail.com mailto:rosit...@gmail.com wrote:
 
 Hi,
 
 another naive question (i’m pretty sure :( )
 
 
 I’m trying to plot a multiple line graph:
 
region  sample  factora  factorb
 factorc
 0.1  10  0.895   0.903   0.378
 0.2  10  0.811   0.865   0.688
 0.1  20  0.735   0.966   0.611
 0.2  20  0.777   0.732   0.653
 0.1  30  0.600   0.778   0.694
 0.2  30  0.466   174.592 0.461
 0.1  40  0.446   0.432   0.693
 0.2  40  0.392   0.294   0.686
 
 
 
 The first column should be the independent variable, the second should
 compute a bold line for sample(10) and dash line for sample 20.
 
 What about the other two values of “sample”?
 
 The others variables are outcomes for each of the first scenarios, and
 so it should: the 3rd, 4th and 5th columns should be blue, red and
 green respectively.
 
 
 Resume :)
 
 I should have a graph, in the x-axe should have the region and in the
 y axe, the factor.
 Lines:
 1 - blue and bold for region 0.1, sample 10 and factor a
 2 - blue and dash for region 0.2, sample 10 and factor a
 3 - red and bold for region 0.1, sample 10 and factor b
 4 - red and dash for region 0.2, sample 10 and factor b
 5 - green and bold for region 0.1, sample 10 and factor c
 6 - green and dash for region 0.2, sample 10 and factor c
 
 Not consistent

Re: [R] graphs, need urgent help (deadline :( )

2015-06-10 Thread Don McKenzie
:
 
 Hi Jim,
 
 I was looking at that last night and had the same problem of visualizing 
 what Rosa needed.  
 
 Hi Rosa
 This is nothing like what you wanted and I really don't understand your 
 data but would something like this work as a substitute or am I completely 
 lost?
 
 
 dat1  -  structure(list(region = c(0.1, 0.2, 0.1, 0.2, 0.1, 0.2, 0.1, 
 0.2), sample = c(10L, 10L, 20L, 20L, 30L, 30L, 40L, 40L), factora = 
 c(0.895, 
 0.811, 0.735, 0.777, 0.6, 0.466, 0.446, 0.392), factorb = c(0.903, 
 0.865, 0.966, 0.732, 0.778, 0.592, 0.432, 0.294), factorc = c(0.37, 
 0.688, 0.611, 0.653, 0.694, 0.461, 0.693, 0.686)), .Names = c(region, 
 sample, factora, factorb, factorc), class = data.frame, row.names 
 = c(NA, 
 -8L))
 
 
 mdat1  -   melt(dat1, id.var = c(region, sample),
variable.name = factor,
value.name = value)
 str(mdat1)
 
 ggplot(mdat1, aes(region, value, colour = factor)) +
geom_line() + facet_grid(sample ~ .)
 
 John Kane
 Kingston ON Canada
 
 
 -Original Message-
 From: drjimle...@gmail.com mailto:drjimle...@gmail.com
 Sent: Wed, 10 Jun 2015 20:51:52 +1000
 To: rosit...@gmail.com mailto:rosit...@gmail.com
 Subject: Re: [R] graphs, need urgent help (deadline :( )
 
 Hi Rosa,
 Like Don, I can't work out what you want and I don't even have the
 picture. For example, your specification of color and line type leaves
 only one point for each color and line type, and the line from one
 point to the same point is not going to show up. Here is a possibility
 that may lead (eventually) to a solution.
 
 library(plotrix)
 par(tcl=-0.1)
 gap.plot(x=rep(seq(10,45,by=5),3),
 y=unlist(my.data[,c(factora,factorb,factorc)]),
 main=A plot of factorial mystery,
 gap=c(1.1,174),ylim=c(0,175),ylab=factor score,xlab=Group,
 xticlab=c( \n0.1\n10, \n0.2\n10, \n0.1\n20, \n0.2\n20,
   \n0.1\n30, \n0.2\n30, \n0.1\n40, \n0.2\n40),
 ytics=c(0,0.5,1,174.59),pch=rep(1:3,each=8),col=rep(c(4,2,3),each=8))
 mtext(c(Region,Sample),side=1,at=6,line=c(0,1))
 lines(seq(10,45,by=5),my.data$factora,col=4)
 lines(seq(10,45,by=5),my.data$factorb[c(1:5,NA,7,8)],col=2)
 lines(seq(10,45,by=5),my.data$factorc,col=3)
 
 Jim
 
 
 On Wed, Jun 10, 2015 at 10:53 AM, Rosa Oliveira rosit...@gmail.com 
 mailto:rosit...@gmail.com
 wrote:
 Dear Don and all,
 
 I’ve read the tutorial and tried several codes before posting :)
 I’m really naive.
 
 
 
 what I was trying to :  is something like the graph in the picture I
 drawee.
 
 
 
 
 Is it more clear now?
 
 Atenciosamente,
 Rosa Oliveira
 
 --
 
 
 
 Rosa Celeste dos Santos Oliveira,
 
 E-mail: rosit...@gmail.com mailto:rosit...@gmail.com 
 mailto:rosit...@gmail.com mailto:rosit...@gmail.com
 Tlm: +351 939355143
 Linkedin: https://pt.linkedin.com/in/rosacsoliveira 
 https://pt.linkedin.com/in/rosacsoliveira
 https://pt.linkedin.com/in/rosacsoliveira 
 https://pt.linkedin.com/in/rosacsoliveira
 
 Many admire, few know
 Hippocrates
 
 On 09 Jun 2015, at 19:23, Don McKenzie d...@u.washington.edu 
 mailto:d...@u.washington.edu
 mailto:d...@u.washington.edu mailto:d...@u.washington.edu wrote:
 
 The answer lies in learning to use the help (and knowing where to
 start).  Did you look at the tutorial that comes with the R
 installation?
 
 ?plot
 ?lines
 
 ?par
 
 In the last, look for the descriptions of “col” and “lty”.
 
 Using plot() and lines(), and subsetting the four unique values of
 “sample”, you can create your lines.
 
 Here is a crude start, assuming your columns are part of a data frame
 called “my.data”.   Untested...
 
 plot(my.data$region[my.data$sample==10],my.data$factora[my.data$sample==10],col=4)
 # blue line, not dashed
 .
 .
 .
 lines(my.data$region[my.data$sample==20],my.data$factorb[my.data$sample==20],col=2,lty=2)
 # red dashed line
 
 
 On Jun 9, 2015, at 10:36 AM, Rosa Oliveira rosit...@gmail.com 
 mailto:rosit...@gmail.com
 mailto:rosit...@gmail.com mailto:rosit...@gmail.com wrote:
 
 Hi,
 
 another naive question (i’m pretty sure :( )
 
 
 I’m trying to plot a multiple line graph:
 
region  sample  factora  factorb
 factorc
 0.1  10  0.895   0.903   0.378
 0.2  10  0.811   0.865   0.688
 0.1  20  0.735   0.966   0.611
 0.2  20  0.777   0.732   0.653
 0.1  30  0.600   0.778   0.694
 0.2  30  0.466   174.592 0.461
 0.1  40  0.446   0.432   0.693
 0.2  40  0.392   0.294   0.686
 
 
 
 The first column should be the independent variable, the second should
 compute a bold line for sample(10) and dash line for sample 20.
 
 What about the other two values of “sample”?
 
 The others variables are outcomes for each of the first scenarios, and
 so it should: the 3rd, 4th and 5th columns should be blue, red and
 green respectively.
 
 
 Resume :)
 
 I should have a graph, in the x-axe should have

Re: [R] graphs, need urgent help (deadline :( )

2015-06-10 Thread John Kane
You have curly quotes rather than plain ones here : 
col=4,type=“l”,xlab=“Region”,ylab=“factor)



John Kane
Kingston ON Canada

-Original Message-
From: d...@u.washington.edu
Sent: Wed, 10 Jun 2015 11:32:59 -0700
To: rosit...@gmail.com
Subject: Re: [R] graphs, need urgent help (deadline :( )

You were caught by a mysterious issue that I don’t understand either.

plot(therapy.df$Region[therapy.df$sample==50],therapy.df$factor.a[therapy.df$sample==50],col=4,type=“l”,xlab=“Region”,ylab=“factor)

Error: unexpected input in 
plot(therapy.df$Region[therapy.df$sample==50],therapy.df$factor.a[therapy.df$sample==50],col=4,type=‚”

but if I change the order of arguments to plot(), it’s fine

plot(therapy.df$Region[therapy.df$sample==50],therapy.df$factor.a[therapy.df$sample==50],type=l,col=4,xlab=Region,ylab=factor”)

I don’t know what to tell you.  If someone wiser than I is still reading, maybe 
s(he) can explain.  Possibly a bug has crept into the call to “par”, but “bugs 
suspected by non-experts like me usually turn out to be naive user errors.  

For your purposes, use the one that works.  :-)

On Jun 10, 2015, at 11:03 AM, Rosa Oliveira rosit...@gmail.com wrote:

Sorry,

I taught I attached the cvs file :)

therapy.csv

Don,

I tried, but I got an error:

 my.data$Region

 [1]  1  2  3  4  5  6  7  8  9 10  1  2  3  4  5  6  7  8  9 10  1  2  3  4  5 
 6  7  8  9 10

 my.data$sample

 [1]   50   50   50   50   50   50   50   50   50   50  250  250  250  250  250 
 250  250  250  250  250 1000 1000 1000 1000 1000 1000 1000 1000

[29] 1000 1000

 my.data$factor.a

 [1] 0.895 0.811 0.685 0.777 0.600 0.466 0.446 0.392 0.256 0.198 0.136 0.121 
0.875 0.777 0.685 0.626 0.550 0.466 0.384 0.330 0.060 0.138 0.065

[24] 0.034 0.931 0.124 0.060 0.028 0.017 0.014

 plot(my.data$Region[my.data$sample==50],my.data$factor.a[my.data$sample==50],col=4,type=“l”,xlab=“Region”,ylab=“factor)

Error: unexpected input in 
plot(my.data$Region[my.data$sample==50],my.data$factor.a[my.data$sample==50],col=4,type=�”

I’m really naive, right?

Best,

RO

 Atenciosamente,
Rosa Oliveira

-- 


smile.jpg

Rosa Celeste dos Santos Oliveira, 

E-mail: rosit...@gmail.com
Tlm: +351 939355143 
Linkedin: https://pt.linkedin.com/in/rosacsoliveira 
[https://pt.linkedin.com/in/rosacsoliveira]


Many admire, few know
Hippocrates

On 10 Jun 2015, at 18:10, Don McKenzie d...@u.washington.edu wrote:

For a legend, try (untested)

legend(0.15,0.9,c(factora,factorb,factorc),col=c(4,2,3),lty=1)

If it overlaps data points move the first two arguments (0.15 and 0.9) around, 
or change the “ylim” argument in the plot() to ~1.2.

to avoid clutter, put the line-types information in the figure caption (IMO)

On Jun 10, 2015, at 10:03 AM, Don McKenzie d...@u.washington.edu wrote:

On Jun 10, 2015, at 9:08 AM, Rosa Oliveira rosit...@gmail.com wrote:

Dear All,

I attach my data.

Dear Jim, 

when I run your code (even the one you send me, not in my data), I get: 

Don't know how to automatically pick scale for object of type function. 
Defaulting to continuous

Error in data.frame(x = c(0.1, 0.2, 0.1, 0.2, 0.1, 0.2, 0.1, 0.2, 0.1,  : 

  arguments imply differing number of rows: 24, 0

Dear Don,

It’s meant that I will have 12 lines: 

3 factors - lines colors

with 3 different values of “sample” for each - line types

[Three colors, one for each factor,
and  three line types (lty=1,2,3), one for eachvalue of “sample - preferable 
dash, thin and thick).

in the X - I should have region (because I have 10 regions)

for each region I have the outcome of 3 different treatments (factor)

for each region and each treatment I have 3 different sample size.

But in your original post you had 4 sample sizes: 10,20,30,40.

I need to “see” the the influence of the region in the treatment outcome for 
each sample size.

So, at the end I should have 9 lines

3 red (1 dash, 1 thin, 1 thick) - concerning factor a (dash for sample size 50, 
thin for sample size 250 and thick for sample size 1000)

3 blue (1 dash, 1 thin, 1 thick) - concerning factor b (dash for sample size 
50, thin for sample size 250 and thick for sample size 1000)

3 green (1 dash, 1 thin, 1 thick) - concerning factor c (dash for sample size 
50, thin for sample size 250 and thick for sample size 1000)

Hope this time is clear.

I also though about doing 3 different graphs, each one for 1 different sample 
size, and in that case I should have 3 graphs each one with 3 lines

1 red to factor a, 1 blue to factor b and 1 green to factor c.

Do you all think is better?

A matter of style perhaps but I would use dotplots because you have only two 
data points for each “line”.  The lines will be misleading.  You also could use 

panel plots, but given your skill set (unless someone wants to spend a fair bit 
of time with you), it’s probably best to stay

Re: [R] graphs, need urgent help (deadline :( )

2015-06-10 Thread John Kane

Hi Don,
You got caught by the old curly quotation marks vs plain quotations problem.  
My guess is  that at one point the code went through HTML or a word processor 
that automatically changes straight quotes  to curly ”  (if that comes 
through). 

A couple of long and painful debugging sessions a few years ago make me 
sensitive to such problems.

John Kane
Kingston ON Canada

-Original Message-
From: d...@u.washington.edu
Sent: Wed, 10 Jun 2015 12:07:27 -0700
To: rosit...@gmail.com
Subject: Re: [R] graphs, need urgent help (deadline :( )

Here is code that IS tested.  I am sending Rosa the (ugly) output in a separate 
file.  Crazy problems with argument order; I never figured out
exactly what was wrong.

# therapy plot

 
plot(therapy.df$Region[therapy.df$sample==50],therapy.df$factor.a[therapy.df$sample==50],xlab=Region,ylab=factor,type=l,col=4,ylim=c(0,1.5))
lines(therapy.df$Region[therapy.df$sample==50],therapy.df$factor.b[therapy.df$sample==50],col=2)
lines(therapy.df$Region[therapy.df$sample==50],therapy.df$factor.c[therapy.df$sample==50],col=3)

lines(therapy.df$Region[therapy.df$sample==250],therapy.df$factor.a[therapy.df$sample==250],col=4,lty=2)
lines(therapy.df$Region[therapy.df$sample==250],therapy.df$factor.b[therapy.df$sample==250],col=2,lty=2)
lines(therapy.df$Region[therapy.df$sample==250],therapy.df$factor.c[therapy.df$sample==250],col=3,lty=2)

lines(therapy.df$Region[therapy.df$sample==1000],therapy.df$factor.a[therapy.df$sample==1000],col=4,lty=3)
lines(therapy.df$Region[therapy.df$sample==1000],therapy.df$factor.b[therapy.df$sample==1000],col=2,lty=3)
lines(therapy.df$Region[therapy.df$sample==1000],therapy.df$factor.c[therapy.df$sample==1000],col=3,lty=3)

legend(7,1.4,c(factor.a,factor.b,factor.c),col=c(4,2,3),lty=1)

On Jun 10, 2015, at 11:03 AM, Rosa Oliveira rosit...@gmail.com wrote:

Sorry,

I taught I attached the cvs file :)

therapy.csv

Don,

I tried, but I got an error:

 my.data$Region
 [1]  1  2  3  4  5  6  7  8  9 10  1  2  3  4  5  6  7  8  9 10  1  2  3  4  5 
 6  7  8  9 10
 my.data$sample
 [1]   50   50   50   50   50   50   50   50   50   50  250  250  250  250  250 
 250  250  250  250  250 1000 1000 1000 1000 1000 1000 1000 1000
[29] 1000 1000
 my.data$factor.a
 [1] 0.895 0.811 0.685 0.777 0.600 0.466 0.446 0.392 0.256 0.198 0.136 0.121 
0.875 0.777 0.685 0.626 0.550 0.466 0.384 0.330 0.060 0.138 0.065
[24] 0.034 0.931 0.124 0.060 0.028 0.017 0.014

 plot(my.data$Region[my.data$sample==50],my.data$factor.a[my.data$sample==50],col=4,type=“l”,xlab=“Region”,ylab=“factor)
Error: unexpected input in 
plot(my.data$Region[my.data$sample==50],my.data$factor.a[my.data$sample==50],col=4,type=�”

I’m really naive, right?

Best,
RO

Atenciosamente,
Rosa Oliveira

-- 


smile.jpg

Rosa Celeste dos Santos Oliveira, 

E-mail: rosit...@gmail.com
Tlm: +351 939355143 
Linkedin: https://pt.linkedin.com/in/rosacsoliveira

Many admire, few know
Hippocrates

On 10 Jun 2015, at 18:10, Don McKenzie d...@u.washington.edu wrote:

For a legend, try (untested)

legend(0.15,0.9,c(factora,factorb,factorc),col=c(4,2,3),lty=1)

If it overlaps data points move the first two arguments (0.15 and 0.9) around, 
or change the “ylim” argument in the plot() to ~1.2.

to avoid clutter, put the line-types information in the figure caption (IMO)

On Jun 10, 2015, at 10:03 AM, Don McKenzie d...@u.washington.edu 
wrote:

On Jun 10, 2015, at 9:08 AM, Rosa Oliveira rosit...@gmail.com wrote:

Dear All,

I attach my data.

Dear Jim, 

when I run your code (even the one you send me, not in my data), I get: 

Don't know how to automatically pick scale for object of type function. 
Defaulting to continuous
Error in data.frame(x = c(0.1, 0.2, 0.1, 0.2, 0.1, 0.2, 0.1, 0.2, 0.1,  : 
  arguments imply differing number of rows: 24, 0

Dear Don,

It’s meant that I will have 12 lines: 
3 factors - lines colors
with 3 different values of “sample” for each - line types

[Three colors, one for each factor,
and  three line types (lty=1,2,3), one for eachvalue of “sample - preferable 
dash, thin and thick).

in the X - I should have region (because I have 10 regions)
for each region I have the outcome of 3 different treatments (factor)
for each region and each treatment I have 3 different sample size.

But in your original post you had 4 sample sizes: 10,20,30,40.

I need to “see” the the influence of the region in the treatment outcome for 
each sample size.

So, at the end I should have 9 lines
3 red (1 dash, 1 thin, 1 thick) - concerning factor a (dash for sample size 50, 
thin for sample size 250 and thick for sample size 1000)
3 blue (1 dash, 1 thin, 1 thick) - concerning factor b (dash for sample size 
50, thin for sample size 250 and thick for sample size 1000)
3 green (1 dash, 1 thin, 1 thick) - concerning factor c (dash

[R] graphs, need urgent help (deadline :( )

2015-06-09 Thread Rosa Oliveira
Hi,

another naive question (i’m pretty sure :( )


I’m trying to plot a multiple line graph:

 regionsample  factora  factorbfactorc
0.1 10  0.895   0.903   0.378
0.2 10  0.811   0.865   0.688
0.1 20  0.735   0.966   0.611
0.2 20  0.777   0.732   0.653
0.1 30  0.600   0.778   0.694
0.2 30  0.466   174.592 0.461
0.1 40  0.446   0.432   0.693
0.2 40  0.392   0.294   0.686



The first column should be the independent variable, the second should compute 
a bold line for sample(10) and dash line for sample 20.
The others variables are outcomes for each of the first scenarios, and so it 
should: the 3rd, 4th and 5th columns should be blue, red and green 
respectively. 


Resume :)

I should have a graph, in the x-axe should have the region and in the y axe, 
the factor.
Lines:
1 - blue and bold for region 0.1, sample 10 and factor a
2 - blue and dash for region 0.2, sample 10 and factor a
3 - red and bold for region 0.1, sample 10 and factor b
4 - red and dash for region 0.2, sample 10 and factor b
5 - green and bold for region 0.1, sample 10 and factor c
6 - green and dash for region 0.2, sample 10 and factor c

nonetheless the independent variable is nominal, I should plot a line graph.

Can anyone help me please?
I have my file as a cvs file, so I first read that file (that I know how to do 
:)).

But I have it in that format.

Best,
RO



Atenciosamente,
Rosa Oliveira

-- 



Rosa Celeste dos Santos Oliveira, 

E-mail: rosit...@gmail.com
Tlm: +351 939355143 
Linkedin: https://pt.linkedin.com/in/rosacsoliveira

Many admire, few know
Hippocrates


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Re: [R] Graphs for scientific publication ?

2015-06-03 Thread Jeremy Clark
The coding I've settled on to save file without clipping is:

library(gridExtra)
gt - ggplot_gtable(ggplot_build(q3))
gt$layout$clip[gt$layout$name==panel] - off
gt4 - arrangeGrob(gt)
ggsave - ggplot2::ggsave; body(ggsave) - body(ggplot2::ggsave)[-2]
## from Baptiste
ggsave(gt.pdf, plot = gt4, width = 6, height = 6)
ggsave(gt.png, plot = gt4, width = 6, height = 6)

Part of the problem with plotmath is that as soon as paste is used the
syntax needed is different eg. substitute and substitute(paste( do not
accept the same syntax eg. == or =.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Graphs for scientific publication ?

2015-06-03 Thread David Winsemius

On Jun 3, 2015, at 3:30 AM, Jeremy Clark wrote:

 The coding I've settled on to save file without clipping is:

What exactly was clipping. You earlier complained about jaggies. There was 
no restriction of the plotted lines to the plot area in the example you earlier 
presented. That's what I understand clipping to mean.

 
 library(gridExtra)
 gt - ggplot_gtable(ggplot_build(q3))
 gt$layout$clip[gt$layout$name==panel] - off
 gt4 - arrangeGrob(gt)
 ggsave - ggplot2::ggsave; body(ggsave) - body(ggplot2::ggsave)[-2]
 ## from Baptiste
 ggsave(gt.pdf, plot = gt4, width = 6, height = 6)
 ggsave(gt.png, plot = gt4, width = 6, height = 6)
 
 Part of the problem with plotmath is that as soon as paste is used the
 syntax needed is different eg. substitute and substitute(paste( do not
 accept the same syntax eg. == or =.
 

There's not much context for this. If you are bothered that that you need = 
inside paste and `==` outside, then you just need to spend more time 
understanding expression syntax.  I have found that plotmath's `paste` usually 
ends up obscuring a proper understanding of expression syntax. Would be 
annotators reach for plotmath-`paste` because they missed the part about using 
* and ~ to separate tokens Oh wait ... now I remember there isn't 
really any section in the ?plotmath page that actually says that, is there? 
(Sorry, Not my area of responsibility. Took me years to learn this.)

Your other complaint about plotmath not supporting line-breaks is a recognized 
problem. Multi-element expression vectors are one strategy to consider.  You 
should also look at the grid.text function if you are working in the 
ggplot2-world and want fine-tuned control. You are already building a 
grid-based structure. (And to your whine that ggplot2 is not in base-R, 
consider that the grid package is.) Bert Gunter's suggestion that you purchase 
Murrell's R Graphics should be remembered. It is essentially the assembly 
language in which ggplot2 is written.

Learn to use bquote ... You had:

rsquaredlm = NULL
rsquaredlm[[6]] - 3 ## false value
listr2 - list(r2 = rsquaredlm[[6]])
eq1 - substitute(italic(R)^2 == r2, listr2)
eqstr1 - as.character(as.expression(eq1))
q3 - p2 +  annotate(geom = text, x = 20, y = 30, label = eqstr1,
parse = TRUE, vjust = 1)

The results from `bquote` appear to be handled properly within ggplot2-code. 
(Lattice functions do not like `bquote` for its expressions, since they are not 
actually in expression mode.)

rsquaredlm = NULL
rsquaredlm[[6]] - 3 
 eq1 - bquote(italic(R)^2 == .(rsquaredlm[[6]]))  # the value will be 
substituted in the plot
 eqstr1 - as.character(as.expression(eq1))
q3 - p2 +  annotate(geom = text, x = 20, y = 30, label = eqstr1,
parse = TRUE, vjust = 1)

-- 

David Winsemius
Alameda, CA, USA

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Graphs for scientific publication ?

2015-05-04 Thread Jeremy Clark
Dear All,

Many thanks for your very comprehensive replies. Here I provide some
coding which on my system has the following effects:
1) The italic R is not rendered by CairoX11, but is rendered by quartz.
2) Both geom_smooth and geom_abline here give stepped lines (I've
realised the angle of the line makes quite a difference to this). I
presume that these are not anti-aliased - so I was hoping that Cairo
would change this. Unfortunately the command Cairo() does not open any
device, and the CairoX11 device gives similar lines to that from
quartz.
3) As I must turn off general clipping (because I need to add some
text which overlaps the plot edge) it would be useful to be able to
clip particular lines to the plot edge - although this is not a
catastrophe as I can create a new truncated dataframe and plot the
lines from this.

My system is MacBook Air, with all Xcode recently updated including
IOS 8.2, OS X 10.10, Xcode 6.2. I previously, and fairly recently,
installed X11 (and Xquartz), and also updated R and R Cairo, but none
of this has affected the above behaviour.

Any advice gratefully received.

Yours sincerely,

Jeremy Clark

library(ggplot2)
library(grid)
library(Cairo)

theme_jack - function (base_size = 16, base_family = ) {
theme_classic(base_size = base_size, base_family = base_family) %+replace%
theme(
plot.title = element_text(size=15, vjust=3),
axis.text = element_text(colour = black, family=Times,
face=c('bold'), size = 18),
axis.title.x = element_text(colour = black,
family=Times, face=c('bold'),   vjust = -1,size =
20),
axis.title.y = element_text(colour = black,
family=Times, angle=90,  face=c('bold'), vjust= 2, size = 20),
panel.background = element_rect(fill=white),
panel.grid.minor = element_blank(),
panel.grid.major = element_blank(),
plot.background = element_rect(fill=white),
panel.border = element_blank(),
panel.background = element_blank(),
plot.margin=unit(c(1,1.5,1.3,1.3),cm)
)
}
theme_set(theme_jack())

DataX - seq(1, 40, by = 1)
DataY - seq(1, 40, by = 1)
Datadf - data.frame(DataX, DataY)

## replace quartz with CairoX11 or X11 for various effects:

quartz(width = 6 , height = 6) ## quartz renders the italic R correctly
p1 - ggplot() + ggtitle(Title) + coord_cartesian(xlim = c(1, 40),
ylim = c(0, 40)) + scale_y_continuous(breaks = c(0, 10, 20, 30),
labels = c(0, 10, 20, 30), expand = c(0, 0)) + ylab(Y-axis)
+ scale_x_continuous(breaks = c(10, 20, 30, 40), expand = c(0, 0)) +
geom_point(data = Datadf, aes(x = DataX, y = DataY)) + xlab(X-axis)

predy - as.integer(c(38, 25, 20, 14, 8))
predx - as.integer(c(20, 21, 22, 24, 25))
datapreddf - as.data.frame(predx, predy)
myplm - lm(predy ~ predx, data = datapreddf)
lmxrange - data.frame(predx = seq(from = 20, to = 30, by = 0.01))
lmyrange - predict.lm(myplm, newdata - lmxrange)
lmdataframe - data.frame(lmxrange, lmyrange)
p2 - p1 + geom_smooth(data = lmdataframe, aes(x = predx, y =
lmyrange), method=lm, se=FALSE, color = black) +
geom_abline(aes(intercept = as.vector(coefficients(myplm)[1]),
slope=as.vector(coefficients(myplm)[2]+2)), data=lmdataframe) ## both
give stepped lines in both quartz and CairoX11

rsquaredlm = NULL
rsquaredlm[[6]] - 3 ## false value
listr2 - list(r2 = rsquaredlm[[6]])
eq1 - substitute(italic(R)^2 == r2, listr2)
eqstr1 - as.character(as.expression(eq1))
q3 - p2 +  annotate(geom = text, x = 20, y = 30, label = eqstr1,
parse = TRUE, vjust = 1)
gt - ggplot_gtable(ggplot_build(q3))

gt$layout$clip[gt$layout$name==panel] - off ## (necessary to
allow additional text
## overlap - not shown) - clipping of lines can be done with other
coding - although it
##would be nice to be able to do this more efficiently
grid.draw(gt)

## _

Cairo() ## doesn't open any device

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Graphs for scientific publication ?

2015-05-04 Thread Ista Zahn
Hi Jeremy,

On Mon, May 4, 2015 at 6:13 AM, Jeremy Clark jeremyclark...@gmail.com
wrote:
 Dear All,

 Many thanks for your very comprehensive replies. Here I provide some
 coding which on my system has the following effects:
 1) The italic R is not rendered by CairoX11, but is rendered by quartz.

I don't have a Mac available, but it works as expected here on Linux. You
may wish to ask on the r-sig-mac mailing list.

 2) Both geom_smooth and geom_abline here give stepped lines (I've
 realised the angle of the line makes quite a difference to this). I
 presume that these are not anti-aliased - so I was hoping that Cairo
 would change this. Unfortunately the command Cairo() does not open any
 device,

Are you sure about that? It opens a png device by default here. See ?Cairo
especially the type argument.

and the CairoX11 device gives similar lines to that from
 quartz.

Generally graphics that you wish to publish or otherwise disseminate will
be written to a png, pdf, or similar. How does

png(tst.png, width=5, height=5, units = in, res=300)
q3
dev.off()

look?

 3) As I must turn off general clipping (because I need to add some
 text which overlaps the plot edge) it would be useful to be able to
 clip particular lines to the plot edge - although this is not a
 catastrophe as I can create a new truncated dataframe and plot the
 lines from this.

It would have been nice to have a reproducible example of what you are
trying to accomplish by turning off clipping. There may be an easier way,
but it's hard to say for sure without knowing what the goal is.

Best,
Ista

 My system is MacBook Air, with all Xcode recently updated including
 IOS 8.2, OS X 10.10, Xcode 6.2. I previously, and fairly recently,
 installed X11 (and Xquartz), and also updated R and R Cairo, but none
 of this has affected the above behaviour.

 Any advice gratefully received.

 Yours sincerely,

 Jeremy Clark

 library(ggplot2)
 library(grid)
 library(Cairo)

 theme_jack - function (base_size = 16, base_family = ) {
 theme_classic(base_size = base_size, base_family = base_family) %+replace%
 theme(
 plot.title = element_text(size=15, vjust=3),
 axis.text = element_text(colour = black, family=Times,
 face=c('bold'), size = 18),
 axis.title.x = element_text(colour = black,
 family=Times, face=c('bold'), vjust = -1, size =
 20),
 axis.title.y = element_text(colour = black,
 family=Times, angle=90, face=c('bold'), vjust= 2, size = 20),
 panel.background = element_rect(fill=white),
 panel.grid.minor = element_blank(),
 panel.grid.major = element_blank(),
 plot.background = element_rect(fill=white),
 panel.border = element_blank(),
 panel.background = element_blank(),
 plot.margin=unit(c(1,1.5,1.3,1.3),cm)
 )
 }
 theme_set(theme_jack())

 DataX - seq(1, 40, by = 1)
 DataY - seq(1, 40, by = 1)
 Datadf - data.frame(DataX, DataY)

 ## replace quartz with CairoX11 or X11 for various effects:

 quartz(width = 6 , height = 6) ## quartz renders the italic R correctly
 p1 - ggplot() + ggtitle(Title) + coord_cartesian(xlim = c(1, 40),
 ylim = c(0, 40)) + scale_y_continuous(breaks = c(0, 10, 20, 30),
 labels = c(0, 10, 20, 30), expand = c(0, 0)) + ylab(Y-axis)
 + scale_x_continuous(breaks = c(10, 20, 30, 40), expand = c(0, 0)) +
 geom_point(data = Datadf, aes(x = DataX, y = DataY)) + xlab(X-axis)

 predy - as.integer(c(38, 25, 20, 14, 8))
 predx - as.integer(c(20, 21, 22, 24, 25))
 datapreddf - as.data.frame(predx, predy)
 myplm - lm(predy ~ predx, data = datapreddf)
 lmxrange - data.frame(predx = seq(from = 20, to = 30, by = 0.01))
 lmyrange - predict.lm(myplm, newdata - lmxrange)
 lmdataframe - data.frame(lmxrange, lmyrange)
 p2 - p1 + geom_smooth(data = lmdataframe, aes(x = predx, y =
 lmyrange), method=lm, se=FALSE, color = black) +
 geom_abline(aes(intercept = as.vector(coefficients(myplm)[1]),
 slope=as.vector(coefficients(myplm)[2]+2)), data=lmdataframe) ## both
 give stepped lines in both quartz and CairoX11

 rsquaredlm = NULL
 rsquaredlm[[6]] - 3 ## false value
 listr2 - list(r2 = rsquaredlm[[6]])
 eq1 - substitute(italic(R)^2 == r2, listr2)
 eqstr1 - as.character(as.expression(eq1))
 q3 - p2 + annotate(geom = text, x = 20, y = 30, label = eqstr1,
 parse = TRUE, vjust = 1)
 gt - ggplot_gtable(ggplot_build(q3))

 gt$layout$clip[gt$layout$name==panel] - off ## (necessary to
 allow additional text
 ## overlap - not shown) - clipping of lines can be done with other
 coding - although it
 ##would be nice to be able to do this more efficiently
 grid.draw(gt)

 ## _

 Cairo() ## doesn't open any device

 __
 R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.

[[alternative HTML version deleted]]

__

Re: [R] Graphs for scientific publication ?

2015-05-04 Thread David Winsemius

On May 4, 2015, at 3:13 AM, Jeremy Clark wrote:

 Dear All,
 
 Many thanks for your very comprehensive replies. Here I provide some
 coding which on my system has the following effects:
 1) The italic R is not rendered by CairoX11, but is rendered by quartz.
 2) Both geom_smooth and geom_abline here give stepped lines (I've
 realised the angle of the line makes quite a difference to this). I
 presume that these are not anti-aliased - so I was hoping that Cairo
 would change this. Unfortunately the command Cairo() does not open any
 device, and the CairoX11 device gives similar lines to that from
 quartz.
 3) As I must turn off general clipping (because I need to add some
 text which overlaps the plot edge) it would be useful to be able to
 clip particular lines to the plot edge - although this is not a
 catastrophe as I can create a new truncated dataframe and plot the
 lines from this.
 
 My system is MacBook Air, with all Xcode recently updated including
 IOS 8.2, OS X 10.10, Xcode 6.2. I previously, and fairly recently,
 installed X11 (and Xquartz), and also updated R and R Cairo, but none
 of this has affected the above behaviour.
 
 Any advice gratefully received.
 
 Yours sincerely,
 
 Jeremy Clark
 
 library(ggplot2)
 library(grid)
 library(Cairo)
 
 theme_jack - function (base_size = 16, base_family = ) {
theme_classic(base_size = base_size, base_family = base_family) %+replace%
theme(
plot.title = element_text(size=15, vjust=3),
axis.text = element_text(colour = black, family=Times,
 face=c('bold'), size = 18),
axis.title.x = element_text(colour = black,
 family=Times, face=c('bold'),   vjust = -1,size =
 20),
axis.title.y = element_text(colour = black,
 family=Times, angle=90,  face=c('bold'), vjust= 2, size = 20),
panel.background = element_rect(fill=white),
panel.grid.minor = element_blank(),
panel.grid.major = element_blank(),
plot.background = element_rect(fill=white),
panel.border = element_blank(),
panel.background = element_blank(),
plot.margin=unit(c(1,1.5,1.3,1.3),cm)
)
 }
 theme_set(theme_jack())
 
 DataX - seq(1, 40, by = 1)
 DataY - seq(1, 40, by = 1)
 Datadf - data.frame(DataX, DataY)
 
 ## replace quartz with CairoX11 or X11 for various effects:
 
 quartz(width = 6 , height = 6) ## quartz renders the italic R correctly
 p1 - ggplot() + ggtitle(Title) + coord_cartesian(xlim = c(1, 40),
 ylim = c(0, 40)) + scale_y_continuous(breaks = c(0, 10, 20, 30),
 labels = c(0, 10, 20, 30), expand = c(0, 0)) + ylab(Y-axis)
 + scale_x_continuous(breaks = c(10, 20, 30, 40), expand = c(0, 0)) +
 geom_point(data = Datadf, aes(x = DataX, y = DataY)) + xlab(X-axis)
 

 predy - as.integer(c(38, 25, 20, 14, 8))
 predx - as.integer(c(20, 21, 22, 24, 25))
 datapreddf - as.data.frame(predx, predy)
 myplm - lm(predy ~ predx, data = datapreddf)
 lmxrange - data.frame(predx = seq(from = 20, to = 30, by = 0.01))
 lmyrange - predict.lm(myplm, newdata - lmxrange)
 lmdataframe - data.frame(lmxrange, lmyrange)
 p2 - p1 + geom_smooth(data = lmdataframe, aes(x = predx, y =
 lmyrange), method=lm, se=FALSE, color = black) +
 geom_abline(aes(intercept = as.vector(coefficients(myplm)[1]),
 slope=as.vector(coefficients(myplm)[2]+2)), data=lmdataframe) ## both
 give stepped lines in both quartz and CairoX11
 
 rsquaredlm = NULL
 rsquaredlm[[6]] - 3 ## false value
 listr2 - list(r2 = rsquaredlm[[6]])
 eq1 - substitute(italic(R)^2 == r2, listr2)
 eqstr1 - as.character(as.expression(eq1))
 q3 - p2 +  annotate(geom = text, x = 20, y = 30, label = eqstr1,
 parse = TRUE, vjust = 1)
 gt - ggplot_gtable(ggplot_build(q3))
 
 gt$layout$clip[gt$layout$name==panel] - off

 ## (necessary toallow additional text
 ## overlap - not shown) - clipping of lines can be done with other
#   coding - although it
 
 ## would be nice to be able to do this more efficiently
 grid.draw(gt)
 
 ## _
 
 Cairo() ## doesn't open any device

I would not expect it to. The default for the file argument to Cairo() is . I 
get an error when I try this on a MacPro running 0sx 10.7.5:

 Cairo(file=test.png)
Fontconfig error: 
/Library/Frameworks/R.framework/Resources/fontconfig/fonts/conf.d/10-scale-bitmap-fonts.conf,
 line 70: non-double matrix element

At any rate one would not generally attempt to smooth out jaggies with the 
default .png setting for Cairo. One would use CairoPDF or CairoSVG depending on 
the preferences of ones publisher. (I've never used CairoPDF(), since the 
ordinary pdf() device just works.)

This does seem to be way too much code for demonstration of difficulties with 
getting proper output from a vector graphics device. The onscreen version of 
quartz has limited resolution but the Save as... output should be pdf.

You need to realize that there are several different fonts being used by these 
devices:

 names( quartzFonts())

Re: [R] Graphs for scientific publication ?

2015-05-01 Thread Ista Zahn
On Thu, Apr 30, 2015 at 8:05 AM, Jeremy Clark jeremyclark...@gmail.com wrote:
 Dear All,

 First of all, many thanks to all R contributors for a fantastic
 program, and especially to Hadley Wickham for creating ggplot2. The
 following is intended to be a warning that, if the apparently
 superficial problems described are not sorted out, R could well find
 itself being superceded.

In my opinion that can and should happen, but my prediction is that R
has such a big lead in terms of available functionality and packages
that no one will catch up for at least a decade.

The reason is that a new user wants to draw a
 graph, and perhaps publish in a scientific journal a graph created
 using R, well before wanting to do a complex regression (and the
 latter is relatively easy). So here goes:

 1) The saga of the straight line. I implemented a geom_abline - it
 looked superb. Unfortunately I had to disable clip to allow text - now
 my abline looked ridiculous. My search found plotrix: ablineclip -
 fantastic I thought - but it applies to plot and not geom_plot. I
 switched to geom_segment - the rendering looked trash. I switched to
 geom_smooth - should work but as I don't know the x values beforehand
 I'll have to clip a new dataframe - it that a hassle ? - Yes it is !

As others have mentioned we can probably help you if you give us a
reproducible example and a clear description of what you are trying to
accomplish. Absent that this just sounds like complaining for the sake
of it.


 So my general question is - why isn't ggplot2 already part
 of R base

I think packages are added to the base distribution relatively
infrequently these days. Is

install.packages(ggplot2)

really an issue?

- or at least if someone is to create useful packages for
 plot - perhaps a subtle hint could be made that they should also apply
 to ggplot2 (and perhaps to lattice ??

I'm not understanding what you are trying to say here.

- also personally I would scrap
 qplot as an unnecessary distraction which is not easier to implement
 than ggplot).

ggplot2 is in maintenance mode, so it is unlikely that major changes
like that will be introduced.

 In general duplication of packages for plot and ggplot
 doesn't seem like a good idea.

I'm not sure what kind of duplication you are referring to here,
though in general I also wish there was less duplicated functionality
spread across various R packages.



 2) The saga of the italic letter. I found, to my dismay, that to
 insert an italic letter into my plot I had to learn a whole new
 language called plotmath - which wouldn't accept normal R coding, and
 didn't even have normal control functions such as /n for a new line.
 This is ridiculous (and I'm not sure how plotmath managed to get into
 R base).

library(ggplot2)

d1 - data.frame(x = 1, y = 1, t = some text)
d2 - d1
d2$x - 2

ggplot(d1, aes(x = x, y = y, label = t)) +
  geom_text(hjust = 0, size = 10) +
  geom_text(data=d2, fontface=italic, hjust=1, size = 10)

Works for me.


 So my question is, when is plotmath going to have a
 complete overhaul to allow eg. , instead of, or as well as, ~,~, and
 normal control functions such as \n ?

Probably never (though you could do it yourself if you think it is
worth spending the time to improve it).


 3) A related question to (2) is: where is geom_textbox ?

I don't think there is one. You could make one following the
documentation at
https://github.com/hadley/ggplot2/wiki/Creating-a-new-geom


 4) Where are examples with scientific graph defaults ?  (meaning a
 two-axis graph which is publishable - I will post my own after this is
 published in a years time, but as suggested above, while the graph
 looks good the implementation of this is not pretty).

Lot's of people publish ggplot2 graphs, standards differ from field to
field and from journal to journal.
http://scholar.google.com/scholar?cites=14238124760782644329as_sdt=4005sciodt=0,22hl=en
will give you some examples. Beyond that I think you'll have to be
more specific about what exactly you want the graphs to look like.


 Having said that - good luck with implementation - and many thanks for
 all your hard work !

 Yours sincerely,

 Abiologist

 __
 R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Graphs for scientific publication ?

2015-04-30 Thread Jeremy Clark
Dear All,

First of all, many thanks to all R contributors for a fantastic
program, and especially to Hadley Wickham for creating ggplot2. The
following is intended to be a warning that, if the apparently
superficial problems described are not sorted out, R could well find
itself being superceded. The reason is that a new user wants to draw a
graph, and perhaps publish in a scientific journal a graph created
using R, well before wanting to do a complex regression (and the
latter is relatively easy). So here goes:

1) The saga of the straight line. I implemented a geom_abline - it
looked superb. Unfortunately I had to disable clip to allow text - now
my abline looked ridiculous. My search found plotrix: ablineclip -
fantastic I thought - but it applies to plot and not geom_plot. I
switched to geom_segment - the rendering looked trash. I switched to
geom_smooth - should work but as I don't know the x values beforehand
I'll have to clip a new dataframe - it that a hassle ? - Yes it is !

So my general question is - why isn't ggplot2 already part
of R base - or at least if someone is to create useful packages for
plot - perhaps a subtle hint could be made that they should also apply
to ggplot2 (and perhaps to lattice ?? - also personally I would scrap
qplot as an unnecessary distraction which is not easier to implement
than ggplot). In general duplication of packages for plot and ggplot
doesn't seem like a good idea.


2) The saga of the italic letter. I found, to my dismay, that to
insert an italic letter into my plot I had to learn a whole new
language called plotmath - which wouldn't accept normal R coding, and
didn't even have normal control functions such as /n for a new line.
This is ridiculous (and I'm not sure how plotmath managed to get into
R base).

So my question is, when is plotmath going to have a
complete overhaul to allow eg. , instead of, or as well as, ~,~, and
normal control functions such as \n ?

3) A related question to (2) is: where is geom_textbox ?

4) Where are examples with scientific graph defaults ?  (meaning a
two-axis graph which is publishable - I will post my own after this is
published in a years time, but as suggested above, while the graph
looks good the implementation of this is not pretty).

Having said that - good luck with implementation - and many thanks for
all your hard work !

Yours sincerely,

Abiologist

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Graphs for scientific publication ?

2015-04-30 Thread Bert Gunter
Jeremy:

I suggest you have a look at the latest edition of Paul Murrell's
book, R Graphics, as you seem to be unaware that ggplot2 (as well as
a 3rd graphics paradigm, the lattice package) and base graphics are
built on 2 different and incompatible graphics engines.

Obviously, you are entitled to your opinions and graphical
predilections vary, but I do not think R-Help is a good venue for
these sorts of discussions. The R-devel list might be a better place
to discuss such matters.

Cheers,
Bert

Bert Gunter
Genentech Nonclinical Biostatistics
(650) 467-7374

Data is not information. Information is not knowledge. And knowledge
is certainly not wisdom.
Clifford Stoll




On Thu, Apr 30, 2015 at 5:05 AM, Jeremy Clark jeremyclark...@gmail.com wrote:
 Dear All,

 First of all, many thanks to all R contributors for a fantastic
 program, and especially to Hadley Wickham for creating ggplot2. The
 following is intended to be a warning that, if the apparently
 superficial problems described are not sorted out, R could well find
 itself being superceded. The reason is that a new user wants to draw a
 graph, and perhaps publish in a scientific journal a graph created
 using R, well before wanting to do a complex regression (and the
 latter is relatively easy). So here goes:

 1) The saga of the straight line. I implemented a geom_abline - it
 looked superb. Unfortunately I had to disable clip to allow text - now
 my abline looked ridiculous. My search found plotrix: ablineclip -
 fantastic I thought - but it applies to plot and not geom_plot. I
 switched to geom_segment - the rendering looked trash. I switched to
 geom_smooth - should work but as I don't know the x values beforehand
 I'll have to clip a new dataframe - it that a hassle ? - Yes it is !

 So my general question is - why isn't ggplot2 already part
 of R base - or at least if someone is to create useful packages for
 plot - perhaps a subtle hint could be made that they should also apply
 to ggplot2 (and perhaps to lattice ?? - also personally I would scrap
 qplot as an unnecessary distraction which is not easier to implement
 than ggplot). In general duplication of packages for plot and ggplot
 doesn't seem like a good idea.


 2) The saga of the italic letter. I found, to my dismay, that to
 insert an italic letter into my plot I had to learn a whole new
 language called plotmath - which wouldn't accept normal R coding, and
 didn't even have normal control functions such as /n for a new line.
 This is ridiculous (and I'm not sure how plotmath managed to get into
 R base).

 So my question is, when is plotmath going to have a
 complete overhaul to allow eg. , instead of, or as well as, ~,~, and
 normal control functions such as \n ?

 3) A related question to (2) is: where is geom_textbox ?

 4) Where are examples with scientific graph defaults ?  (meaning a
 two-axis graph which is publishable - I will post my own after this is
 published in a years time, but as suggested above, while the graph
 looks good the implementation of this is not pretty).

 Having said that - good luck with implementation - and many thanks for
 all your hard work !

 Yours sincerely,

 Abiologist

 __
 R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Graphs for scientific publication ?

2015-04-30 Thread David L Carlson
More useful to the r-help list would be a reproducible example of the data you 
are using and a clear statement of what you are trying to accomplish. It is 
likely that all of your requirements can be easily met, but you spent most of 
your message talking about what you have tried without telling us where you 
want to end up. People on the list are familiar with base graphics, lattice 
graphics, and ggplot2. If you list your requirements clearly, you might end up 
with three solutions.

-
David L Carlson
Department of Anthropology
Texas AM University
College Station, TX 77840-4352

-Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Bert Gunter
Sent: Thursday, April 30, 2015 1:41 PM
To: Jeremy Clark
Cc: r-help@r-project.org
Subject: Re: [R] Graphs for scientific publication ?

Jeremy:

I suggest you have a look at the latest edition of Paul Murrell's
book, R Graphics, as you seem to be unaware that ggplot2 (as well as
a 3rd graphics paradigm, the lattice package) and base graphics are
built on 2 different and incompatible graphics engines.

Obviously, you are entitled to your opinions and graphical
predilections vary, but I do not think R-Help is a good venue for
these sorts of discussions. The R-devel list might be a better place
to discuss such matters.

Cheers,
Bert

Bert Gunter
Genentech Nonclinical Biostatistics
(650) 467-7374

Data is not information. Information is not knowledge. And knowledge
is certainly not wisdom.
Clifford Stoll




On Thu, Apr 30, 2015 at 5:05 AM, Jeremy Clark jeremyclark...@gmail.com wrote:
 Dear All,

 First of all, many thanks to all R contributors for a fantastic
 program, and especially to Hadley Wickham for creating ggplot2. The
 following is intended to be a warning that, if the apparently
 superficial problems described are not sorted out, R could well find
 itself being superceded. The reason is that a new user wants to draw a
 graph, and perhaps publish in a scientific journal a graph created
 using R, well before wanting to do a complex regression (and the
 latter is relatively easy). So here goes:

 1) The saga of the straight line. I implemented a geom_abline - it
 looked superb. Unfortunately I had to disable clip to allow text - now
 my abline looked ridiculous. My search found plotrix: ablineclip -
 fantastic I thought - but it applies to plot and not geom_plot. I
 switched to geom_segment - the rendering looked trash. I switched to
 geom_smooth - should work but as I don't know the x values beforehand
 I'll have to clip a new dataframe - it that a hassle ? - Yes it is !

 So my general question is - why isn't ggplot2 already part
 of R base - or at least if someone is to create useful packages for
 plot - perhaps a subtle hint could be made that they should also apply
 to ggplot2 (and perhaps to lattice ?? - also personally I would scrap
 qplot as an unnecessary distraction which is not easier to implement
 than ggplot). In general duplication of packages for plot and ggplot
 doesn't seem like a good idea.


 2) The saga of the italic letter. I found, to my dismay, that to
 insert an italic letter into my plot I had to learn a whole new
 language called plotmath - which wouldn't accept normal R coding, and
 didn't even have normal control functions such as /n for a new line.
 This is ridiculous (and I'm not sure how plotmath managed to get into
 R base).

 So my question is, when is plotmath going to have a
 complete overhaul to allow eg. , instead of, or as well as, ~,~, and
 normal control functions such as \n ?

 3) A related question to (2) is: where is geom_textbox ?

 4) Where are examples with scientific graph defaults ?  (meaning a
 two-axis graph which is publishable - I will post my own after this is
 published in a years time, but as suggested above, while the graph
 looks good the implementation of this is not pretty).

 Having said that - good luck with implementation - and many thanks for
 all your hard work !

 Yours sincerely,

 Abiologist

 __
 R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] graphs

2015-03-14 Thread John Kane
I suspect that this does look a bit easier to interpret. It certainly beats 68 
lines on one graph. Still it's a lot of individual subplots.

What I was suggesting was grouping all NASS, HASS, etc. together and graphing 
each so that you get several lines per subplot. I don't know if this makes 
sense in your context but it should reduce the size of the overall plot.

Ugly simple-minded example of what I meant below.

library(ggplot2)
names   -  c('hass', ham, 'nacs', 'nass')
line  -  c('alpha', beta)
xval  -  1:4

dat1  -  data.frame(group= rep(names, each = 3, 4),
tt  =  rep(line, each =12 , 2),
xx  =  rep(xval, 12 ),
yy  =  rnorm(48))

p  -  ggplot(dat1, aes(xx, yy, colour = tt)) + geom_line() +
  facet_grid(. ~ group)
p

John Kane
Kingston ON Canada


 -Original Message-
 From: mir.sa...@uef.fi
 Sent: Fri, 13 Mar 2015 16:27:06 +
 To: jrkrid...@inbox.com, petr.pi...@precheza.cz, r-help@r-project.org
 Subject: RE: [R] graphs
 
 
 __Dear all,
 
 You can see the plot specif curves in the enclosed document. Inclusion of
 all plot specif curves in one plot may not be look  good and finally it
 will be unreadable. I am agree with Petrr and John. This graph is more
 readable.
 
 
 Best regards
 Salam
 
 
 
 
 
 
 
 
 __
 From: John Kane jrkrid...@inbox.com
 Sent: Friday, March 13, 2015 4:12 PM
 To: PIKAL Petr; Mir Salam; r-help@r-project.org
 Subject: Re: [R] graphs
 
 @Petr
 
 I agree. I think Mir would get a totally unreadable graph. I occasionally
 look at some spagetti graphs from climate research, and I find 8 - 12
 lines are incomprehensible (I'm not a subject matter expert)'
 
 @Mir
 
 Is there any logical way to break down the data ? I think Petr is correct
 in that ggplot2 should be able to do it but I'd suggest thinking about,
 perhaps, facetting the data to produce some reasonable number of panels.
 
 Here is a simple three-panel plot to illustrate what I mean but I have
 easily produced a 9 or 10 panel plot which reduces visual clutter
 immensely.
 
 library(plyr) library(ggplot2)
 
 df1 = data.frame(basel_asset_class =
c(bank,bank,bank,bank,bank,bank,bank,corporate,corporate,corporate,corporate,corporate,corporate,corporate,sovereign,sovereign,sovereign,sovereign,sovereign,sovereign,sovereign),
 ratings =
c(AAA,AA,A,BBB,BB,B,CCC,AAA,AA,A,BBB,BB,B,CCC,AAA,AA,A,BBB,BB,B,CCC),
 default_probability =
 c(0.0027,0.0029,0.0031,0.0034,0.0037,0.004,0.0043,0.0025,0.0024,0.0024,0.0023,0.0022,0.0021,0.0021,0.003,0.0031,0.0032,0.0033,0.0034,0.0035,0.0036))
 
 names(df1) - c(class, rate, default)
 
 p - ggplot(df1, aes(rate, default,colour=class)) + geom_point() +
 facet_grid(class ~.) + theme(legend.position=none)
 p
 
 John Kane
 Kingston ON Canada
 
 
 -Original Message-
 From: petr.pi...@precheza.cz
 Sent: Fri, 13 Mar 2015 11:34:42 +
 To: mir.sa...@uef.fi, r-help@r-project.org
 Subject: Re: [R] graphs
 
 Hi
 
 Your example is not reproducible, but I presume you could use ggplot
 together with predict. However, I wonder how do you want to distinguish
 68 curves in one picture.
 I would
 
 Cheers
 Petr
 
 
 -Original Message-
 From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Mir
 Salam
 Sent: Sunday, March 08, 2015 10:57 PM
 To: r-help@r-project.org
 Subject: [R] graphs
 
 Dear all,
 
  I need help to get different 68  plots specifc fitted curves in one
 plot with respective field data observations (age vs dominant height).
 
 
 
 aspdomH2-groupedData(domH2~age|plotno,data=aspdomH2)
 
 
 
 names(aspdomH2)
 
 plotno, age, origin, soilcharacter, domH2,
 
 
 
 plotno-different plot no. I have 68 plots
 
 age- every plot have from age 5 to 30 years
 
 origin- two, native aspen and hybrid aspen
 
 domH2-dominant height
 
 soilcharacter-3, clay, silt and mold. both origin have different soil
 charcter
 
 
 
  then I fit model
 
 fm2cham.nlme-nlme(domH2~cham(age,b0,b1,b2),
data=aspdomH2,
fixed = list(b0~1+origin+soilcharacter,b1~ 1,b2 ~
 1+origin+soilcharacter),
random = b0+b2~1|plotno,
start=c(b0=26.3387,0,0,0,b1=0.1065,b2=1.9453,0,0,0),
weights=varPower(form = ~age, 0.5),
correlation=corAR1())
 
 
 
  parameter values
 
 Fixed effects: list(b0 ~ 1 + origin + soil character, b1 ~ 1, b2 ~ 1 +
 origin + soil character)
 
 Value
 b0.(Intercept) 21.081124
 b0.origin17.735064
 b0.soilcharactermold   10.689051
 b0.soilcharactersilt   3.906585
 b1  0.079035
 b2.(Intercept)  1.616360
 b2.origin1-0.384421
 b2.soilcharactermold  0.612285
 b2.soilcharactersilt  0.527462
 
 
 
 # I can easily get the augmented plot.  I got  different 68 plots
 specific curves.
 
 ###
 
 Any body can help me how can I will get all 68 plots specific fitted
 curves in one plot

Re: [R] graphs

2015-03-13 Thread David Winsemius

On Mar 13, 2015, at 9:27 AM, Mir Salam wrote:

 
 __Dear all,
 
 You can see the plot specif curves in the enclosed document. Inclusion of all 
 plot specif curves in one plot may not be look  good and finally it will be 
 unreadable. I am agree with Petrr and John. This graph is more readable.
 

You should remember that both lattice (and, I seem to vaguely remember, 
ggplot2) allow specification of three dimensions for plot layout, the third 
being for pages. For xyplot which I think is the underlying mechanism for 
nmle-plot methods, the parameter is `layout` which can be a vector of length 2 
or 3. This would only apply to multipage graphics devices but you seem to ahve 
figured out how to make PDFs so that should apply.

 
 Best regards
 Salam
 
 
 
 __
 From: John Kane jrkrid...@inbox.com
 Sent: Friday, March 13, 2015 4:12 PM
 To: PIKAL Petr; Mir Salam; r-help@r-project.org
 Subject: Re: [R] graphs
 
 @Petr
 
 I agree. I think Mir would get a totally unreadable graph. I occasionally 
 look at some spagetti graphs from climate research, and I find 8 - 12 lines 
 are incomprehensible (I'm not a subject matter expert)'
 
 @Mir
 
 Is there any logical way to break down the data ? I think Petr is correct in 
 that ggplot2 should be able to do it but I'd suggest thinking about, perhaps, 
 facetting the data to produce some reasonable number of panels.
 
 Here is a simple three-panel plot to illustrate what I mean but I have easily 
 produced a 9 or 10 panel plot which reduces visual clutter immensely.
 
 library(plyr) library(ggplot2)
 
 df1 = data.frame(basel_asset_class = 
 c(bank,bank,bank,bank,bank,bank,bank,corporate,corporate,corporate,corporate,corporate,corporate,corporate,sovereign,sovereign,sovereign,sovereign,sovereign,sovereign,sovereign),
  ratings = 
 c(AAA,AA,A,BBB,BB,B,CCC,AAA,AA,A,BBB,BB,B,CCC,AAA,AA,A,BBB,BB,B,CCC),
  default_probability = 
 c(0.0027,0.0029,0.0031,0.0034,0.0037,0.004,0.0043,0.0025,0.0024,0.0024,0.0023,0.0022,0.0021,0.0021,0.003,0.0031,0.0032,0.0033,0.0034,0.0035,0.0036))
 
 names(df1) - c(class, rate, default)
 
 p - ggplot(df1, aes(rate, default,colour=class)) + geom_point() + 
 facet_grid(class ~.) + theme(legend.position=none)
 p
 
 John Kane
 Kingston ON Canada
 
 
 -Original Message-
 From: petr.pi...@precheza.cz
 Sent: Fri, 13 Mar 2015 11:34:42 +
 To: mir.sa...@uef.fi, r-help@r-project.org
 Subject: Re: [R] graphs
 
 Hi
 
 Your example is not reproducible, but I presume you could use ggplot
 together with predict. However, I wonder how do you want to distinguish
 68 curves in one picture.
 I would
 
 Cheers
 Petr
 
 
 -Original Message-
 From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Mir
 Salam
 Sent: Sunday, March 08, 2015 10:57 PM
 To: r-help@r-project.org
 Subject: [R] graphs
 
 Dear all,
 
 I need help to get different 68  plots specifc fitted curves in one
 plot with respective field data observations (age vs dominant height).
 
 
 
 aspdomH2-groupedData(domH2~age|plotno,data=aspdomH2)
 
 
 
 names(aspdomH2)
 
 plotno, age, origin, soilcharacter, domH2,
 
 
 
 plotno-different plot no. I have 68 plots
 
 age- every plot have from age 5 to 30 years
 
 origin- two, native aspen and hybrid aspen
 
 domH2-dominant height
 
 soilcharacter-3, clay, silt and mold. both origin have different soil
 charcter
 
 
 
  then I fit model
 
 fm2cham.nlme-nlme(domH2~cham(age,b0,b1,b2),
   data=aspdomH2,
   fixed = list(b0~1+origin+soilcharacter,b1~ 1,b2 ~
 1+origin+soilcharacter),
   random = b0+b2~1|plotno,
   start=c(b0=26.3387,0,0,0,b1=0.1065,b2=1.9453,0,0,0),
   weights=varPower(form = ~age, 0.5),
   correlation=corAR1())
 
 
 
  parameter values
 
 Fixed effects: list(b0 ~ 1 + origin + soil character, b1 ~ 1, b2 ~ 1 +
 origin + soil character)
 
Value
 b0.(Intercept) 21.081124
 b0.origin17.735064
 b0.soilcharactermold   10.689051
 b0.soilcharactersilt   3.906585
 b1  0.079035
 b2.(Intercept)  1.616360
 b2.origin1-0.384421
 b2.soilcharactermold  0.612285
 b2.soilcharactersilt  0.527462
 
 
 
 # I can easily get the augmented plot.  I got  different 68 plots
 specific curves.
 
 ###
 
 Any body can help me how can I will get all 68 plots specific fitted
 curves in one plot with respective plot specific age and dominant
 height obervations? (x axis will represent age, y axis will represent
 dominant height and fitted curves of all 68 plots)
 
 
 
 
 
 
 
 
 
  [[alternative HTML version deleted]]
 
 __
 R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-
 guide.html

Re: [R] graphs

2015-03-13 Thread PIKAL Petr
Hi

Your example is not reproducible, but I presume you could use ggplot together 
with predict. However, I wonder how do you want to distinguish 68 curves in one 
picture.
I would

Cheers
Petr


 -Original Message-
 From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Mir
 Salam
 Sent: Sunday, March 08, 2015 10:57 PM
 To: r-help@r-project.org
 Subject: [R] graphs

 Dear all,

  I need help to get different 68  plots specifc fitted curves in one
 plot with respective field data observations (age vs dominant height).



 aspdomH2-groupedData(domH2~age|plotno,data=aspdomH2)



 names(aspdomH2)

 plotno, age, origin, soilcharacter, domH2,



 plotno-different plot no. I have 68 plots

 age- every plot have from age 5 to 30 years

 origin- two, native aspen and hybrid aspen

 domH2-dominant height

 soilcharacter-3, clay, silt and mold. both origin have different soil
 charcter



  then I fit model

 fm2cham.nlme-nlme(domH2~cham(age,b0,b1,b2),
data=aspdomH2,
fixed = list(b0~1+origin+soilcharacter,b1~ 1,b2 ~
 1+origin+soilcharacter),
random = b0+b2~1|plotno,
start=c(b0=26.3387,0,0,0,b1=0.1065,b2=1.9453,0,0,0),
weights=varPower(form = ~age, 0.5),
correlation=corAR1())



  parameter values

 Fixed effects: list(b0 ~ 1 + origin + soil character, b1 ~ 1, b2 ~ 1 +
 origin + soil character)

 Value
 b0.(Intercept) 21.081124
 b0.origin17.735064
 b0.soilcharactermold   10.689051
 b0.soilcharactersilt   3.906585
 b1  0.079035
 b2.(Intercept)  1.616360
 b2.origin1-0.384421
 b2.soilcharactermold  0.612285
 b2.soilcharactersilt  0.527462



 # I can easily get the augmented plot.  I got  different 68 plots
 specific curves.

 ###

 Any body can help me how can I will get all 68 plots specific fitted
 curves in one plot with respective plot specific age and dominant
 height obervations? (x axis will represent age, y axis will represent
 dominant height and fitted curves of all 68 plots)









   [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-
 guide.html
 and provide commented, minimal, self-contained, reproducible code.


Tento e-mail a jakékoliv k němu připojené dokumenty jsou důvěrné a jsou určeny 
pouze jeho adresátům.
Jestliže jste obdržel(a) tento e-mail omylem, informujte laskavě neprodleně 
jeho odesílatele. Obsah tohoto emailu i s přílohami a jeho kopie vymažte ze 
svého systému.
Nejste-li zamýšleným adresátem tohoto emailu, nejste oprávněni tento email 
jakkoliv užívat, rozšiřovat, kopírovat či zveřejňovat.
Odesílatel e-mailu neodpovídá za eventuální škodu způsobenou modifikacemi či 
zpožděním přenosu e-mailu.

V případě, že je tento e-mail součástí obchodního jednání:
- vyhrazuje si odesílatel právo ukončit kdykoliv jednání o uzavření smlouvy, a 
to z jakéhokoliv důvodu i bez uvedení důvodu.
- a obsahuje-li nabídku, je adresát oprávněn nabídku bezodkladně přijmout; 
Odesílatel tohoto e-mailu (nabídky) vylučuje přijetí nabídky ze strany příjemce 
s dodatkem či odchylkou.
- trvá odesílatel na tom, že příslušná smlouva je uzavřena teprve výslovným 
dosažením shody na všech jejích náležitostech.
- odesílatel tohoto emailu informuje, že není oprávněn uzavírat za společnost 
žádné smlouvy s výjimkou případů, kdy k tomu byl písemně zmocněn nebo písemně 
pověřen a takové pověření nebo plná moc byly adresátovi tohoto emailu případně 
osobě, kterou adresát zastupuje, předloženy nebo jejich existence je adresátovi 
či osobě jím zastoupené známá.

This e-mail and any documents attached to it may be confidential and are 
intended only for its intended recipients.
If you received this e-mail by mistake, please immediately inform its sender. 
Delete the contents of this e-mail with all attachments and its copies from 
your system.
If you are not the intended recipient of this e-mail, you are not authorized to 
use, disseminate, copy or disclose this e-mail in any manner.
The sender of this e-mail shall not be liable for any possible damage caused by 
modifications of the e-mail or by delay with transfer of the email.

In case that this e-mail forms part of business dealings:
- the sender reserves the right to end negotiations about entering into a 
contract in any time, for any reason, and without stating any reasoning.
- if the e-mail contains an offer, the recipient is entitled to immediately 
accept such offer; The sender of this e-mail (offer) excludes any acceptance of 
the offer on the part of the recipient containing any amendment or variation.
- the sender insists

Re: [R] graphs

2015-03-13 Thread John Kane
@Petr 

I agree. I think Mir would get a totally unreadable graph. I occasionally look 
at some spagetti graphs from climate research, and I find 8 - 12 lines are 
incomprehensible (I'm not a subject matter expert)'

@Mir

Is there any logical way to break down the data ? I think Petr is correct in 
that ggplot2 should be able to do it but I'd suggest thinking about, perhaps, 
facetting the data to produce some reasonable number of panels.

Here is a simple three-panel plot to illustrate what I mean but I have easily 
produced a 9 or 10 panel plot which reduces visual clutter immensely.

library(plyr) library(ggplot2)

df1 = data.frame(basel_asset_class = 
c(bank,bank,bank,bank,bank,bank,bank,corporate,corporate,corporate,corporate,corporate,corporate,corporate,sovereign,sovereign,sovereign,sovereign,sovereign,sovereign,sovereign),
 ratings = 
c(AAA,AA,A,BBB,BB,B,CCC,AAA,AA,A,BBB,BB,B,CCC,AAA,AA,A,BBB,BB,B,CCC),
 default_probability = 
c(0.0027,0.0029,0.0031,0.0034,0.0037,0.004,0.0043,0.0025,0.0024,0.0024,0.0023,0.0022,0.0021,0.0021,0.003,0.0031,0.0032,0.0033,0.0034,0.0035,0.0036))

names(df1) - c(class, rate, default)

p - ggplot(df1, aes(rate, default,colour=class)) + geom_point() + 
facet_grid(class ~.) + theme(legend.position=none) 
p

John Kane
Kingston ON Canada


 -Original Message-
 From: petr.pi...@precheza.cz
 Sent: Fri, 13 Mar 2015 11:34:42 +
 To: mir.sa...@uef.fi, r-help@r-project.org
 Subject: Re: [R] graphs
 
 Hi
 
 Your example is not reproducible, but I presume you could use ggplot
 together with predict. However, I wonder how do you want to distinguish
 68 curves in one picture.
 I would
 
 Cheers
 Petr
 
 
 -Original Message-
 From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Mir
 Salam
 Sent: Sunday, March 08, 2015 10:57 PM
 To: r-help@r-project.org
 Subject: [R] graphs
 
 Dear all,
 
  I need help to get different 68  plots specifc fitted curves in one
 plot with respective field data observations (age vs dominant height).
 
 
 
 aspdomH2-groupedData(domH2~age|plotno,data=aspdomH2)
 
 
 
 names(aspdomH2)
 
 plotno, age, origin, soilcharacter, domH2,
 
 
 
 plotno-different plot no. I have 68 plots
 
 age- every plot have from age 5 to 30 years
 
 origin- two, native aspen and hybrid aspen
 
 domH2-dominant height
 
 soilcharacter-3, clay, silt and mold. both origin have different soil
 charcter
 
 
 
  then I fit model
 
 fm2cham.nlme-nlme(domH2~cham(age,b0,b1,b2),
data=aspdomH2,
fixed = list(b0~1+origin+soilcharacter,b1~ 1,b2 ~
 1+origin+soilcharacter),
random = b0+b2~1|plotno,
start=c(b0=26.3387,0,0,0,b1=0.1065,b2=1.9453,0,0,0),
weights=varPower(form = ~age, 0.5),
correlation=corAR1())
 
 
 
  parameter values
 
 Fixed effects: list(b0 ~ 1 + origin + soil character, b1 ~ 1, b2 ~ 1 +
 origin + soil character)
 
 Value
 b0.(Intercept) 21.081124
 b0.origin17.735064
 b0.soilcharactermold   10.689051
 b0.soilcharactersilt   3.906585
 b1  0.079035
 b2.(Intercept)  1.616360
 b2.origin1-0.384421
 b2.soilcharactermold  0.612285
 b2.soilcharactersilt  0.527462
 
 
 
 # I can easily get the augmented plot.  I got  different 68 plots
 specific curves.
 
 ###
 
 Any body can help me how can I will get all 68 plots specific fitted
 curves in one plot with respective plot specific age and dominant
 height obervations? (x axis will represent age, y axis will represent
 dominant height and fitted curves of all 68 plots)
 
 
 
 
 
 
 
 
 
   [[alternative HTML version deleted]]
 
 __
 R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-
 guide.html
 and provide commented, minimal, self-contained, reproducible code.
 
 
 Tento e-mail a jakékoliv k němu připojené dokumenty jsou důvěrné a jsou
 určeny pouze jeho adresátům.
 Jestliže jste obdržel(a) tento e-mail omylem, informujte laskavě
 neprodleně jeho odesílatele. Obsah tohoto emailu i s přílohami a jeho
 kopie vymažte ze svého systému.
 Nejste-li zamýšleným adresátem tohoto emailu, nejste oprávněni tento
 email jakkoliv užívat, rozšiřovat, kopírovat či zveřejňovat.
 Odesílatel e-mailu neodpovídá za eventuální škodu způsobenou modifikacemi
 či zpožděním přenosu e-mailu.
 
 V případě, že je tento e-mail součástí obchodního jednání:
 - vyhrazuje si odesílatel právo ukončit kdykoliv jednání o uzavření
 smlouvy, a to z jakéhokoliv důvodu i bez uvedení důvodu.
 - a obsahuje-li nabídku, je adresát oprávněn nabídku bezodkladně
 přijmout; Odesílatel tohoto e-mailu (nabídky) vylučuje přijetí nabídky ze
 strany příjemce s dodatkem či odchylkou

Re: [R] graphs

2015-03-13 Thread Mir Salam

__Dear all,

You can see the plot specif curves in the enclosed document. Inclusion of all 
plot specif curves in one plot may not be look  good and finally it will be 
unreadable. I am agree with Petrr and John. This graph is more readable.


Best regards
Salam








__
From: John Kane jrkrid...@inbox.com
Sent: Friday, March 13, 2015 4:12 PM
To: PIKAL Petr; Mir Salam; r-help@r-project.org
Subject: Re: [R] graphs

@Petr

I agree. I think Mir would get a totally unreadable graph. I occasionally look 
at some spagetti graphs from climate research, and I find 8 - 12 lines are 
incomprehensible (I'm not a subject matter expert)'

@Mir

Is there any logical way to break down the data ? I think Petr is correct in 
that ggplot2 should be able to do it but I'd suggest thinking about, perhaps, 
facetting the data to produce some reasonable number of panels.

Here is a simple three-panel plot to illustrate what I mean but I have easily 
produced a 9 or 10 panel plot which reduces visual clutter immensely.

library(plyr) library(ggplot2)

df1 = data.frame(basel_asset_class = 
c(bank,bank,bank,bank,bank,bank,bank,corporate,corporate,corporate,corporate,corporate,corporate,corporate,sovereign,sovereign,sovereign,sovereign,sovereign,sovereign,sovereign),
 ratings = 
c(AAA,AA,A,BBB,BB,B,CCC,AAA,AA,A,BBB,BB,B,CCC,AAA,AA,A,BBB,BB,B,CCC),
 default_probability = 
c(0.0027,0.0029,0.0031,0.0034,0.0037,0.004,0.0043,0.0025,0.0024,0.0024,0.0023,0.0022,0.0021,0.0021,0.003,0.0031,0.0032,0.0033,0.0034,0.0035,0.0036))

names(df1) - c(class, rate, default)

p - ggplot(df1, aes(rate, default,colour=class)) + geom_point() + 
facet_grid(class ~.) + theme(legend.position=none)
p

John Kane
Kingston ON Canada


 -Original Message-
 From: petr.pi...@precheza.cz
 Sent: Fri, 13 Mar 2015 11:34:42 +
 To: mir.sa...@uef.fi, r-help@r-project.org
 Subject: Re: [R] graphs

 Hi

 Your example is not reproducible, but I presume you could use ggplot
 together with predict. However, I wonder how do you want to distinguish
 68 curves in one picture.
 I would

 Cheers
 Petr


 -Original Message-
 From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Mir
 Salam
 Sent: Sunday, March 08, 2015 10:57 PM
 To: r-help@r-project.org
 Subject: [R] graphs

 Dear all,

  I need help to get different 68  plots specifc fitted curves in one
 plot with respective field data observations (age vs dominant height).



 aspdomH2-groupedData(domH2~age|plotno,data=aspdomH2)



 names(aspdomH2)

 plotno, age, origin, soilcharacter, domH2,



 plotno-different plot no. I have 68 plots

 age- every plot have from age 5 to 30 years

 origin- two, native aspen and hybrid aspen

 domH2-dominant height

 soilcharacter-3, clay, silt and mold. both origin have different soil
 charcter



  then I fit model

 fm2cham.nlme-nlme(domH2~cham(age,b0,b1,b2),
data=aspdomH2,
fixed = list(b0~1+origin+soilcharacter,b1~ 1,b2 ~
 1+origin+soilcharacter),
random = b0+b2~1|plotno,
start=c(b0=26.3387,0,0,0,b1=0.1065,b2=1.9453,0,0,0),
weights=varPower(form = ~age, 0.5),
correlation=corAR1())



  parameter values

 Fixed effects: list(b0 ~ 1 + origin + soil character, b1 ~ 1, b2 ~ 1 +
 origin + soil character)

 Value
 b0.(Intercept) 21.081124
 b0.origin17.735064
 b0.soilcharactermold   10.689051
 b0.soilcharactersilt   3.906585
 b1  0.079035
 b2.(Intercept)  1.616360
 b2.origin1-0.384421
 b2.soilcharactermold  0.612285
 b2.soilcharactersilt  0.527462



 # I can easily get the augmented plot.  I got  different 68 plots
 specific curves.

 ###

 Any body can help me how can I will get all 68 plots specific fitted
 curves in one plot with respective plot specific age and dominant
 height obervations? (x axis will represent age, y axis will represent
 dominant height and fitted curves of all 68 plots)









   [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-
 guide.html
 and provide commented, minimal, self-contained, reproducible code.

 
 Tento e-mail a jakékoliv k němu připojené dokumenty jsou důvěrné a jsou
 určeny pouze jeho adresátům.
 Jestliže jste obdržel(a) tento e-mail omylem, informujte laskavě
 neprodleně jeho odesílatele. Obsah tohoto emailu i s přílohami a jeho
 kopie vymažte ze svého systému.
 Nejste-li zamýšleným adresátem tohoto emailu, nejste oprávněni tento
 email jakkoliv užívat, rozšiřovat, kopírovat či zveřejňovat.
 Odesílatel e-mailu neodpovídá za eventuální škodu způsobenou

[R] graphs

2015-03-08 Thread Mir Salam
Dear all,

 I need help to get different 68  plots specifc fitted curves in one plot with 
respective field data observations (age vs dominant height).



aspdomH2-groupedData(domH2~age|plotno,data=aspdomH2)



names(aspdomH2)

plotno, age, origin, soilcharacter, domH2,



plotno-different plot no. I have 68 plots

age- every plot have from age 5 to 30 years

origin- two, native aspen and hybrid aspen

domH2-dominant height

soilcharacter-3, clay, silt and mold. both origin have different soil charcter



 then I fit model

fm2cham.nlme-nlme(domH2~cham(age,b0,b1,b2),
   data=aspdomH2,
   fixed = list(b0~1+origin+soilcharacter,b1~ 1,b2 ~ 
1+origin+soilcharacter),
   random = b0+b2~1|plotno,
   start=c(b0=26.3387,0,0,0,b1=0.1065,b2=1.9453,0,0,0),
   weights=varPower(form = ~age, 0.5),
   correlation=corAR1())



 parameter values

Fixed effects: list(b0 ~ 1 + origin + soil character, b1 ~ 1, b2 ~ 1 + origin + 
soil character)

Value
b0.(Intercept) 21.081124
b0.origin17.735064
b0.soilcharactermold   10.689051
b0.soilcharactersilt   3.906585
b1  0.079035
b2.(Intercept)  1.616360
b2.origin1-0.384421
b2.soilcharactermold  0.612285
b2.soilcharactersilt  0.527462



# I can easily get the augmented plot.  I got  different 68 plots specific 
curves.

###

Any body can help me how can I will get all 68 plots specific fitted curves in 
one plot with respective plot specific age and dominant height obervations? (x 
axis will represent age, y axis will represent dominant height and fitted 
curves of all 68 plots)









[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] R graphs from database

2012-12-26 Thread David Osborne
Browsing the web recently, I came across what I think is a new utility for
generating an interactive, web-based R graph of data from a database. The
generated graph can be manipulated by a user to choose different data,
limits, etc. I would like to investigate using this with data from our
research project but unfortunately, I didn't bookmark it and it's no longer
in my browser history, nor can I find it with extensive Google searches.
Can anybody help with the name of the software, its URL, or suggestions of
where else to search, please?

Thanks!

David Osborne
MSc student
Department of Archaeology, University of Nottingham

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R graphs from database

2012-12-26 Thread Marc Schwartz

On Dec 26, 2012, at 6:34 AM, David Osborne daosbo...@gmail.com wrote:

 Browsing the web recently, I came across what I think is a new utility for
 generating an interactive, web-based R graph of data from a database. The
 generated graph can be manipulated by a user to choose different data,
 limits, etc. I would like to investigate using this with data from our
 research project but unfortunately, I didn't bookmark it and it's no longer
 in my browser history, nor can I find it with extensive Google searches.
 Can anybody help with the name of the software, its URL, or suggestions of
 where else to search, please?
 
 Thanks!
 
 David Osborne
 MSc student
 Department of Archaeology, University of Nottingham
 


Might be Shiny:

  http://www.rstudio.com/shiny/

Regards,

Marc Schwartz

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R graphs from database

2012-12-26 Thread Suzen, Mehmet
Hi David,

I suggest you to have a look at packages that can extract data from
sql or nosql databases and graphics. CRAN task views would help:

http://cran.r-project.org/web/views/Graphics.html

The point is there are lots of alternatives. If you would like to use
web-based visualisation d3 is becoming very popular. For that reason
I suggest the combination of ggplot2, D3 (http://d3js.org/) and extracting
data from databases using RODBC or RMySQL, depending on your
data source. A good web server interface is Rook,

Hope it helps,

Best,
-m



On 26 December 2012 13:34, David Osborne daosbo...@gmail.com wrote:
 Browsing the web recently, I came across what I think is a new utility for
 generating an interactive, web-based R graph of data from a database. The
 generated graph can be manipulated by a user to choose different data,
 limits, etc. I would like to investigate using this with data from our
 research project but unfortunately, I didn't bookmark it and it's no longer
 in my browser history, nor can I find it with extensive Google searches.
 Can anybody help with the name of the software, its URL, or suggestions of
 where else to search, please?

 Thanks!

 David Osborne
 MSc student
 Department of Archaeology, University of Nottingham

 [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R graphs from database

2012-12-26 Thread Ben Bolker
David Osborne daosborne at gmail.com writes:

 
 Browsing the web recently, I came across what I think is a new utility for
 generating an interactive, web-based R graph of data from a database. The
 generated graph can be manipulated by a user to choose different data,
 limits, etc. I would like to investigate using this with data from our
 research project but unfortunately, I didn't bookmark it and it's no longer
 in my browser history, nor can I find it with extensive Google searches.
 Can anybody help with the name of the software, its URL, or suggestions of
 where else to search, please?

  I agree that Shiny might be what you wanted, but I would also
point to

http://www.stat.ucla.edu/~jeroen/ggplot2/

as a possibly useful utility.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R graphs from database

2012-12-26 Thread David Osborne
Thanks, Marc — yes, it was Shiny that I'd seen. Thanks a lot!

regards
David


On 26 December 2012 16:31, Marc Schwartz marc_schwa...@me.com wrote:


 On Dec 26, 2012, at 6:34 AM, David Osborne daosbo...@gmail.com wrote:

  Browsing the web recently, I came across what I think is a new utility
 for
  generating an interactive, web-based R graph of data from a database. The
  generated graph can be manipulated by a user to choose different data,
  limits, etc. I would like to investigate using this with data from our
  research project but unfortunately, I didn't bookmark it and it's no
 longer
  in my browser history, nor can I find it with extensive Google searches.
  Can anybody help with the name of the software, its URL, or suggestions
 of
  where else to search, please?
 
  Thanks!
 
  David Osborne
  MSc student
  Department of Archaeology, University of Nottingham
 


 Might be Shiny:

   http://www.rstudio.com/shiny/

 Regards,

 Marc Schwartz



[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Graphs using R

2012-10-08 Thread Nethal Jajo
Dear,

I have a table with four columns similar to the following:

Factory Name  Production typeMonthsFreq

Factory 1   Car type 1   Jan.0

Factory 1   Car type 2   Feb.  1

Factory 2Car type 3  May 3



I need help in producing graphs;

1. I need to graph the production of the factories per month in Stacked 
columns

2. I need to graph the each of the production type by factory and month.



Regards

N.Jajo

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Graphs using R

2012-10-08 Thread FJ M




To start:
pdf(Auto_Analysis.pdf)
from the R console type:
? hist

For the histogram help page. 
If you show the R code for your data, I'll generate the actual code for the 
histogram. Thanks.
 From: nethal.j...@sydney.edu.au
 To: r-help@r-project.org
 Date: Mon, 8 Oct 2012 08:26:59 +
 Subject: [R] Graphs using R
 
 Dear,
 
 I have a table with four columns similar to the following:
 
 Factory Name  Production typeMonthsFreq
 
 Factory 1   Car type 1   Jan.0
 
 Factory 1   Car type 2   Feb.  1
 
 Factory 2Car type 3  May 3
 
 
 
 I need help in producing graphs;
 
 1. I need to graph the production of the factories per month in Stacked 
 columns
 
 2. I need to graph the each of the production type by factory and month.
 
 
 
 Regards
 
 N.Jajo
 
   [[alternative HTML version deleted]]
 
 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.

  
[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Graphs using R

2012-10-08 Thread PIKAL Petr
Hi

homework? No homewok policy here.

You can check e.g. ggplot2 package

Regards
Petr

 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
 project.org] On Behalf Of Nethal Jajo
 Sent: Monday, October 08, 2012 10:27 AM
 To: r-help@R-project.org
 Subject: [R] Graphs using R
 
 Dear,
 
 I have a table with four columns similar to the following:
 
 Factory Name  Production typeMonthsFreq
 
 Factory 1   Car type 1   Jan.
 0
 
 Factory 1   Car type 2   Feb.
 1
 
 Factory 2Car type 3  May
 3
 
 
 
 I need help in producing graphs;
 
 1. I need to graph the production of the factories per month in
 Stacked columns
 
 2. I need to graph the each of the production type by factory and
 month.
 
 
 
 Regards
 
 N.Jajo
 
   [[alternative HTML version deleted]]
 
 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-
 guide.html
 and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R graphs differ from exported one

2011-06-13 Thread Mark Seeto
I didn't include code because I wasn't asking for help; I was merely
commenting that I had seen the same thing happen. But thank you for
mentioning dev.off, which I had not heard of before.


On Mon, Jun 13, 2011 at 3:55 PM, Prof Brian Ripley
rip...@stats.ox.ac.uk wrote:
 Usually this happens when you forget to run dev.off(), as in that example.

 But we don't have the

   commented, minimal, self-contained, reproducible code.

 the posting guide and the footer of every R message asks for.

 On Sun, 12 Jun 2011, Mark Seeto wrote:


 Raptorista wrote:

 Now, the graph that appears is very nice: indeed it has a title, two
 axes with their labels and all the rest;
 but when I give commands

 postscript(file=plot.eps, onefile=FALSE)
 qqnorm (col)

 to save the graph to a file plot.eps to include it in a TeX, the file
 created has nothing to do with the former one: it only has the graph
 part, i.e. no title, no labels, no axes



 I use R under Windows, and I've seen the same sort of thing. I usually
 save
 graphs as PDF or PNG files, which works fine, but on the rare occasions
 I've
 tried to save graphs as Postscript, some of the graphs end up saving with
 bits missing.


 --
 View this message in context:
 http://r.789695.n4.nabble.com/R-graphs-differ-from-exported-one-tp3592553p3592915.html
 Sent from the R help mailing list archive at Nabble.com.

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


 --
 Brian D. Ripley,                  rip...@stats.ox.ac.uk
 Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
 University of Oxford,             Tel:  +44 1865 272861 (self)
 1 South Parks Road,                     +44 1865 272866 (PA)
 Oxford OX1 3TG, UK                Fax:  +44 1865 272595


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] R graphs differ from exported one

2011-06-12 Thread Massimiliano
Hello everybody! This is my first mail so I'll write a couple of lines
of self-introduction.
My name is Massimiliano, I'm from Italy and I'm studying Mathematical
Engineering.
I started using R in my Statistics course and have to use it to make a
project which I'll discuss at the end of the course.

The problem I'd like to ask you about follows.
Suppose I have imported a datafile with the classic command

dat - read.table('file', header=T)

and wanted to see if my data are Normal-like or not.
I can accomplish this with the command

qqnorm (col)

where 'col' is the column in the datafile 'file'.
Now, the graph that appears is very nice: indeed it has a title, two
axes with their labels and all the rest;
but when I give commands

postscript(file=plot.eps, onefile=FALSE)
qqnorm (col)

to save the graph to a file plot.eps to include it in a TeX, the file
created has nothing to do with the former one: it only has the graph
part, i.e. no title, no labels, no axes

I searched in the documentation but found nothing; the same on the
forum.
What should I do?
I'm running R 2.12.1 on Ubuntu Linux 10.04 LL 64-bit

Thanks for help to everybody :)
Massimiliano 


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R graphs differ from exported one

2011-06-12 Thread Joshua Wiley
Hmm, did you shut the device down afterward (i.e., call dev.off() )?
I do not have any logic why that would induce the behavior you say you
are getting, but this works just fine for me:

postscript(tmp.eps, onefile = TRUE)
qqnorm(rnorm(20))
dev.off()

and creates the attached file (possibly not attached for the list, but
you should get it).

Josh

On Sun, Jun 12, 2011 at 10:00 AM, Massimiliano massi.ly...@gmail.com wrote:
 Hello everybody! This is my first mail so I'll write a couple of lines
 of self-introduction.
 My name is Massimiliano, I'm from Italy and I'm studying Mathematical
 Engineering.
 I started using R in my Statistics course and have to use it to make a
 project which I'll discuss at the end of the course.

 The problem I'd like to ask you about follows.
 Suppose I have imported a datafile with the classic command

 dat - read.table('file', header=T)

 and wanted to see if my data are Normal-like or not.
 I can accomplish this with the command

 qqnorm (col)

 where 'col' is the column in the datafile 'file'.
 Now, the graph that appears is very nice: indeed it has a title, two
 axes with their labels and all the rest;
 but when I give commands

 postscript(file=plot.eps, onefile=FALSE)
 qqnorm (col)

 to save the graph to a file plot.eps to include it in a TeX, the file
 created has nothing to do with the former one: it only has the graph
 part, i.e. no title, no labels, no axes

 I searched in the documentation but found nothing; the same on the
 forum.
 What should I do?
 I'm running R 2.12.1 on Ubuntu Linux 10.04 LL 64-bit

 Thanks for help to everybody :)
 Massimiliano


        [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.




-- 
Joshua Wiley
Ph.D. Student, Health Psychology
University of California, Los Angeles
http://www.joshuawiley.com/


tmp.eps
Description: PostScript document
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R graphs differ from exported one

2011-06-12 Thread Mark Seeto

Raptorista wrote:
 
 Now, the graph that appears is very nice: indeed it has a title, two
 axes with their labels and all the rest;
 but when I give commands
 
 postscript(file=plot.eps, onefile=FALSE)
 qqnorm (col)
 
 to save the graph to a file plot.eps to include it in a TeX, the file
 created has nothing to do with the former one: it only has the graph
 part, i.e. no title, no labels, no axes
 
 

I use R under Windows, and I've seen the same sort of thing. I usually save
graphs as PDF or PNG files, which works fine, but on the rare occasions I've
tried to save graphs as Postscript, some of the graphs end up saving with
bits missing.


--
View this message in context: 
http://r.789695.n4.nabble.com/R-graphs-differ-from-exported-one-tp3592553p3592915.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R graphs differ from exported one

2011-06-12 Thread Prof Brian Ripley
Usually this happens when you forget to run dev.off(), as in that 
example.


But we don't have the

   commented, minimal, self-contained, reproducible code.

the posting guide and the footer of every R message asks for.

On Sun, 12 Jun 2011, Mark Seeto wrote:



Raptorista wrote:


Now, the graph that appears is very nice: indeed it has a title, two
axes with their labels and all the rest;
but when I give commands

postscript(file=plot.eps, onefile=FALSE)
qqnorm (col)

to save the graph to a file plot.eps to include it in a TeX, the file
created has nothing to do with the former one: it only has the graph
part, i.e. no title, no labels, no axes




I use R under Windows, and I've seen the same sort of thing. I usually save
graphs as PDF or PNG files, which works fine, but on the rare occasions I've
tried to save graphs as Postscript, some of the graphs end up saving with
bits missing.


--
View this message in context: 
http://r.789695.n4.nabble.com/R-graphs-differ-from-exported-one-tp3592553p3592915.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.



--
Brian D. Ripley,  rip...@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] graphs and arrays

2011-05-17 Thread Bogdan Tanasa
Dear all,

it might not be a R-related question, however, I would appreciate if anyone
could suggest a mathematical/statistical framework that integrates graphs
and arrays, and potentially has a R implementation.

to give an example : given a graph of interactions (gene1 --- gene2, gene3
--- gene5, etc), where each gene has set of features (eg expression,
activity), to classify the subgraphs based on the features of its nodes.

thanks very much,

bogdan

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] graphs of gamma, normal fit to a histogram are about half as large as they should be

2011-05-17 Thread Benjamin Caldwell
Rolf,

Taking out the scalar multiples did it. Thanks for that.


*Ben Caldwell*

PhD Candidate
University of California, Berkeley




On Sun, May 15, 2011 at 10:30 PM, Rolf Turner rolf.tur...@xtra.co.nzwrote:


 In your example it appears that you are plotting a histogram (on the
 frequency
 scale) and then superimposing scalar multiples of gamma and Gaussian
 densities.

 You should just plot a histogram (with frequency=FALSE) and then
 superimpose the
 densities --- without any scalar multipliers.

 If that doesn't work, please provide a minimal *reproducible* (no one but
 you
 has the ``rwb'' data object) example of the problem that you are having
 (as the posting guide requests).

 cheers,

 Rolf Turner



 On 16/05/11 17:01, Benjamin Caldwell wrote:

 Hmm; still missing something - hist defaults to frequencies, not prob.
 densities; and, I thought I'd scaled the fitted lines to the values in the
 data frame. Just going with it, I specified freq=FALSE, and the prob density
 was of course at a different order of magnitude than the lines.

  What are you trying to hint at?


 On Fri, May 13, 2011 at 6:05 PM, Rolf Turner rolf.tur...@xtra.co.nzwrote:

  On 14/05/11 10:00, Benjamin Caldwell wrote:

 Hello,

 I'm trying to compare the fit of two distributions, normal and gamma, to
 a
 histogram of my response variable.


 rate-mean(na.omit(rwb$post.f.crwn.length))/var(na.omit(rwb$post.f.crwn.length))
 shape-rate*mean(na.omit(rwb$post.f.crwn.length))
 hist((rwb$post.f.crwn.length), main=rwb$post.f.crwn.length)

 lines(seq(0.01,70,0.01),length(rwb$post.f.crwn.length)*dgamma(seq(0.01,70,0.01),shape,rate))

 lines(seq(0,70,0.1),length(na.omit(rwb$post.f.crwn.length))*dnorm(seq(0,70,.1),mean(na.omit(rwb$post.f.crwn.length)),sqrt(var(na.omit(rwb$post.f.crwn.length

 However, the height of the two curves are about 1/3 to 1/4 the height
 that
 they should be compared to the histogram. Any ideas?


  Yes.  Read the help on hist!  (Hint:  Pay particular attention to the
 freq and/or probability arguments.)

cheers,

Rolf Turner




attachment: success.png__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] graphs of gamma, normal fit to a histogram are about half as large as they should be

2011-05-15 Thread Benjamin Caldwell
Hmm; still missing something - hist defaults to frequencies, not prob.
densities; and, I thought I'd scaled the fitted lines to the values in the
data frame. Just going with it, I specified freq=FALSE, and the prob density
was of course at a different order of magnitude than the lines.

What are you trying to hint at?


On Fri, May 13, 2011 at 6:05 PM, Rolf Turner rolf.tur...@xtra.co.nz wrote:

 On 14/05/11 10:00, Benjamin Caldwell wrote:

 Hello,

 I'm trying to compare the fit of two distributions, normal and gamma, to a
 histogram of my response variable.


 rate-mean(na.omit(rwb$post.f.crwn.length))/var(na.omit(rwb$post.f.crwn.length))
 shape-rate*mean(na.omit(rwb$post.f.crwn.length))
 hist((rwb$post.f.crwn.length), main=rwb$post.f.crwn.length)

 lines(seq(0.01,70,0.01),length(rwb$post.f.crwn.length)*dgamma(seq(0.01,70,0.01),shape,rate))

 lines(seq(0,70,0.1),length(na.omit(rwb$post.f.crwn.length))*dnorm(seq(0,70,.1),mean(na.omit(rwb$post.f.crwn.length)),sqrt(var(na.omit(rwb$post.f.crwn.length

 However, the height of the two curves are about 1/3 to 1/4 the height that
 they should be compared to the histogram. Any ideas?


 Yes.  Read the help on hist!  (Hint:  Pay particular attention to the
 freq and/or probability arguments.)

cheers,

Rolf Turner


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] graphs of gamma, normal fit to a histogram are about half as large as they should be

2011-05-15 Thread Rolf Turner

In your example it appears that you are plotting a histogram (on the 
frequency
scale) and then superimposing scalar multiples of gamma and Gaussian 
densities.

You should just plot a histogram (with frequency=FALSE) and then 
superimpose the
densities --- without any scalar multipliers.

If that doesn't work, please provide a minimal *reproducible* (no one 
but you
has the ``rwb'' data object) example of the problem that you are having
(as the posting guide requests).

 cheers,

 Rolf Turner


On 16/05/11 17:01, Benjamin Caldwell wrote:
 Hmm; still missing something - hist defaults to frequencies, not prob. 
 densities; and, I thought I'd scaled the fitted lines to the values in 
 the data frame. Just going with it, I specified freq=FALSE, and the 
 prob density was of course at a different order of magnitude than the 
 lines.

 What are you trying to hint at?


 On Fri, May 13, 2011 at 6:05 PM, Rolf Turner rolf.tur...@xtra.co.nz 
 mailto:rolf.tur...@xtra.co.nz wrote:

 On 14/05/11 10:00, Benjamin Caldwell wrote:

 Hello,

 I'm trying to compare the fit of two distributions, normal and
 gamma, to a
 histogram of my response variable.

 
 rate-mean(na.omit(rwb$post.f.crwn.length))/var(na.omit(rwb$post.f.crwn.length))
 shape-rate*mean(na.omit(rwb$post.f.crwn.length))
 hist((rwb$post.f.crwn.length), main=rwb$post.f.crwn.length)
 
 lines(seq(0.01,70,0.01),length(rwb$post.f.crwn.length)*dgamma(seq(0.01,70,0.01),shape,rate))
 
 lines(seq(0,70,0.1),length(na.omit(rwb$post.f.crwn.length))*dnorm(seq(0,70,.1),mean(na.omit(rwb$post.f.crwn.length)),sqrt(var(na.omit(rwb$post.f.crwn.length

 However, the height of the two curves are about 1/3 to 1/4 the
 height that
 they should be compared to the histogram. Any ideas?


 Yes.  Read the help on hist!  (Hint:  Pay particular attention
 to the
 freq and/or probability arguments.)

cheers,

Rolf Turner




[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] graphs of gamma, normal fit to a histogram are about half as large as they should be

2011-05-13 Thread Benjamin Caldwell
Hello,

I'm trying to compare the fit of two distributions, normal and gamma, to a
histogram of my response variable.

rate-mean(na.omit(rwb$post.f.crwn.length))/var(na.omit(rwb$post.f.crwn.length))
shape-rate*mean(na.omit(rwb$post.f.crwn.length))
hist((rwb$post.f.crwn.length), main=rwb$post.f.crwn.length)
lines(seq(0.01,70,0.01),length(rwb$post.f.crwn.length)*dgamma(seq(0.01,70,0.01),shape,rate))
lines(seq(0,70,0.1),length(na.omit(rwb$post.f.crwn.length))*dnorm(seq(0,70,.1),mean(na.omit(rwb$post.f.crwn.length)),sqrt(var(na.omit(rwb$post.f.crwn.length

However, the height of the two curves are about 1/3 to 1/4 the height that
they should be compared to the histogram. Any ideas?

Thanks

*Ben Caldwell*

PhD Candidate
University of California, Berkeley
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] graphs of gamma, normal fit to a histogram are about half as large as they should be

2011-05-13 Thread Rolf Turner

On 14/05/11 10:00, Benjamin Caldwell wrote:

Hello,

I'm trying to compare the fit of two distributions, normal and gamma, to a
histogram of my response variable.

rate-mean(na.omit(rwb$post.f.crwn.length))/var(na.omit(rwb$post.f.crwn.length))
shape-rate*mean(na.omit(rwb$post.f.crwn.length))
hist((rwb$post.f.crwn.length), main=rwb$post.f.crwn.length)
lines(seq(0.01,70,0.01),length(rwb$post.f.crwn.length)*dgamma(seq(0.01,70,0.01),shape,rate))
lines(seq(0,70,0.1),length(na.omit(rwb$post.f.crwn.length))*dnorm(seq(0,70,.1),mean(na.omit(rwb$post.f.crwn.length)),sqrt(var(na.omit(rwb$post.f.crwn.length

However, the height of the two curves are about 1/3 to 1/4 the height that
they should be compared to the histogram. Any ideas?


Yes.  Read the help on hist!  (Hint:  Pay particular attention to the
freq and/or probability arguments.)

cheers,

Rolf Turner

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] review of R Graphs Cookbook

2011-01-25 Thread Patrick Burns

If you are foolish enough not to be
following R Bloggers via RSS or twitter,
you might miss:

http://www.portfolioprobe.com/2011/01/24/review-of-r-graphs-cookbook-by-hrishi-mittal/

Executive summary:
Extremely useful for new users, informative
to even quite seasoned users.

--
Patrick Burns
pbu...@pburns.seanet.com
twitter: @portfolioprobe
http://www.portfolioprobe.com/blog
http://www.burns-stat.com
(home of 'Some hints for the R beginner'
and 'The R Inferno')

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Can I save R graphs as a R objects

2010-01-15 Thread vikrant

Can I save R graphs as a R objects ? IF yes then if I click this R object 
can I edit my chart as in Excel.
Please suggest your views
-- 
View this message in context: 
http://n4.nabble.com/Can-I-save-R-graphs-as-a-R-objects-tp1014621p1014621.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Can I save R graphs as a R objects

2010-01-15 Thread Paul Hiemstra

vikrant wrote:
Can I save R graphs as a R objects ? IF yes then if I click this R object 
can I edit my chart as in Excel.

Please suggest your views
  
When you use the graphics functions from the lattice package (e.g. 
xyplot) you can save them to a file (see ?save) because it creates an 
object that represents the graph. When using the standard plot system I 
think this is not possible. But if you have the original data and an R 
script to make the graph, you don't need to save the graph explicitly. 
When processing the data for the graph takes a long time, you can run 
the script to just before making the graph and save all the appropriate 
objects to disk. Next time you only need to load your data (see ?load) 
and make the plot.


cheers,
Paul

--
Drs. Paul Hiemstra
Department of Physical Geography
Faculty of Geosciences
University of Utrecht
Heidelberglaan 2
P.O. Box 80.115
3508 TC Utrecht
Phone:  +3130 274 3113 Mon-Tue
Phone:  +3130 253 5773 Wed-Fri
http://intamap.geo.uu.nl/~paul

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Can I save R graphs as a R objects

2010-01-15 Thread Henrique Dallazuanna
You can use the recordPlot function from base package also

On Fri, Jan 15, 2010 at 7:26 AM, vikrant vikrant.shi...@tcs.com wrote:

 Can I save R graphs as a R objects ? IF yes then if I click this R object
 can I edit my chart as in Excel.
 Please suggest your views
 --
 View this message in context: 
 http://n4.nabble.com/Can-I-save-R-graphs-as-a-R-objects-tp1014621p1014621.html
 Sent from the R help mailing list archive at Nabble.com.

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.




-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40 S 49° 16' 22 O

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Can I save R graphs as a R objects

2010-01-15 Thread Rainer M Krug
On Fri, Jan 15, 2010 at 11:26 AM, vikrant vikrant.shi...@tcs.com wrote:


 Can I save R graphs as a R objects ?


I have seen that feature in the rkward GUI (which is by the way the BEST GUI
I have seen for a long time!), but I haven't played with that feature a lot,
so I can not comment on your second question.

By the way: rkward has SOME editing functionality for graphs, after they are
created (GUI type)

Cheers,

Rainer


IF yes then if I click this R object
 can I edit my chart as in Excel.
 Please suggest your views
 --
 View this message in context:
 http://n4.nabble.com/Can-I-save-R-graphs-as-a-R-objects-tp1014621p1014621.html
 Sent from the R help mailing list archive at Nabble.com.

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.




-- 
NEW GERMAN FAX NUMBER!!!

Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology,
UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Natural Sciences Building
Office Suite 2039
Stellenbosch University
Main Campus, Merriman Avenue
Stellenbosch
South Africa

Cell:   +27 - (0)83 9479 042
Fax:+27 - (0)86 516 2782
Fax:+49 - (0)321 2125 2244
email:  rai...@krugs.de

Skype:  RMkrug
Google: r.m.k...@gmail.com

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Can I save R graphs as a R objects

2010-01-15 Thread Liviu Andronic
On 1/15/10, vikrant vikrant.shi...@tcs.com wrote:
  can I edit my chart as in Excel.

Sort of, using playwith. You can always try to place the the plot call
inside playwith(). For example,
require(playwith)
playwith(plot(1:10))

Liviu

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Can I save R graphs as a R objects

2010-01-15 Thread Greg Snow
As a general rule, you really do not want to edit graphs by 
pointing/clicking/dragging.  It may seem an easy way to make some 
modifications, but in the long run it will become more of a headache than a 
help.  Better to create a script with the commands to create the plot, then if 
there is some change you want made, find the correct change or addition to the 
script and rerun the script.  That way when later on you have a similar project 
and want to create the same or similar graph, you can just run the script again 
with the new data, making any minor changes that you need.

On the other hand if you create the basic plot then edit it using 
point/click/drag style tools, then a couple months later when you find that 
there was a typo in the data and you need to recreate the graph (not as rare an 
event as we would like), you will first need to remember how you created the 
graph, then you will need to remember all the point/click/drag steps that you 
took (and redo them).  It is just simpler to use the script.

Having said that, if you still feel the need to modify a plot using a mouse 
(don't complain when you have to redo all the steps to redo the graph) then 
some options include:

Save the graph as an svg file (Cairo device, or other package) then use 
inkscape or other program to edit it.
Save the graph as a fig file and use xfig/winfig/jfig to edit it.
Save/copy the graph as a windows meta file and use Excel/Word to edit it.

But the R paradigm is really to use a script to create the correct graph in the 
first place rather than give an incorrect graph and expect the user to use 
non-reproducible post-hoc modifications.

Hope this helps,

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.s...@imail.org
801.408.8111


 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
 project.org] On Behalf Of vikrant
 Sent: Friday, January 15, 2010 2:27 AM
 To: r-help@r-project.org
 Subject: [R] Can I save R graphs as a R objects
 
 
 Can I save R graphs as a R objects ? IF yes then if I click this R
 object
 can I edit my chart as in Excel.
 Please suggest your views
 --
 View this message in context: http://n4.nabble.com/Can-I-save-R-graphs-
 as-a-R-objects-tp1014621p1014621.html
 Sent from the R help mailing list archive at Nabble.com.
 
 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-
 guide.html
 and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] graphs

2009-07-26 Thread Poersching
Mary A. Marion schrieb:
 Hello,

 I am plotting two distributions and want to draw a vertical line at
 the critical point 149.
 How can I stop it from going further up than the norm(140,15) curve?

 x-seq(75,225,0.1)
 plot(x,dnorm(x,mean=140, sd=15), type='l', col='navy')
 abline(v = 149, col = black)
 curve(dnorm(x,mean=150, sd=15),from=75, to=225, col='orange', add=TRUE)

 Thank you.

 Sincerely,
 Mary A. Marion

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.

Hey,
in your case you shouldn't use the abline command. Instead try segment like:
segments(149, 0, 149, dnorm(149,mean=140, sd=15))

Regards,
Christian Porsche



signature.asc
Description: OpenPGP digital signature
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] graphs

2009-07-26 Thread Radha Krishna
Hi Mary,

One can use arrows too...

Here is the code :

x-seq(75,225,0.1)
plot(x,dnorm(x,mean=140, sd=15), type='l', col='navy')
*arrows(149,0,149,dnorm(149,140,15),length=0)
*par(new=T)
plot(x,dnorm(x,mean=150, sd=15), type='l', col='orange',axes=F)


Regards
Radha


On Sun, Jul 26, 2009 at 5:09 AM, Mary A. Marion mms...@comcast.net wrote:

 Hello,

 I am plotting two distributions and want to draw a vertical line at the
 critical point 149.
 How can I stop it from going further up than the norm(140,15) curve?

 x-seq(75,225,0.1)
 plot(x,dnorm(x,mean=140, sd=15), type='l', col='navy')
 abline(v = 149, col = black)
 curve(dnorm(x,mean=150, sd=15),from=75, to=225, col='orange', add=TRUE)

 Thank you.

 Sincerely,
 Mary A. Marion

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] graphs

2009-07-25 Thread Mary A. Marion

Hello,

I am plotting two distributions and want to draw a vertical line at the 
critical point 149.

How can I stop it from going further up than the norm(140,15) curve?

x-seq(75,225,0.1)
plot(x,dnorm(x,mean=140, sd=15), type='l', col='navy')
abline(v = 149, col = black)
curve(dnorm(x,mean=150, sd=15),from=75, to=225, col='orange', add=TRUE)

Thank you.

Sincerely,
Mary A. Marion

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] graphs

2009-07-25 Thread baptiste auguie
Try with ?segments,

x-seq(75,225,0.1)
plot(x,dnorm(x,mean=140, sd=15), type='l', col='navy')
#abline(v = 149, col = black)
segments(149, 0, 149, dnorm(149,140,15))
curve(dnorm(x,mean=150, sd=15),from=75, to=225, col='orange', add=TRUE)


HTH,

baptiste



2009/7/26 Mary A. Marion mms...@comcast.net

 Hello,

 I am plotting two distributions and want to draw a vertical line at the
 critical point 149.
 How can I stop it from going further up than the norm(140,15) curve?

 x-seq(75,225,0.1)
 plot(x,dnorm(x,mean=140, sd=15), type='l', col='navy')
 abline(v = 149, col = black)
 curve(dnorm(x,mean=150, sd=15),from=75, to=225, col='orange', add=TRUE)

 Thank you.

 Sincerely,
 Mary A. Marion

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.




-- 

_

Baptiste Auguié

School of Physics
University of Exeter
Stocker Road,
Exeter, Devon,
EX4 4QL, UK

Phone: +44 1392 264187

http://newton.ex.ac.uk/research/emag
__

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] graphs

2009-07-25 Thread Steve Lianoglou

Hi Mary,

On Jul 25, 2009, at 7:39 PM, Mary A. Marion wrote:


Hello,

I am plotting two distributions and want to draw a vertical line at  
the critical point 149.

How can I stop it from going further up than the norm(140,15) curve?

x-seq(75,225,0.1)
plot(x,dnorm(x,mean=140, sd=15), type='l', col='navy')
abline(v = 149, col = black)
curve(dnorm(x,mean=150, sd=15),from=75, to=225, col='orange',  
add=TRUE)



Check ?segments

-steve

--
Steve Lianoglou
Graduate Student: Computational Systems Biology
  |  Memorial Sloan-Kettering Cancer Center
  |  Weill Medical College of Cornell University
Contact Info: http://cbio.mskcc.org/~lianos/contact

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Cross-platforms solution to export R graphs

2009-04-12 Thread cls59


Philippe Grosjean wrote:
 
 
 ..I would be happy to receive your comments and suggestions to improve 
 this document.
 All the best,
 
 PhG
 
 

LaTeX is my personal tool of choice and the vector format I use most often
is  http://sourceforge.net/projects/pgf/ PGF  (Portable Graphics Format),
implemented via a LaTeX package written by Till Tantu. There exists a very
nice converter called  http://sourceforge.net/projects/eps2pgf/ eps2pgf 
which is written in java and does an excellent job of translating R eps
output. The primary advantage of PGF is that figure text gets typeset by the
LaTeX engine instead of by R which unifies font choices and gives the final
document a very consistent, professional look. LaTeX commands, such as
mathematical typesetting, can also be embedded in the figure.

Along with a friend of mine, I have been working on a R package that extends
Sweave to include pgf graphics output. Currently 
http://www.rforge.net/pgfSweave pgfSweave  uses eps2pgf to perform the
conversions but a native R graphics device is planned to help speed up the
process. The package is currently very much a beta and has been developed
and tested on Mac OS X and runs quite well. Limited testing has been
conducted on Linux and Windows and we have produced documents on those
systems. Heavy development is expected to take place this summer.

PGF is a human-readable format and can be be easily annotated by adding
additional commands to the resulting file. However, editing the original
content is possible but difficult due to the lack of structure in the
eps2pgf output. The LaTeX environment can even be switched from pgfpicture
to tikzpicture which allows the use of TiKZ- a high level graphics language
built on top of PGF. TiKZ/PGF is easy to learn and the manual is one of the
best pieces of software documentation I have seen. 

Since I came across PGF a couple of years ago, Adobe Illustrator has
languished unused on my hard drive except for the occasional application of
Live Trace. An excellent showcase of PGF/TiKZ examples along with additional
tools is hosted at  http://www.texample.net Texample .

The end result of the PGF/TiKZ build process is a PDF which makes it very
portable.

All the best!

-Charlie

-
Charlie Sharpsteen
Undergraduate
Environmental Resources Engineering
Humboldt State University
-- 
View this message in context: 
http://www.nabble.com/Cross-platforms-solution-to-export-R-graphs-tp22970668p23016682.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Cross-platforms solution to export R graphs

2009-04-11 Thread Philippe Grosjean


..°}))
 ) ) ) ) )
( ( ( ( (Prof. Philippe Grosjean
 ) ) ) ) )
( ( ( ( (Numerical Ecology of Aquatic Systems
 ) ) ) ) )   Mons-Hainaut University, Belgium
( ( ( ( (
..

Liviu Andronic wrote:

On Thu, Apr 9, 2009 at 3:04 PM, Philippe Grosjean
phgrosj...@sciviews.org wrote:

The page is at:
http://wiki.r-project.org/rwiki/doku.php?id=tips:graphics-misc:export.


The article suggests to use Inksacpe for PDF - SVG conversion.
I've recently experimented this, but it seems that the graph loses
quality in the way. The resulting SVG seems pixelised and doesn't look
very well when zoomed. I searched within Inkscape, but found no
relevant options (only the resolution for export).
Would there be options to look out for in Inkscape (such as antialias,
or else)?
Liviu


 ?? I don't understand what you are doing here. It is not a question 
of exporting the graph at a given resolution, but to convert it from one 
vector format (PDF) to another one (SVG). In Inkscape, you use File - 
Open... for the first step, and File - Save as... for the second. Since 
it is a vector format, your graph should not look pixelised.

All the best,

PhG

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Cross-platforms solution to export R graphs

2009-04-11 Thread Philippe Grosjean

Liviu Andronic wrote:

Hello,

On Thu, Apr 9, 2009 at 3:04 PM, Philippe Grosjean
phgrosj...@sciviews.org wrote:

Cross-platforms solution to export R graphs


There is playwith, and latticist, which seem cross-platform (binaries
available for both MacWin). rattle uses latticist.


Yes, right.


Rcmdr can be used for saving graphs.


It is just a GUI on top of the described R functions.


JavaGD (used in JGR) saves PDF and EPS plots, but I was not very happy
with the quality of the graphics saved.


Yes, I should try.
Best,

Philippe


Liviu





__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Cross-platforms solution to export R graphs

2009-04-11 Thread Liviu Andronic
On Sat, Apr 11, 2009 at 3:20 PM, Philippe Grosjean
phgrosj...@sciviews.org wrote:
 format (PDF) to another one (SVG). In Inkscape, you use File - Open... for
 the first step, and File - Save as... for the second. Since it is a vector
 format, your graph should not look pixelised.

Yes, this is what I'm doing, but I still get funny results.
I have a PDF graph [1] that renders perfectly on my Linux system (say,
using Evince), and the SVG counterpart [2] (converted via Inkscape)
that appears with blurry lines at normal zoom level. But I just tried
couple of R SVGs in Opera at high zoom-ins (350%), and they render as
expected; guess I could only blame my image viewers.

Not exactly cross-platform, but there's also pdf2svg [3] for this type
of conversion.

Thanks,
Liviu

[1] http://s000.tinyupload.com/index.php?file_id=02313849491005544965
[2] http://s000.tinyupload.com/index.php?file_id=65971482254693721586
[3] http://www.cityinthesky.co.uk/pdf2svg.html


-- 
Do you know how to read?
http://www.alienetworks.com/srtest.cfm
Do you know how to write?
http://garbl.home.comcast.net/~garbl/stylemanual/e.htm#e-mail

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Cross-platforms solution to export R graphs

2009-04-11 Thread Philippe Grosjean

Liviu Andronic wrote:

On Sat, Apr 11, 2009 at 3:20 PM, Philippe Grosjean
phgrosj...@sciviews.org wrote:

format (PDF) to another one (SVG). In Inkscape, you use File - Open... for
the first step, and File - Save as... for the second. Since it is a vector
format, your graph should not look pixelised.


Yes, this is what I'm doing, but I still get funny results.
I have a PDF graph [1] that renders perfectly on my Linux system (say,
using Evince), and the SVG counterpart [2] (converted via Inkscape)
that appears with blurry lines at normal zoom level. But I just tried
couple of R SVGs in Opera at high zoom-ins (350%), and they render as
expected; guess I could only blame my image viewers.


It looks nice at all resolution with Firefox on my Mac.


Not exactly cross-platform, but there's also pdf2svg [3] for this type
of conversion.


Than you for the suggestion.
PhG


Thanks,
Liviu

[1] http://s000.tinyupload.com/index.php?file_id=02313849491005544965
[2] http://s000.tinyupload.com/index.php?file_id=65971482254693721586
[3] http://www.cityinthesky.co.uk/pdf2svg.html




__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Cross-platforms solution to export R graphs

2009-04-10 Thread Philippe Grosjean

Emmanuel Charpentier wrote:

Le jeudi 09 avril 2009 à 15:04 +0200, Philippe Grosjean a écrit :

Hello Rusers,

I have worked on a R Wiki page for solutions in exporting R graphs, 
especially, the often-asked questions:
- How can I export R graphs in vectorized format (EMF) for inclusion in 
  MS Word or OpenOffice outside of Windows?

- What is the best solution(s) for post-editing/annotating R graphs.

The page is at: 
http://wiki.r-project.org/rwiki/doku.php?id=tips:graphics-misc:export.


I would be happy to receive your comments and suggestions to improve 
this document.


Well, if you insist ...

The PDF import plugin in OpenOffice is still beta, and some report deem
it difficult to install correctly an/or flaky.  Having checked that both
MSWord (=2000) and OpenOffice (=2.4) import and display correctly (i.
e. vectorially, including fonts) EPS files, I switched to this format,
most notably for use with the marvellous Max Kuhn's odfWeave package,
which is a *must* for us working in state/administrative/corporate salt
mines, where \LaTeX is deemed obscene and plain \TeX causes seizures ...
The point is that this format doesn't need any intermediary step, thus
allowing for automatisation. Be aware, however, that the embedded EPS
images are not editable in-place by OpenOffice nor, as far as I know, by
MS Word. But my point was to *avoid* post-production as much as humanly
possible (I tend to be inhumanly lazy...).


Ok, I understand your point of view. I tend to consider PDF import buggy 
 in early trials, but now, the beta version seems fine and easy to 
install on all tested platforms.


Also, using odfWeave and avoiding post-edition of graphs as much as 
possible is certainly the best practice.


However, when you use EPS, you need a postscript printer to render the 
graphs. So, this is an additional constraint to consider.


I will emphasize a little bit more the qualities of EPS in the document.

Thanks.

PhG


HTH,

Emmanuel Charpentier


All the best,

PhG


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Cross-platforms solution to export R graphs

2009-04-10 Thread Philippe Grosjean
To further add to this discussion. I would like to propose 
**cross-platform** solutions, emphasizing that the proposed solutions 
should work on Windows, Mac OS X and Ubuntu, at least.


First of all, inclusion of a simple EPS graphs produced by R 2.9.0 with:

 setEPS(); postscript(TestGraph.eps, width = 7, height = 7)
 hist(rnorm(500), col = yellow)
 dev.off()

systematically crashes native OpenOffice 3.0.1 (build 9379) on my Mac OS 
X 10.4. When I try to recover the document, it crashes again. The 
document is lost (impossible to get the rest of it when the EPS file in 
included)! Further experience is probably needed, but I cannot recommend 
a solution that does not work on my Mac test machine.


Further arguments against EPS:
- No support of semi-transparent colors (rarely used, but...)
- It is the bitmap version that is displayed in the OOo document = not 
optimal in comparison with the use of EMF files, or with import into 
native shapes from PDF. This is particularly important because the PDF 
documents produced from OOo apparently also display the bitmap version 
of the EPS. Not nice when the intended result is in PDF form. It is then 
easier to use PNG files.


Obviously, further experimentation is required here.

Best,

PhG


Philippe Grosjean wrote:

Emmanuel Charpentier wrote:

Le jeudi 09 avril 2009 à 15:04 +0200, Philippe Grosjean a écrit :

Hello Rusers,

I have worked on a R Wiki page for solutions in exporting R graphs, 
especially, the often-asked questions:
- How can I export R graphs in vectorized format (EMF) for inclusion 
in   MS Word or OpenOffice outside of Windows?

- What is the best solution(s) for post-editing/annotating R graphs.

The page is at: 
http://wiki.r-project.org/rwiki/doku.php?id=tips:graphics-misc:export.


I would be happy to receive your comments and suggestions to improve 
this document.


Well, if you insist ...

The PDF import plugin in OpenOffice is still beta, and some report deem
it difficult to install correctly an/or flaky.  Having checked that both
MSWord (=2000) and OpenOffice (=2.4) import and display correctly (i.
e. vectorially, including fonts) EPS files, I switched to this format,
most notably for use with the marvellous Max Kuhn's odfWeave package,
which is a *must* for us working in state/administrative/corporate salt
mines, where \LaTeX is deemed obscene and plain \TeX causes seizures ...
The point is that this format doesn't need any intermediary step, thus
allowing for automatisation. Be aware, however, that the embedded EPS
images are not editable in-place by OpenOffice nor, as far as I know, by
MS Word. But my point was to *avoid* post-production as much as humanly
possible (I tend to be inhumanly lazy...).


Ok, I understand your point of view. I tend to consider PDF import buggy 
 in early trials, but now, the beta version seems fine and easy to 
install on all tested platforms.


Also, using odfWeave and avoiding post-edition of graphs as much as 
possible is certainly the best practice.


However, when you use EPS, you need a postscript printer to render the 
graphs. So, this is an additional constraint to consider.


I will emphasize a little bit more the qualities of EPS in the document.

Thanks.

PhG


HTH,

Emmanuel Charpentier


All the best,

PhG


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide 
http://www.R-project.org/posting-guide.html

and provide commented, minimal, self-contained, reproducible code.


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide 
http://www.R-project.org/posting-guide.html

and provide commented, minimal, self-contained, reproducible code.


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Cross-platforms solution to export R graphs

2009-04-10 Thread Liviu Andronic
Hello,

On Thu, Apr 9, 2009 at 3:04 PM, Philippe Grosjean
phgrosj...@sciviews.org wrote:
 Cross-platforms solution to export R graphs

There is playwith, and latticist, which seem cross-platform (binaries
available for both MacWin). rattle uses latticist.
Rcmdr can be used for saving graphs.
JavaGD (used in JGR) saves PDF and EPS plots, but I was not very happy
with the quality of the graphics saved.
Liviu



-- 
Do you know how to read?
http://www.alienetworks.com/srtest.cfm
Do you know how to write?
http://garbl.home.comcast.net/~garbl/stylemanual/e.htm#e-mail

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Cross-platforms solution to export R graphs

2009-04-10 Thread Liviu Andronic
On Thu, Apr 9, 2009 at 3:04 PM, Philippe Grosjean
phgrosj...@sciviews.org wrote:
 The page is at:
 http://wiki.r-project.org/rwiki/doku.php?id=tips:graphics-misc:export.

The article suggests to use Inksacpe for PDF - SVG conversion.
I've recently experimented this, but it seems that the graph loses
quality in the way. The resulting SVG seems pixelised and doesn't look
very well when zoomed. I searched within Inkscape, but found no
relevant options (only the resolution for export).
Would there be options to look out for in Inkscape (such as antialias,
or else)?
Liviu



-- 
Do you know how to read?
http://www.alienetworks.com/srtest.cfm
Do you know how to write?
http://garbl.home.comcast.net/~garbl/stylemanual/e.htm#e-mail

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Cross-platforms solution to export R graphs

2009-04-09 Thread Philippe Grosjean

Hello Rusers,

I have worked on a R Wiki page for solutions in exporting R graphs, 
especially, the often-asked questions:
- How can I export R graphs in vectorized format (EMF) for inclusion in 
 MS Word or OpenOffice outside of Windows?

- What is the best solution(s) for post-editing/annotating R graphs.

The page is at: 
http://wiki.r-project.org/rwiki/doku.php?id=tips:graphics-misc:export.


I would be happy to receive your comments and suggestions to improve 
this document.

All the best,

PhG
--
..°}))
 ) ) ) ) )
( ( ( ( (Prof. Philippe Grosjean
 ) ) ) ) )
( ( ( ( (Numerical Ecology of Aquatic Systems
 ) ) ) ) )   Mons-Hainaut University, Belgium
( ( ( ( (
..

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Cross-platforms solution to export R graphs

2009-04-09 Thread HBaize


Thank you Philippe. 
That is very helpful.



Philippe Grosjean wrote:
 
 Hello Rusers,
 
 I have worked on a R Wiki page for solutions in exporting R graphs, 
 especially, the often-asked questions:
 - How can I export R graphs in vectorized format (EMF) for inclusion in 
   MS Word or OpenOffice outside of Windows?
 - What is the best solution(s) for post-editing/annotating R graphs.
 
 The page is at: 
 http://wiki.r-project.org/rwiki/doku.php?id=tips:graphics-misc:export.
 
 I would be happy to receive your comments and suggestions to improve 
 this document.
 All the best,
 
 PhG
 -- 
 ..°}))
   ) ) ) ) )
 ( ( ( ( (Prof. Philippe Grosjean
   ) ) ) ) )
 ( ( ( ( (Numerical Ecology of Aquatic Systems
   ) ) ) ) )   Mons-Hainaut University, Belgium
 ( ( ( ( (
 ..
 
 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.
 
 

-- 
View this message in context: 
http://www.nabble.com/Cross-platforms-solution-to-export-R-graphs-tp22970668p22973759.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Cross-platforms solution to export R graphs

2009-04-09 Thread Emmanuel Charpentier
Le jeudi 09 avril 2009 à 15:04 +0200, Philippe Grosjean a écrit :
 Hello Rusers,
 
 I have worked on a R Wiki page for solutions in exporting R graphs, 
 especially, the often-asked questions:
 - How can I export R graphs in vectorized format (EMF) for inclusion in 
   MS Word or OpenOffice outside of Windows?
 - What is the best solution(s) for post-editing/annotating R graphs.
 
 The page is at: 
 http://wiki.r-project.org/rwiki/doku.php?id=tips:graphics-misc:export.
 
 I would be happy to receive your comments and suggestions to improve 
 this document.

Well, if you insist ...

The PDF import plugin in OpenOffice is still beta, and some report deem
it difficult to install correctly an/or flaky.  Having checked that both
MSWord (=2000) and OpenOffice (=2.4) import and display correctly (i.
e. vectorially, including fonts) EPS files, I switched to this format,
most notably for use with the marvellous Max Kuhn's odfWeave package,
which is a *must* for us working in state/administrative/corporate salt
mines, where \LaTeX is deemed obscene and plain \TeX causes seizures ...
The point is that this format doesn't need any intermediary step, thus
allowing for automatisation. Be aware, however, that the embedded EPS
images are not editable in-place by OpenOffice nor, as far as I know, by
MS Word. But my point was to *avoid* post-production as much as humanly
possible (I tend to be inhumanly lazy...).

HTH,

Emmanuel Charpentier

 All the best,
 
 PhG

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Question about R graphs

2008-10-22 Thread legendy

Hello all,

I have a question about CODA. Using my R code as bellow, I drew two graphs
(the data comes from the example of the speed of light in the Gelman’s book
“Bayesian Data Analysis (Second edition)” (page 77)). My R code is:
 
library(R2WinBUGS)
 
y=c(28, 26, 33, 24, 34, -44, 27, 16, 40, -2, 29, 22, 24, 21, 25, 30, 23, 29,
31,
19, 24, 20, 36, 32, 36, 28, 25, 21, 28, 29, 37, 25, 28, 26, 30, 32, 36,
26, 
30, 22, 36, 23, 27, 27, 28, 27, 31, 27, 26, 33, 26, 32, 32, 24, 39, 28,
24, 
25, 32, 25, 29, 27, 28, 29, 16, 23) 
 
n=length(y)
 
data=list(n,y)
 
inits=function() {list(mu=runif(1,-5,5),tau=runif(1,0.01,10))}
   
parameters=c(mu,sigma)
   
sim=bugs(data,inits,parameters,U:/my BUGS
code.txt,n.chains=3,n.iter=1000,debug=T)
 
library(coda)
 
y=sim$sims.array
 
x1=mcmc(y[,1,])  #mu,sigma, and deviance from the chain 1
x2=mcmc(y[,2,])  #mu,sigma, and deviance from the chain 2
x3=mcmc(y[,3,])  #mu,sigma, and deviance from the chain 3
 
x=mcmc.list(x1,x2,x3)
 
plot(x)
 
gelman.plot(x)

# my BUGS code is (copy and save as a txt file):

model
{
  for(i in 1:n)
  {
y[i]~dnorm(mu,tau)  
  }

  mu~dnorm(0.0,0.001)   
  tau~dgamma(0.001,0.001) 
  sigma-1/sqrt(tau)
}

As you see, I set 3 chains and 1000 iterations, so there should be 1500
simulation samples after removed the first 500 samples for each chain (burn
in). But from the density graph, there indicated only N=500. Why N=500? But
not 1500.
 
From another graph produced by “gelman.plot”, we can see that the x axis is
labeled as “last iteration in chain”. What is the last iteration in chain? I
set 3 chains, which chain was the result calculated based on?

Thank you very much.

Legendy

-- 
View this message in context: 
http://www.nabble.com/Question-about-R-graphs-tp20117061p20117061.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] graphs in R

2008-10-13 Thread guria

How Graphs in R with leveling of point can be done?
Please help.
-- 
View this message in context: 
http://www.nabble.com/graphs-in-R-tp19955281p19955281.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] graphs in R

2008-10-13 Thread stephen sefick
Do you have an example.  I am not sure what you mean.

On Mon, Oct 13, 2008 at 9:48 AM, guria [EMAIL PROTECTED] wrote:

 How Graphs in R with leveling of point can be done?
 Please help.
 --
 View this message in context: 
 http://www.nabble.com/graphs-in-R-tp19955281p19955281.html
 Sent from the R help mailing list archive at Nabble.com.

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.




-- 
Stephen Sefick
Research Scientist
Southeastern Natural Sciences Academy

Let's not spend our time and resources thinking about things that are
so little or so large that all they really do for us is puff us up and
make us feel like gods.  We are mammals, and have not exhausted the
annoying little problems of being mammals.

-K. Mullis

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] graphs for pretest data

2008-08-24 Thread Jim Lemon
On Sat, 2008-08-23 at 12:04 -0400, Juliet Hannah wrote:
 Is there an easy way to make graphs for the following data. I have
 pretest and posttest scores for men and
 women. I would like to form a 'titlted segment' plot for the data.
 That is, make segments joining the scores,
 with different types of segments for men and women.
 
 Example data:
 
 menpre - c(43,42,26,39,60,60,46)
 menpost - c(40,41,36,42,54,58,43)
 
 womenpre - c(46,56,81,56,70,70)
 womenpost - c(44,52,81,59,69,68)
 
Hi Juliet,
This looks like spread.labels in the plotrix package might do the job.
Check the second example.

Jim

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] graphs for pretest data

2008-08-23 Thread Juliet Hannah
Is there an easy way to make graphs for the following data. I have
pretest and posttest scores for men and
women. I would like to form a 'titlted segment' plot for the data.
That is, make segments joining the scores,
with different types of segments for men and women.

Example data:

menpre - c(43,42,26,39,60,60,46)
menpost - c(40,41,36,42,54,58,43)

womenpre - c(46,56,81,56,70,70)
womenpost - c(44,52,81,59,69,68)

Thanks!

Juliet

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] graphs for pretest data

2008-08-23 Thread John Kane
?plot ?lines

Something like this perhaps

plot( menpre, type=l, col=red)
lines(menpost, col=blue)
lines(womenpre,col=green
lines(womenpost, col= orange)

also have a look at ?par for various options




--- On Sat, 8/23/08, Juliet Hannah [EMAIL PROTECTED] wrote:

 From: Juliet Hannah [EMAIL PROTECTED]
 Subject: [R] graphs for pretest data
 To: r-help@r-project.org
 Received: Saturday, August 23, 2008, 12:04 PM
 Is there an easy way to make graphs for the following data.
 I have
 pretest and posttest scores for men and
 women. I would like to form a 'titlted segment'
 plot for the data.
 That is, make segments joining the scores,
 with different types of segments for men and women.
 
 Example data:
 
 menpre - c(43,42,26,39,60,60,46)
 menpost - c(40,41,36,42,54,58,43)
 
 womenpre - c(46,56,81,56,70,70)
 womenpost - c(44,52,81,59,69,68)
 
 Thanks!
 
 Juliet
 
 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained,
 reproducible code.


  __
[[elided Yahoo spam]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] graphs for pretest data

2008-08-23 Thread Michael Kubovy
Dear Juliet,

Perhaps start here:

require(lattice)
mwpp - data.frame(y = c(43,42,26,39,60,60,46,40,41,36,42,54,
58,43,46,56,81,56,70,70,44,52,81,59,69,68),
sex = rep(c(rep('men', 14), rep('women', 12))),
pp = c(rep(c('pre', 'post'), each = 7), rep(c('pre', 'post'), each =  
6)),
sub = c(1:7, 1:7, 8:13, 8:13))
xyplot(y ~ pp | sex, groups = sub, type = 'b', mwpp)

_
Professor Michael Kubovy
University of Virginia
Department of Psychology
USPS: P.O.Box 400400Charlottesville, VA 22904-4400
Parcels:Room 102Gilmer Hall
 McCormick RoadCharlottesville, VA 22903
Office:B011+1-434-982-4729
Lab:B019+1-434-982-4751
Fax:+1-434-982-4766
WWW:http://www.people.virginia.edu/~mk9y/

On Aug 23, 2008, at 12:04 PM, Juliet Hannah wrote:

 Is there an easy way to make graphs for the following data. I have
 pretest and posttest scores for men and
 women. I would like to form a 'titlted segment' plot for the data.
 That is, make segments joining the scores,
 with different types of segments for men and women.

 Example data:

 menpre - c(43,42,26,39,60,60,46)
 menpost - c(40,41,36,42,54,58,43)

 womenpre - c(46,56,81,56,70,70)
 womenpost - c(44,52,81,59,69,68)

 Thanks!

 Juliet

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] graphs for pretest data

2008-08-23 Thread hadley wickham
On Sat, Aug 23, 2008 at 1:10 PM, Michael Kubovy [EMAIL PROTECTED] wrote:
 Dear Juliet,

 Perhaps start here:

 require(lattice)
 mwpp - data.frame(y = c(43,42,26,39,60,60,46,40,41,36,42,54,
58,43,46,56,81,56,70,70,44,52,81,59,69,68),
sex = rep(c(rep('men', 14), rep('women', 12))),
pp = c(rep(c('pre', 'post'), each = 7), rep(c('pre', 'post'), each =
 6)),
sub = c(1:7, 1:7, 8:13, 8:13))

Or in ggplot2:

library(ggplot2)
qplot(pp, y, data=mwpp, geom=c(point,line), group = sub, colour=sex)
qplot(pp, y, data=mwpp, geom=c(point,line), group = sub, facets = .  ~ sex)

The key is to get your data into a data frame with variables that
explicitly label the experimental units, as Michael did for you.

Hadley


-- 
http://had.co.nz/

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Graphs in R

2008-06-30 Thread Leandro Marino
Hi list,

I want to make a lot of graphics to my end course project. So, i was using
this sintax:


jpeg(filename = graf01.jpg, width = 1024, height = 1024,
 units = px, pointsize = 25, quality = 100, bg = grey95,
 res = NA, restoreConsole = TRUE)
i=1
par(mfrow=c(4,1),col=grey90,font.lab=2)
hist(sul[,i+2],nclass=75,xlab=Região
Sul,ylab=Freqüência,col=antiquewhite4,main=)
hist(PR[,i+2],nclass=75,xlab=Paraná,ylab=Freqüência,col=antiquewhite4,
main=)
hist(SC[,i+2],nclass=75,xlab=Santa
Catarina,ylab=Freqüência,col=antiquewhite4,main=)
hist(RS[,i+2],nclass=75,xlab=Rio Grande do
Sul,ylab=Freqüência,col=antiquewhite4,main=)
dev.off()

But, I want to know how can I create an for to do that. Like that:

for(i in 1:250){
jpeg(filename = graf01.jpg, width = 1024, height = 1024,
 units = px, pointsize = 25, quality = 100, bg = grey95,
 res = NA, restoreConsole = TRUE)
par(mfrow=c(4,1),col=grey90,font.lab=2)
hist(sul[,i+2],nclass=75,xlab=Região
Sul,ylab=Freqüência,col=antiquewhite4,main=)
hist(PR[,i+2],nclass=75,xlab=Paraná,ylab=Freqüência,col=antiquewhite4,
main=)
hist(SC[,i+2],nclass=75,xlab=Santa
Catarina,ylab=Freqüência,col=antiquewhite4,main=)
hist(RS[,i+2],nclass=75,xlab=Rio Grande do
Sul,ylab=Freqüência,col=antiquewhite4,main=)
dev.off()
}

The problem is the name of the file, I want to do something like grafi.jpg
where i goes from 1 to 250.

Thanks a lot for the help.


Best Regards,
Leandro Marino

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Graphs in R

2008-06-30 Thread Gabor Csardi
paste(sep=, graf, 1:250, .jpg)

See ?paste,
G.

On Mon, Jun 30, 2008 at 11:58:51AM -0300, Leandro Marino wrote:
 Hi list,
 
 I want to make a lot of graphics to my end course project. So, i was using
 this sintax:
 
 
 jpeg(filename = graf01.jpg, width = 1024, height = 1024,
  units = px, pointsize = 25, quality = 100, bg = grey95,
  res = NA, restoreConsole = TRUE)
 i=1
 par(mfrow=c(4,1),col=grey90,font.lab=2)
 hist(sul[,i+2],nclass=75,xlab=Região
 Sul,ylab=Freqüência,col=antiquewhite4,main=)
 hist(PR[,i+2],nclass=75,xlab=Paraná,ylab=Freqüência,col=antiquewhite4,
 main=)
 hist(SC[,i+2],nclass=75,xlab=Santa
 Catarina,ylab=Freqüência,col=antiquewhite4,main=)
 hist(RS[,i+2],nclass=75,xlab=Rio Grande do
 Sul,ylab=Freqüência,col=antiquewhite4,main=)
 dev.off()
 
 But, I want to know how can I create an for to do that. Like that:
 
 for(i in 1:250){
 jpeg(filename = graf01.jpg, width = 1024, height = 1024,
  units = px, pointsize = 25, quality = 100, bg = grey95,
  res = NA, restoreConsole = TRUE)
 par(mfrow=c(4,1),col=grey90,font.lab=2)
 hist(sul[,i+2],nclass=75,xlab=Região
 Sul,ylab=Freqüência,col=antiquewhite4,main=)
 hist(PR[,i+2],nclass=75,xlab=Paraná,ylab=Freqüência,col=antiquewhite4,
 main=)
 hist(SC[,i+2],nclass=75,xlab=Santa
 Catarina,ylab=Freqüência,col=antiquewhite4,main=)
 hist(RS[,i+2],nclass=75,xlab=Rio Grande do
 Sul,ylab=Freqüência,col=antiquewhite4,main=)
 dev.off()
 }
 
 The problem is the name of the file, I want to do something like grafi.jpg
 where i goes from 1 to 250.
 
 Thanks a lot for the help.
 
 
 Best Regards,
 Leandro Marino
 
 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.

-- 
Csardi Gabor [EMAIL PROTECTED]UNIL DGM

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Graphs in R

2008-06-30 Thread Henrique Dallazuanna
Try:

for(i in 1:10){
jpeg(sprintf(Rplots%02d.jpg, i))
   plot(rnorm(20))
   dev.off()
}

On Mon, Jun 30, 2008 at 11:58 AM, Leandro Marino [EMAIL PROTECTED]
wrote:

 Hi list,

 I want to make a lot of graphics to my end course project. So, i was using
 this sintax:


 jpeg(filename = graf01.jpg, width = 1024, height = 1024,
 units = px, pointsize = 25, quality = 100, bg = grey95,
 res = NA, restoreConsole = TRUE)
 i=1
 par(mfrow=c(4,1),col=grey90,font.lab=2)
 hist(sul[,i+2],nclass=75,xlab=Região
 Sul,ylab=Freqüência,col=antiquewhite4,main=)

 hist(PR[,i+2],nclass=75,xlab=Paraná,ylab=Freqüência,col=antiquewhite4,
 main=)
 hist(SC[,i+2],nclass=75,xlab=Santa
 Catarina,ylab=Freqüência,col=antiquewhite4,main=)
 hist(RS[,i+2],nclass=75,xlab=Rio Grande do
 Sul,ylab=Freqüência,col=antiquewhite4,main=)
 dev.off()

 But, I want to know how can I create an for to do that. Like that:

 for(i in 1:250){
 jpeg(filename = graf01.jpg, width = 1024, height = 1024,
 units = px, pointsize = 25, quality = 100, bg = grey95,
 res = NA, restoreConsole = TRUE)
 par(mfrow=c(4,1),col=grey90,font.lab=2)
 hist(sul[,i+2],nclass=75,xlab=Região
 Sul,ylab=Freqüência,col=antiquewhite4,main=)

 hist(PR[,i+2],nclass=75,xlab=Paraná,ylab=Freqüência,col=antiquewhite4,
 main=)
 hist(SC[,i+2],nclass=75,xlab=Santa
 Catarina,ylab=Freqüência,col=antiquewhite4,main=)
 hist(RS[,i+2],nclass=75,xlab=Rio Grande do
 Sul,ylab=Freqüência,col=antiquewhite4,main=)
 dev.off()
 }

 The problem is the name of the file, I want to do something like grafi.jpg
 where i goes from 1 to 250.

 Thanks a lot for the help.


 Best Regards,
 Leandro Marino

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.




-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40 S 49° 16' 22 O

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] graphs with gradients of colors

2007-09-17 Thread Van Dongen Stefan
Hi All,
 
I would like to fill the area under a curve with a gradient of colors. Are 
there any packages or trick I could use
 
Thanks
 
Stefan
 
 
Stefan Van Dongen
Antwerp

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.