Re: [R] Help me please: gplot, facets_wrap and ordering of x axis dates

2013-05-15 Thread David Lyon
Thank you very much for your help and time.

That works very nicelyThanks again!



- Original Message -
From: John Kane 
To: David Lyon ; r-help 
Cc: 
Sent: Wednesday, May 15, 2013 9:36 AM
Subject: Re: [R] Help me please: gplot, facets_wrap and ordering of x axis
  dates

My appologies, I was in a rush yesterday and a) completely misread the post  
and b) did not scroll down far enough.  David W is correct that you need to do 
something with the data set. <.6 is not a number. 

Also, as David says,  it  sounds like your coversion using as.Date did not work 
out.  The difficulty from here is that if is graphs then it sounds like your 
actual data.frame is not exactly the same as what I get if I try to read in the 
data you included. hat is why supplying the data using something like dput() is 
important.

I don't see how got something to plot.  However if I get rid of the < in the 
text file and read in the data , etc I get something that may look like what 
you want.  See code below.  I renamed the data.frame to dat1, just because it 
was handy and renamed the variable date to date1 since date is a reserved word 
in R . Type date() to see what I mean.

Again my applogies for completely misreading the problem
John Kane
Kingston ON Canada
#
library(lubridate)
library(ggplot2)
  
dat1  <-   structure(list(id = c(1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 4L, 
4L, 4L, 4L, 4L, 4L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 6L, 6L, 
6L, 6L, 6L, 8L, 8L, 8L, 8L, 8L, 9L, 9L, 9L, 9L, 9L, 9L, 10L, 
10L, 10L, 10L, 10L, 11L, 11L, 11L, 11L, 11L, 11L, 12L, 12L, 12L, 
12L, 12L, 13L, 13L, 13L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 
14L, 14L, 14L, 14L, 14L, 15L, 15L, 15L, 15L, 16L, 16L, 16L, 16L, 
16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 17L, 17L, 18L, 18L, 18L, 
18L, 18L), date1 = c("8/16/10", "10/25/10", "11/8/10", "11/22/10", 
"12/6/10", "8/18/10", "10/25/10", "11/8/10", "11/22/10", "8/20/10", 
"10/25/10", "11/8/10", "11/22/10", "12/6/10", "10/26/11", "6/4/09", 
"6/18/10", "8/25/10", "9/15/10", "10/25/10", "11/8/10", "11/22/10", 
"12/6/10", "11/4/11", "9/23/10", "10/25/10", "11/8/10", "11/22/10", 
"12/6/10", "8/25/10", "10/25/10", "11/8/10", "12/6/10", "6/11/12", 
"10/6/10", "11/22/10", "2/2/11", "2/16/11", "3/2/11", "3/16/11", 
"9/14/10", "2/2/11", "2/16/11", "3/2/11", "3/16/11", "8/20/10", 
"2/2/11", "2/16/11", "3/2/11", "3/16/11", "10/26/11", "12/14/10", 
"2/2/11", "2/16/11", "3/2/11", "3/16/11", "11/13/09", "8/19/10", 
"2/2/11", "2/6/13", "4/24/13", "8/18/10", "10/5/10", "10/27/10", 
"2/2/11", "2/16/11", "3/2/11", "3/16/11", "6/29/11", "8/15/11", 
"8/15/12", "10/31/12", "12/10/10", "2/2/11", "3/2/11", "3/16/11", 
"12/17/10", "1/25/11", "2/2/11", "2/2/11", "2/16/11", "3/2/11", 
"3/16/11", "3/20/12", "3/26/12", "3/30/12", "4/2/12", "4/23/12", 
"11/17/11", "12/9/11", "2/25/13", "3/11/13", "3/25/13", "4/10/13", 
"4/22/13"), value = c(0.16, 0.16, 0.42, 0.81, 0.16, 2.93, 2.4, 
1.36, 1.22, 0.77, 0.85, 1.22, 0.21, 1.81, 0.54, 1.33, 1.32, 2.5, 
1.3, 1.1, 0.66, 0.84, 7.42, 1.21, 0.97, 2.25, 0.51, 0.53, 0.41, 
3.14, 3.58, 2.41, 2.08, 3.2, 0.24, 0.34, 0.58, 0.54, 0.25, 0.39, 
0.28, 0.19, 0.42, 0.39, 0.26, 0.16, 0.16, 0.16, 0.16, 1.76, 0.16, 
0.48, 1.2, 0.44, 0.32, 0.34, 0.73, 3.32, 13.7, 1.35, 0.85, 0.66, 
0.68, 0.53, 0.54, 0.49, 0.31, 0.4, 0.53, 0.55, 0.94, 0.74, 0.4, 
0.44, 0.38, 0.43, 0.18, 0.16, 0.53, 0.54, 0.46, 0.29, 0.2, 0.18, 
0.23, 0.52, 0.33, 0.3, 3.35, 2.56, 18.1, 14.9, 11.1, 8.47, 15.9
)), .Names = c("id", "date1", "value"), class = "data.frame", row.names = c(NA, 
-95L))
  
