[R] Looping over subsets

2008-01-19 Thread Z. Fang
Hi, Possibly a dumb question, but I wonder if anyone can help me with this. What I want to do, essentially, is to loop over all ordered subsets of a given size of a certain set. Ultimately, the idea is to find the subset that maximises a certain value. The set in question is likely large (the

Re: [R] Advice on plotting a factor and displaying missing levels

2008-01-19 Thread jim holtman
If you put NA instead of 0, then the line will 'break' when there is no data. I don't know if this is better than going down to zero in the case of missing data; you will have to decide. If you already have NAs, then you can replace these with zeros. On Jan 19, 2008 10:25 PM, obradoa <[EMAIL PRO

Re: [R] Newbie question on subsets

2008-01-19 Thread jim holtman
Part of the problem is that 'country' is probably a factor and you will get all the levels that were in the original factor in the new subset. Try the following that will remove the extra levels in the factor: my.subset <- subset(Forbes2000, country %in% c("United Kin

Re: [R] Advice on plotting a factor and displaying missing levels

2008-01-19 Thread Gabor Grothendieck
Use the zoo package to create a zoo object z which represents a time series with the tabulated days as values at the corresponding Date values. Merge that with a zero width series containing all the dates from the start to the end using a fill of 0. Now plot that using plot.zoo . f <- factor(c("

Re: [R] Advice on plotting a factor and displaying missing levels

2008-01-19 Thread obradoa
Great, this would work. Is it also possible to plot zero values for each missing day, so when I do the line graph it properly drops to 0 if there was no data for that day? Currently the line graph connects dots that represent days with data present, but the line graph never drops to 0. I'd appreci

[R] Newbie question on subsets

2008-01-19 Thread Joe Trubisz
Hi... I'm working through the book, A Handbook of Statistical Analyses using R by Everitt, and I'm trying to do the following (p. 19 of his book): boxplot(log(marketvalue)~country, data = subset(Forbes2000, country %in% c("United Kingdom","Germany","India","T

Re: [R] Logical test and look up table

2008-01-19 Thread Wensui Liu
here is another one. x <- read.table(textConnection(" id source Type 1 A23M 2 A24N 3 A9Y 4 A32E 5 A25R 6 A14V 7 A10G 8 A12W 9 A11J 10 A13Q 11 GO"), header = TRUE, as.is = TRUE); y <- read.table(textConnection(" id Source 1 A10 2 A32

Re: [R] Logical test and look up table

2008-01-19 Thread Erin Hodgess
Hi Nicola: Here is something to consider: > #Fake data set > x.df V1 Type 1 A23M 2 A24N 3 A9Y 4 A32E 5 A25R 6 A14V 7 A10G 8 A12W 9 A11J 10 A13Q 11 GO > #new set > y.df Source 1 A10 2 A32 3 A10 4 A25 5 A32 6 G

Re: [R] Logical test and look up table

2008-01-19 Thread jim holtman
Here is one way of doing it using 'match' > # mapping table > x <- read.table(textConnection("Source Type + A23 1 + A24 2 + A92 + A32 H + A25 H1 + A14 3 + A10 4 + A12 H1 + A11 1 + A13 4 + G h"), header=TRUE, as.is=TRUE) > > # generate some test data > test <- sample(x$Source,

Re: [R] Advice on plotting a factor and displaying missing levels

2008-01-19 Thread Gabor Grothendieck
Tabulate using table(), convert the dates to Date class and plot: f <- factor(c("10/17/07", "10/17/07", "10/17/07", "10/17/07", "10/17/07", "10/17/07", "01/09/08", "01/17/08", "01/17/08", "01/17/08")) ndays <- table(f) plot(as.Date(names(ndays), "%m/%d/%y"), ndays) On Jan 19, 2008 5:36 PM, obrad

[R] Logical test and look up table

2008-01-19 Thread Nikola MARKOV
Dear R users, I have a data frame with one column (4000 rows) containing name codes (factor with 63 levels). I would like to associate each name with a particular Type (coded as 1,2,3,4,H or H1) in a second column. Is it possible to do a lookup table of associations (i.e. A23 is of type 1, A13 is

[R] Advice on plotting a factor and displaying missing levels

2008-01-19 Thread obradoa
I am trying to plot how many records are inserted into a database on a certain date, but also represent days where no records are inserted. I can get a list of dates for inserted records using RMySQL result <- dbSendQuery(con, "select date_format(creation_ts, "%m/%d/%y") from mytable;") inserts<

[R] (sem assunto)

2008-01-19 Thread Edison Iglesias de Oliveira Vidal
I have been searching without success to find out how to test for the assumption of linear relationship between the indenpendent variables and the logit of the dependent variable in multiple logistic regression models using R. I shall be glad for any advice. best regards, Edison Iglesias de O

Re: [R] dotchart - problem with gcolor

2008-01-19 Thread John Kane
Excellent, it does exactly what I wanted.. I had never encountered "unname" before. Thanks very much. --- Gabor Grothendieck <[EMAIL PROTECTED]> wrote: > Try this: > > aa <- c(a = 1, b = 2, c = 3) > dotchart(unname(aa), col = 1:3) > axis(side = 2, seq_along(aa), names(aa)) > > > > On Jan

Re: [R] dotchart - problem with gcolor

2008-01-19 Thread Gabor Grothendieck
Try this: aa <- c(a = 1, b = 2, c = 3) dotchart(unname(aa), col = 1:3) axis(side = 2, seq_along(aa), names(aa)) On Jan 19, 2008 5:01 PM, John Kane <[EMAIL PROTECTED]> wrote: > > --- Gabor Grothendieck <[EMAIL PROTECTED]> > wrote: > > > Use col= for that. > > Well yes, but I was trying to get th

Re: [R] dotchart - problem with gcolor

2008-01-19 Thread John Kane
--- Gabor Grothendieck <[EMAIL PROTECTED]> wrote: > Use col= for that. Well yes, but I was trying to get the points on the graph coloured and the value labels uncoloured (that is black). Thanks > > On Jan 19, 2008 4:31 PM, John Kane > <[EMAIL PROTECTED]> wrote: > > Thank you Gabor. The ex

Re: [R] dotchart - problem with gcolor

2008-01-19 Thread Gabor Grothendieck
Use col= for that. On Jan 19, 2008 4:31 PM, John Kane <[EMAIL PROTECTED]> wrote: > Thank you Gabor. The examples are excellent. > > I was misreading the intend of gcolor. I had thought > that it would allow me to colour all of the value > labels . > > > --- Gabor Grothendieck <[EMAIL PROTECTED]>

Re: [R] dotchart - problem with gcolor

2008-01-19 Thread John Kane
Thank you Gabor. The examples are excellent. I was misreading the intend of gcolor. I had thought that it would allow me to colour all of the value labels . --- Gabor Grothendieck <[EMAIL PROTECTED]> wrote: > Or even one group if its named: > > dotchart(cbind(a = aa), gcolor = "red") > >

Un s�jour de 4 personnes � DisneyLand

2008-01-19 Thread Participez et Gagnez
-- Pour vous d�sabonner � cette liste, visitez http://jbala.ws/lists/lt.php?id=MkxQBQYFAVBIBk8AVV1XAQ%3D%3D Pour mettre vos pr�f�rences � jour, visitez http://jbala.ws/lists/lt.php?id=MkxQBQYFAVNIBk8AVV1XAQ%3D%3D Faire

Re: [R] dotchart - problem with gcolor

2008-01-19 Thread Gabor Grothendieck
Or even one group if its named: dotchart(cbind(a = aa), gcolor = "red") On Jan 19, 2008 3:18 PM, Gabor Grothendieck <[EMAIL PROTECTED]> wrote: > You only have one group. Try it with two groups: > > dotchart(cbind(a = aa, b = aa), gcolor = "red") > > > > On Jan 19, 2008 2:48 PM, John Kane <[EMAIL

Re: [R] dotchart - problem with gcolor

2008-01-19 Thread Gabor Grothendieck
You only have one group. Try it with two groups: dotchart(cbind(a = aa, b = aa), gcolor = "red") On Jan 19, 2008 2:48 PM, John Kane <[EMAIL PROTECTED]> wrote: > It a trivial point but can anyone tell me why gcolor > is not working here? I thought that I should be > getting the letters in red.

[R] dotchart - problem with gcolor

2008-01-19 Thread John Kane
It a trivial point but can anyone tell me why gcolor is not working here? I thought that I should be getting the letters in red. lcolor seems to work just fine. aa <- c(3,6,3,5,8) lbs <- LETTERS[1:5] dotchart(rev(aa), pch=16, labels=(rev(lbs)), lcolor="blue", gcolor="red") Looking for

Re: [R] modifing barplot

2008-01-19 Thread Uwe Ligges
- Please send plain text mails. - So you REALLY want shading lines? Anyway, set the line width option for the current device prior to calling barplot(): par(lwd=2) barplot(...) Uwe Ligges Monica Pisica wrote: > Hi, > > I would like to modify how barplot plots. For reasons only my superv

[R] [R-pkgs] batchfiles 0.4-0

2008-01-19 Thread Gabor Grothendieck
batchfiles 0.4-0 consists of a set of Windows Vista .bat, .hta and .pl files. More information is available on the home page: http://batchfiles.googlecode.com CHANGES - now tested with Vista exclusively (use 0.3-2 instead on XP) - sweave.bat now has no dependencies on the other batch files.

Re: [R] show overstruck in plot legend

2008-01-19 Thread tom soyer
Thanks Marc! On 1/19/08, Marc Schwartz <[EMAIL PROTECTED]> wrote: > > tom soyer wrote: > > Hi, > > > > I have a plot with type="o", or overstruck. Now I am trying to add the > > legend, but I couldn't figure out how to show the overstruck type in the > > legend. It seems that the legend only allow

Re: [R] show overstruck in plot legend

2008-01-19 Thread Marc Schwartz
tom soyer wrote: > Hi, > > I have a plot with type="o", or overstruck. Now I am trying to add the > legend, but I couldn't figure out how to show the overstruck type in the > legend. It seems that the legend only allows one to set lty. Does anyone > know how to show overstruck in the legend? > >

[R] show overstruck in plot legend

2008-01-19 Thread tom soyer
Hi, I have a plot with type="o", or overstruck. Now I am trying to add the legend, but I couldn't figure out how to show the overstruck type in the legend. It seems that the legend only allows one to set lty. Does anyone know how to show overstruck in the legend? Thanks! -- Tom [[alter

Re: [R] odfWeave and xtable

2008-01-19 Thread Emmanuel Charpentier
宋时歌 a écrit : > David, > > The value of odfWeave is not limited to newbie users. It is vastly > useful for researchers in fields that do not accept LaTeX for journal > paper submission (for example, sociology, demography). ... and for those of us living in the salt mines of administration (in my

Re: [R] How to write a Greek letter in a graph?

2008-01-19 Thread Uwe Ligges
hits=-2.6 tests=BAYES_00 X-USF-Spam-Flag: NO Jeremy Baxter wrote: > Catherine > > Have a look at the help in text(), i.e. > > help(text) ... and particularly help("plotmath") Uwe Ligges > I think you are looking for something along the lines of: > > xyplot(power1+power2 ~ pi0, data

[R] Newsletter: Ihre E-Mailadresse wurde ausgetragen.

2008-01-19 Thread steinfeuerfred
Hallo, Ihre E-Mailadresse "[EMAIL PROTECTED]" wurde aus dem Verteiler entfernt. URL: http://www.fueralles.de/cgi-bin/nsl_pro/newsletter.cgi?id=steinfeuerfred Mit freundlichen Grüssen Ihr Newsletter-Team __ R-help@r-project.org mailing list https://sta

Re: [R] Problems with lattice plot

2008-01-19 Thread Jim Lemon
Francesc Montané wrote: > Hello useRs, > > > > I have some problems when I try to plot a lattice. The lattice has 200 > columns (X value) and 5 rows (Y value), with a total of 1000 squares. I > want to plot this lattice with the squares having different colours > according to a variable valu

Re: [R] How to write a Greek letter in a graph?

2008-01-19 Thread Jeremy Baxter
Catherine Have a look at the help in text(), i.e. help(text) I think you are looking for something along the lines of: xyplot(power1+power2 ~ pi0, data=resultb, ylab="Average Power", type="l", pch=LETTERS[1:2], lty=c(1:2), main="(a)", xlab=expression(pi[0])) i.e. i am assuming you want pi s