str(dat1)
dat1$date1  <-  mdy(dat1$date1) # using lubridate 
str(dat1) #  POSIXct object not date object as in your original code

ggplot(data=dat1) + geom_line(aes(x=date1, y=value, group=id, colour=
factor(id))) + facet_wrap(~id, scales = "free")
#

> -Original Message-
> From: david_ly...@yahoo.com
> Sent: Wed, 15 May

Re: [R] Help me please: gplot, facets_wrap and ordering of x axis dates

2013-05-15 Thread David Lyon
Thanks John for your reply.
I did include the data if you scroll down to the end of my original email.

Can someone help me on this? 

Thanks




- Original Message -
From: John Kane 
To: David Lyon ; r-help 
Cc: 
Sent: Tuesday, May 14, 2013 4:11 PM
Subject: RE: [R] Help me please: gplot, facets_wrap and ordering of x axis
  dates

Thank you for supplying the code. It would be easier to help you  if we also 
had some data to work with.  ?dput

https://github.com/hadley/devtools/wiki/Reproducibility

I think reorder() is likely to do the trick but I don't have enough time to 
mock up some data and check at the moment.

Have a look at  
http://stackoverflow.com/questions/3744178/ggplot2-sorting-a-plot

Good luck.
John Kane
Kingston ON Canada


> -Original Message-
> From: david_ly...@yahoo.com
> Sent: Tue, 14 May 2013 12:59:07 -0700 (PDT)
> To: r-help@r-project.org
> Subject: [R] Help me please: gplot, facets_wrap and ordering of x axis
> dates
> 
> I have a text file of data as below and doing a ggplot line plot of all
> the ids as separate mini line plots which works with the following code.
> 
> Problem how do I order the dates for each id plot on the x axis so that
> the dates are going from oldest to most recent
> 
> 
> Thanks in advance
> 
> Dave
> 
> 
> 
> 
> 
> CODE:
> 
> a<-read.table("DATA",header=TRUE);
> b<-a[order(as.Date(a$date, format="%m/%d/%Y")),]
> 
> ggplot(data=b) + geom_line(aes(x=date, y=value, group=id, colour=
> factor(id))) + facet_wrap(~id, scales = "free")
> 
> 
> 
> 
> 
> 
> DATA:
> 
> 
> id  date    value
> 001 8/16/10 <0.16
> 001 10/25/10    <0.16
> 001 11/8/10 0.42
> 001 11/22/10    0.81
> 001 12/6/10 <0.16
> 002 8/18/10 2.93
> 002 10/25/10    2.4
> 002 11/8/10 1.36
> 002 11/22/10    1.22
> 004 8/20/10 0.77
> 004 10/25/10    0.85
> 004 11/8/10 1.22
> 004 11/22/10    0.21
> 004 12/6/10 1.81
> 004 10/26/11    0.54
> 005 6/4/09  1.33
> 005 6/18/10 1.32
> 005 8/25/10 2.5
> 005 9/15/10 1.3
> 005 10/25/10    1.1
> 005 11/8/10 0.66
> 005 11/22/10    0.84
> 005 12/6/10 7.42
> 005 11/4/11 1.21
> 006 9/23/10 0.97
> 006 10/25/10    2.25
> 006 11/8/10 0.51
> 006 11/22/10    0.53
> 006 12/6/10 0.41
> 008 8/25/10 3.14
> 008 10/25/10    3.58
> 008 11/8/10 2.41
> 008 12/6/10 2.08
> 008 6/11/12 3.2
> 009 10/6/10 0.24
> 009 11/22/10    0.34
> 009 2/2/11  0.58
> 009 2/16/11 0.54
> 009 3/2/11  0.25
> 009 3/16/11 0.39
> 010 9/14/10 0.28
> 010 2/2/11  0.19
> 010 2/16/11 0.42
> 010 3/2/11  0.39
> 010 3/16/11 0.26
> 011 8/20/10 <0.16
> 011 2/2/11  <0.16
> 011 2/16/11 <0.16
> 011 3/2/11  <0.16
> 011 3/16/11 1.76
> 011 10/26/11    <0.16
> 012 12/14/10    0.48
> 012 2/2/11  1.2
> 012 2/16/11 0.44
> 012 3/2/11  0.32
> 012 3/16/11 0.34
> 013 11/13/09    0.73
> 013 8/19/10 3.32
> 013 2/2/11  13.7
> 014 2/6/13  1.35
> 014 4/24/13 0.85
> 014 8/18/10 0.66
> 014 10/5/10 0.68
> 014 10/27/10    0.53
> 014 2/2/11  0.54
> 014 2/16/11 0.49
> 014 3/2/11  0.31
> 014 3/16/11 0.4
> 014 6/29/11 0.53
> 014 8/15/11 0.55
> 014 8/15/12 0.94
> 014 10/31/12    0.74
> 015 12/10/10    0.4
> 015 2/2/11  0.44
> 015 3/2/11  0.38
> 015 3/16/11 0.43
> 016 12/17/10    0.18
> 016 1/25/11 <0.16
> 016 2/2/11  0.53
> 016 2/2/11  0.54
> 016 2/16/11 0.46
> 016 3/2/11  0.29
> 016 3/16/11 0.2
> 016 3/20/12 0.18
> 016 3/26/12 0.23
> 016 3/30/12 0.52
> 016 4/2/12  0.33
> 016 4/23/12 0.3
> 017 11/17/11    3.35
> 017 12/9/11 2.56
> 018 2/25/13 18.1
> 018 3/11/13 14.9
> 018 3/25/13 11.1
> 018 4/10/13 8.47
> 018 4/22/13 15.9
> 
> 
> __
> 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.


FREE 3D EARTH SCREENSAVER - Watch the Earth right on your desktop!
Check it out at http://www.inbox.com/earth

__
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 me please: gplot, facets_wrap and ordering of x axis dates

2013-05-14 Thread David Lyon
I have a text file of data as below and doing a ggplot line plot of all the ids 
as separate mini line plots which works with the following code.

Problem how do I order the dates for each id plot on the x axis so that the 
dates are going from oldest to most recent


Thanks in advance

Dave





CODE:

a<-read.table("DATA",header=TRUE);
b<-a[order(as.Date(a$date, format="%m/%d/%Y")),]

ggplot(data=b) + geom_line(aes(x=date, y=value, group=id, colour= factor(id))) 
+ facet_wrap(~id, scales = "free")






DATA:


id  date    value
001 8/16/10 <0.16
001 10/25/10    <0.16
001 11/8/10 0.42
001 11/22/10    0.81
001 12/6/10 <0.16
002 8/18/10 2.93
002 10/25/10    2.4
002 11/8/10 1.36
002 11/22/10    1.22
004 8/20/10 0.77
004 10/25/10    0.85
004 11/8/10 1.22
004 11/22/10    0.21
004 12/6/10 1.81
004 10/26/11    0.54
005 6/4/09  1.33
005 6/18/10 1.32
005 8/25/10 2.5
005 9/15/10 1.3
005 10/25/10    1.1
005 11/8/10 0.66
005 11/22/10    0.84
005 12/6/10 7.42
005 11/4/11 1.21
006 9/23/10 0.97
006 10/25/10    2.25
006 11/8/10 0.51
006 11/22/10    0.53
006 12/6/10 0.41
008 8/25/10 3.14
008 10/25/10    3.58
008 11/8/10 2.41
008 12/6/10 2.08
008 6/11/12 3.2
009 10/6/10 0.24
009 11/22/10    0.34
009 2/2/11  0.58
009 2/16/11 0.54
009 3/2/11  0.25
009 3/16/11 0.39
010 9/14/10 0.28
010 2/2/11  0.19
010 2/16/11 0.42
010 3/2/11  0.39
010 3/16/11 0.26
011 8/20/10 <0.16
011 2/2/11  <0.16
011 2/16/11 <0.16
011 3/2/11  <0.16
011 3/16/11 1.76
011 10/26/11    <0.16
012 12/14/10    0.48
012 2/2/11  1.2
012 2/16/11 0.44
012 3/2/11  0.32
012 3/16/11 0.34
013 11/13/09    0.73
013 8/19/10 3.32
013 2/2/11  13.7
014 2/6/13  1.35
014 4/24/13 0.85
014 8/18/10 0.66
014 10/5/10 0.68
014 10/27/10    0.53
014 2/2/11  0.54
014 2/16/11 0.49
014 3/2/11  0.31
014 3/16/11 0.4
014 6/29/11 0.53
014 8/15/11 0.55
014 8/15/12 0.94
014 10/31/12    0.74
015 12/10/10    0.4
015 2/2/11  0.44
015 3/2/11  0.38
015 3/16/11 0.43
016 12/17/10    0.18
016 1/25/11 <0.16
016 2/2/11  0.53
016 2/2/11  0.54
016 2/16/11 0.46
016 3/2/11  0.29
016 3/16/11 0.2
016 3/20/12 0.18
016 3/26/12 0.23
016 3/30/12 0.52
016 4/2/12  0.33
016 4/23/12 0.3
017 11/17/11    3.35
017 12/9/11 2.56
018 2/25/13 18.1
018 3/11/13 14.9
018 3/25/13 11.1
018 4/10/13 8.47
018 4/22/13 15.9


__
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] Please Help FDR BH correction of pvalues

2013-04-10 Thread David Lyon
I have a matrix of p values below. Column1 are the analytes and the other 
columns are p values comparing time points.
How do I convert this table of pvalues into adjust p values for FDR/BH


This is wrong does anyone know how to fix this code

a<-read.table("file", header=T, sep"\t")
b<-as.numeric(as.matrix((a[,2:8])))
p.adjust(b, "BH")






Analyte  -0.5-8    -0.5-12   -0.5-24   -0.5-168  8-12  12-24 
24-168
1_1 0.98    0.31    0.71    0.73    0.54    0.08    0.02
2_1 0.51    0.03    0.65    0.64    0.18    0.02    0.90
3_1 0.92    0.18    0.49    0.93    0.12    0.04    0.37
4_1 0.18    0.52    0.86    0.17    0.68    0.68    0.67
5_1 0.20    0.59    0.05    0.61    0.24    0.02    0.17
6_1 0.86    0.92    0.83    0.23    0.74    0.92    0.97
7_1 0.86    0.28    0.04    0.58    0.20    0.00    0.08
8   0.00    0.05    0.10    0.90    0.98    0.95    0.21
9   0.00    0.03    0.04    0.37    0.77    0.86    0.18
10  0.00    0.07    0.10    0.90    1.00    0.98    0.18
11  0.05    0.04    0.14    0.14    0.74    0.86    0.87
12  0.00    0.31    0.07    0.09    0.02    0.28    0.00
13  0.80    0.42    0.98    0.09    0.21    0.42    0.04

__
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] please help, iteration through a list of files and plot each one

2013-04-01 Thread David Lyon


I have many files in 1 directory, file names end in .txt.

Each file has 2 columns

col1 col2

2 3

3 4

4 5

5 6


I want to make a list of the file names and iterate through each plotting them 
in a separate file $filename\.png with the png swapped for txt.

So far I have this, can someone help fill in the blanks?

Thank You!




file_list <- list.files()
 
for (file in file_list){
   
 
  if (!exists("dataset")){
    dataset <- read.table(file, header=TRUE, sep="\t")
  }
   
 
  if (exists("dataset")){
    temp_dataset <-read.table(file, header=TRUE, sep="\t")


 ##how  to plot(temp_dataset) each file and save png(file\.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.


[R] Help Please, ggplot2

2013-04-01 Thread David Lyon
library(ggplot2)
a<- read.table("data", header=T)
b = na.omit(a)
ggplot(data=b) + geom_line(aes(x=timepoint, y=value,group=sample, colour= 
factor(sample))) +  geom_point(aes(x=timepoint, y=value, group=s
ample)) + facet_wrap(~bio, scales = "free",ncol = 5) +theme_bw() + 
opts(legend.direction = "horizontal",    legend.position = "top", 
legend.background = theme_blank()) +  labs(fill="")
dev.off()


This generates one nice plot with many many plots in 1 file.
How do I modify the code to split up the plots into single file instead of 
merging them in 1 file I want each plot to be in a separate file ?

Thanks in advance


__
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] Please help....normalization by the median of some control genes

2012-08-23 Thread David Lyon
Can someone show me some code to do normalization by the median of some control 
genes for the example below?

Many Many Thanks in advance



This strategy selects a subset of genes (called “control genes”) and makes the 
median of their data distribution similar across arrays.

        id1    id2    id3
control1    0.8    0.7    0.6
control2    0.6    0.2    0.4
probe1        0.3    0.2    0.5
probe2        0.4    0.9    0.7
probe3        0.6    0.7    0.4


__
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] qplot and colors (Please Help)

2012-06-27 Thread David Lyon


Please help:


I am using qplot as below and want to specify a different color scheme for race 
but dont know how, can someone show me.


Thanks in advance



Code and input file below:



library(ggplot2)
library(gridExtra)
d<-read.table("results", header=TRUE, fill=TRUE)
plot2<-qplot(X,Y,data=d,color=race,facets=TYPE~., xlab="X", ylab="Y") + 
theme_bw() 
grid.arrange(plot2,ncol=1)
dev.off()


cat  results

X   Y   ID  race    TYPE
0.0350  0.0200    1    X    NA
0.0280  0.0251    2    X    NA
0.0258  0.01753    Y    NA


__
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] Re : image.plot specify colors for range of data points, please help

2012-04-17 Thread David Lyon
Thank you so much!




- Original Message -
From: Pascal Oettli 
To: David Lyon 
Cc: "r-help@r-project.org" 
Sent: Tuesday, April 17, 2012 11:31 AM
Subject: Re : [R] image.plot specify colors for range of data points, please 
help

Hi,

> image.plot(x, breaks=c(-100,-1,1,100), col=c('green','black','red'))

Regards,
Pascal


- Mail original -
De : David Lyon 
À : "r-help@r-project.org" 
Cc : 
Envoyé le : Mercredi 18 avril 2012 0h00
Objet : [R] image.plot specify colors for range of data points, please help

Hi

If I had a dataset of the following below and I want to plot colors for this 
image.plot so that:
red for data above 1
black for data between/equal 1 and -1
green for data below -1

normally its:
image.plot(data) but how do I add the colors for the range of data points as 
above?


Many thanks for your help!


_DATA_
2.04
2.02
1.60
1.92
0.98
0.50
0.40
-0.50
-0.40
-1.90
-2.8

__
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] image.plot specify colors for range of data points, please help

2012-04-17 Thread David Lyon
Hi

If I had a dataset of the following below and I want to plot colors for this 
image.plot so that:
red for data above 1
black for data between/equal 1 and -1
green for data below -1

normally its:
image.plot(data) but how do I add the colors for the range of data points as 
above?


Many thanks for your help!


_DATA_
2.04
2.02
1.60
1.92
0.98
0.50
0.40
-0.50
-0.40
-1.90
-2.8

__
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] image.plot adding x-axis labels. Please Help

2012-04-03 Thread David Lyon
Sorry that didnt work for me, any ideas?


- Original Message -
From: ilai 
To: David Lyon 
Cc: "r-help@r-project.org" 
Sent: Tuesday, April 3, 2012 10:43 PM
Subject: Re: [R] image.plot adding x-axis labels. Please Help

On Tue, Apr 3, 2012 at 7:25 PM, David Lyon  wrote:
> if I had a data file like this:
> 1.42 1.29 -0.13
> 1.46 1.34 -0.12
> 1.45 1.32 -0.13
> 1.36 1.26 -0.10
> 1.33 1.29 -0.04
>
> I want to create a image plot like this:
> data1<-read.table("A")
>
> image.plot(t(data1), axes=FALSE, xlab=NA, ylab=NA)
>
> I cant get the labels for the x axis right can some kind person help me?

axis(1,at=seq(0,1,l=ncol(data1)),labels=LETTERS[1:ncol(data1)])


> axis(1.???.labels=c("A", "B", "C"))
>
>
> Many thanks in advance!
>
> __
> 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] image.plot adding x-axis labels. Please Help

2012-04-03 Thread David Lyon
if I had a data file like this:
1.42 1.29 -0.13
1.46 1.34 -0.12
1.45 1.32 -0.13
1.36 1.26 -0.10
1.33 1.29 -0.04

I want to create a image plot like this:
data1<-read.table("A")

image.plot(t(data1), axes=FALSE, xlab=NA, ylab=NA)

I cant get the labels for the x axis right can some kind person help me?
axis(1.???.labels=c("A", "B", "C"))


Many thanks in advance!

__
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] dot chart adding group labels....HELP

2011-02-28 Thread David Lyon
HI everyone


Does anayone know how to add group labels to dot charts
>From the R code below 


a<-read.table("test2", sep="\t", header=TRUE)
dotchart(as.matrix(t()), main="test")


it generates from the datafile input below,

file test2 containing:
A   B   C   D   E
1   1   1   1   0.2068594
1   0.2386699   1   1   0.3959740
1   0.3965243   1   1   1.000
1   1.000   1   1   0.3329179
1   1.000   1   1   0.4873605


It gives by default the group labels "1","2","3","4" and "5"

How do I change the group labels from the default "1","2","3","4" and "5" to 
something more useful say "place1","place2", "place3", "place4", "place5"

A BIG thanks in advance!

__
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] Please help......barplot2

2010-12-02 Thread David Lyon
Thanks David

Do you have the url link that details the worked solution to my problem:

"that we have an extensive collection of documentation suitable for beginners 
that probably has similar problems worked out:"

If not can someone show me how to 
" How do I import the file, then plot the mean and standard error bars of the 
data from each row?"

Thanks in advance.
Also this is not an homework problem just somebody using it as a newbie at work 
in research who normally codes in C, C++ and JAVA.

Thanks again.









--- On Thu, 12/2/10, David Winsemius  wrote:

> From: David Winsemius 
> Subject: Re: [R] Please help..barplot2
> To: "David Lyon" 
> Cc: r-help@r-project.org
> Date: Thursday, December 2, 2010, 10:57 AM
> 
> On Dec 2, 2010, at 10:36 AM, David Lyon wrote:
> 
> > Hi everyone
> > 
> > I spent hours trying to figure this out but as a
> newbie I am stuck...
> > can someone show me the R code for the following:
> > 
> > If I had a tab delimited file called "file",
> 
>  Are you sure that you are not on an OS that hides the file
> extensions by default?
> 
> 
> > containing 3 rows :
> > 9.56    8.67   
> 9.28    8.81   
> 7.93    9.85   
> 8.92    10.19   
> 8.63    
> > 6.36    7.29   
> 6.68    7.11   
> 8.04    6.05   
> 7.04    5.80   
> 7.34    
> > 3.22    3.22   
> 3.28    4.37   
> 5.21    3.10   
> 3.37    2.56   
> 5.43    
> > 
> > How do I import the file, then plot the mean and
> standard error bars of the data from each row?
> 
> If the files name is really "file" then:
> 
> read.table(file="file", header=FALSE, sep="\t")
> 
> At this point I will note that this appears to be
> structured along the lines I might except for a homework
> problem. I will offer the advice that the plotCI function in
> package plotrix looks suitable and that we have an extensive
> collection of documentation suitable for beginners that
> probably has similar problems worked out:
> 
> 
> > 
> > 
> > Thank you so much
> > 
> > __
> > 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.
> 
> David Winsemius, MD
> West Hartford, CT
> 
> 




__
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] Please help......barplot2

2010-12-02 Thread David Lyon
Hi everyone 

I spent hours trying to figure this out but as a newbie I am stuck...
can someone show me the R code for the following:

If I had a tab delimited file called "file", containing 3 rows :
9.568.679.288.817.939.858.9210.19   8.63
6.367.296.687.118.046.057.045.807.34
3.223.223.284.375.213.103.372.565.43

How do I import the file, then plot the mean and standard error bars of the 
data from each row?


Thank you so much

__
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.