Re: [R] Select the last two rows by id group

2007-03-20 Thread Marc Schwartz
County State Allen 39003 AllenOH Just noticed a Big Ten theme there...Go Gophers! ;-) So, it would seem that your hypothesis is correct, at least in this limited testing. I would want to validate it more rigorously of course. HTH, Marc Schwartz

Re: [R] Ticks on barplots

2007-03-20 Thread Marc Schwartz
+ seq(0, 45, 5), tcl = -0.75, las = 2, cex.axis = 0.75) Just pick which labels you want to be shown (eg. every 5 years) and synchronize the values of those with the 'at' argument in axis(). BTW, your PDF did not come through. HTH, Marc Schwartz

Re: [R] Ticks on barplots

2007-03-21 Thread Marc Schwartz
On Wed, 2007-03-21 at 14:40 -0400, Mike Prager wrote: Marc Schwartz [EMAIL PROTECTED] wrote: On Tue, 2007-03-20 at 18:04 -0400, Michael H. Prager wrote: I am generating stacked barplots of age-composition of fish populations (Y) over time (X). As there are many years, not every bars

Re: [R] Labelling a second y-axis

2007-03-21 Thread Marc Schwartz
Y-Axes in R) par(new=TRUE) plot(x,y2,xlim=c(0,10),xaxt=n,yaxt=n,ylab=,pch=16) axis(4,at=c(0,20,40,60,80,100)) text(12, 50, y2, srt = 270, xpd = TRUE) See ?text, ?par and ?mtext for more information. HTH, Marc Schwartz

Re: [R] R difftime function: How can we fix the difftime unit?

2007-03-21 Thread Marc Schwartz
note of the 'units' argument: difftime(x, y, units = mins) Time difference of 121.85 mins difftime(x, z, units = mins) Time difference of 30.35 mins HTH, Marc Schwartz __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r

Re: [R] Ticks and labels on plots

2007-03-22 Thread Marc Schwartz
snip On Thu, 2007-03-22 at 10:03 +0100, Martin Maechler wrote: Marc == Marc Schwartz [EMAIL PROTECTED] Marc To get a feel for how axis() creates the default tick positions when Marc 'at' is the default NULL, see ?axTicks, which provides functionality Marc similar to the internal

Re: [R] digits doesn't work in format function

2007-03-22 Thread Marc Schwartz
-0.38 formatC(m, format = f, digits = 2) [1] 0.02 -0.15 -0.46 -0.68 -0.65 -0.06 -0.26 -0.16 [9] -0.08 -0.38 HTH, Marc Schwartz __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http

Re: [R] quick legend() question

2007-03-22 Thread Marc Schwartz
are set to 'blank'. HTH, Marc Schwartz __ R-help@stat.math.ethz.ch 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

Re: [R] distribution graph

2007-03-23 Thread Marc Schwartz
= FALSE) tmp - sapply(Vals, length) Y.Vals - rep(names(tmp), tmp) plot(X.Vals, Y.Vals, ...) } Vec - exp(rnorm(200, sd = 0.25) + 2) / 5 DistPlot(Vec, pch = 19) HTH, Marc Schwartz __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch

Re: [R] using \t in mtext

2007-03-23 Thread Marc Schwartz
the textplot() function in the gplots package, which I reference in the post above. Also reviewing this thread: http://tolstoy.newcastle.edu.au/R/help/02b/0346.html and using: RSiteSearch(text alignment plot) might bring up other posts with alternate approaches. HTH, Marc Schwartz

Re: [R] Contatenating data frames with partial overlap in variable names

2007-03-24 Thread Marc Schwartz
?merge for more information. HTH, Marc Schwartz __ R-help@stat.math.ethz.ch 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

Re: [R] Contatenating data frames with partial overlap in variable names

2007-03-24 Thread Marc Schwartz
On Sat, 2007-03-24 at 22:16 -0400, Daniel Folkinshteyn wrote: on 03/24/2007 10:00 PM Marc Schwartz said the following: On Sat, 2007-03-24 at 21:47 -0400, Daniel Folkinshteyn wrote: Greetings to all. I need to concatenate data frames that do not have all the same variable names

Re: [R] Problem dropping rows based on values in a column

2007-03-25 Thread Marc Schwartz
It also works in the permuted vector: Vec[!Vec %in% delete] [1] 5 1 7 3 8 2 6 4 See ?%in% for more information. HTH, Marc Schwartz __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] subset

2007-03-26 Thread Marc Schwartz
a subset under this condition? Thank you in advance. Sergio Della Franca. See ?subset Something along the lines of the following should work: NewDF - subset(DF, (var1 == 0) (var2 == 0) (var 3 != 0)) HTH, Marc Schwartz __ R-help@stat.math.ethz.ch

Re: [R] Import of a workspace into R

2007-03-27 Thread Marc Schwartz
Export/Import Thanks, Corinna You will need to provide more information regarding the data source. Marc Schwartz __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R

Re: [R] Replacement in an expression - can't use parse()

2007-03-27 Thread Marc Schwartz
+u2+u3) TMP - unlist(strsplit(as.character(e), )) TMP [1] u1 + u2 + u3 TMP - gsub(u2, x, TMP) TMP - gsub(u3, i, TMP) TMP [1] u1 + x + i as.expression(paste(TMP, collapse = )) expression(u1+x+i) HTH, Marc Schwartz __ R-help

Re: [R] catching a console output

2007-03-27 Thread Marc Schwartz
On Tue, 2007-03-27 at 14:37 +0200, manuel.martin wrote: Hello all, I cannot figure out how to catch the console output from a function which does not return anything but a console output, any hints? Thank you in advance, Manuel See ?sink and ?capture.output HTH, Marc Schwartz

Re: [R] Standardization

2007-03-27 Thread Marc Schwartz
On Tue, 2007-03-27 at 16:52 +0200, Sergio Della Franca wrote: Dear R-Helpers, I want to perform a stadardiazation of a variable with mehtod range. How can i achve this results? Thank you in advance. Sergio Della Franca See ?scale HTH, Marc Schwartz

Re: [R] Import of a workspace into R

2007-03-28 Thread Marc Schwartz
not be an issue. HTH, Marc Schwartz __ R-help@stat.math.ethz.ch 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 equivalent of S+SeqTrial?

2007-03-28 Thread Marc Schwartz
: http://www.biostat.wisc.edu/landemets/ HTH, Marc Schwartz __ R-help@stat.math.ethz.ch 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

Re: [R] Samplng from a matrix (was: no subject)

2007-03-28 Thread Marc Schwartz
46 [7,] 23 63 15 47 [8,] 24 64 16 48 The key is to use sample() to generate random indices into the matrix and to use matrix indexing appropriately. HTH, Marc Schwartz __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch

Re: [R] substitute NA values

2007-03-28 Thread Marc Schwartz
with: DF YEAR PRODUCTS 1 1990 2478 2 1995 3192 3 20000 4 2005 1594 mean(DF$PRODUCTS) [1] 1816 HTH, Marc Schwartz __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] R equivalent of S+SeqTrial?

2007-03-28 Thread Marc Schwartz
On Wed, 2007-03-28 at 10:49 -0500, Douglas Bates wrote: On 3/28/07, Marc Schwartz [EMAIL PROTECTED] wrote: On Wed, 2007-03-28 at 02:42 -0700, francogrex wrote: Does anyone know of an R package that is equivalent of S+SeqTrial for analysis of clinical trials using group sequential methods

Re: [R] Large matrix into a vector

2007-03-28 Thread Marc Schwartz
] 241 242 243 HTH, Marc Schwartz __ R-help@stat.math.ethz.ch 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

Re: [R] Large matrix into a vector

2007-03-28 Thread Marc Schwartz
On Wed, 2007-03-28 at 19:55 -0200, Alberto Monteiro wrote: Prof Brian Ripley wrote: We have already seen three solutions. I don't like to see the use of c() for its side effects. In this case Marc's as.vector seems to me to be self-explanatory, and that is a virtue in programming

Re: [R] string into command

2007-03-28 Thread Marc Schwartz
have tried, but here is a solution: ls() character(0) eval(parse(text = mylist - list(a = 5, b = 7))) ls() [1] mylist mylist $a [1] 5 $b [1] 7 HTH, Marc Schwartz __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r

Re: [R] Large matrix into a vector

2007-03-29 Thread Marc Schwartz
On Thu, 2007-03-29 at 02:12 -0700, A Ezhil wrote: Hi All, Thank you very much for all your suggestions. It's a great learning for me. All the three suggested solutions seem working. I don't know what 'side effects' that you were talking about. As Peter noted, the phrase 'side effect' may

Re: [R] E-Mail/Post Threading (was: Bonferroni p-value greater than 1)

2007-03-29 Thread Marc Schwartz
/message-threading.html http://www.jwz.org/doc/threading.html HTH, Marc Schwartz __ R-help@stat.math.ethz.ch 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

Re: [R] E-Mail/Post Threading (was: Bonferroni p-value greater t

2007-03-29 Thread Marc Schwartz
On Thu, 2007-03-29 at 19:38 +0100, [EMAIL PROTECTED] wrote: On 29-Mar-07 17:15:27, Marc Schwartz wrote: [...] Just a quick heads up here, that deleting the body text of a message or changing the subject line, does not alter the 'linkage' between posts. There are standards for how

Re: [R] Xemacs, ESS, R config issue

2007-03-29 Thread Marc Schwartz
. BTW, there is a dedicated ESS list: https://stat.ethz.ch/mailman/listinfo/ess-help HTH, Marc Schwartz __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org

Re: [R] Vector indexing question

2007-03-29 Thread Marc Schwartz
See ?subset HTH, Marc Schwartz __ R-help@stat.math.ethz.ch 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

Re: [R] do.call vs. lapply for lists

2007-04-09 Thread Marc Schwartz
On Mon, 2007-04-09 at 12:45 -0400, Muenchen, Robert A (Bob) wrote: Hi All, I'm trying to understand the difference between do.call and lapply for applying a function to a list. Below is one of the variations of programs (by Marc Schwartz) discussed here recently to select the first and last

Re: [R] problems understanding sapply

2007-04-10 Thread Marc Schwartz
of delete. All you really need (since pbinom() is already vectorized) is: pbinom(delete[, 1], 30, 0) [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Presuming that this is end result that you seek. HTH, Marc Schwartz __ R-help

Re: [R] crosstabs in R?

2007-04-10 Thread Marc Schwartz
in the 'gmodels' package on CRAN. HTH, Marc Schwartz __ R-help@stat.math.ethz.ch 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

Re: [R] Reasons to Use R

2007-04-11 Thread Marc Schwartz
functions using similar economic models... :-) Regards, Marc Schwartz __ R-help@stat.math.ethz.ch 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

Re: [R] Reasons to Use R

2007-04-11 Thread Marc Schwartz
On Wed, 2007-04-11 at 11:26 -0500, Marc Schwartz wrote: On Wed, 2007-04-11 at 17:56 +0200, Bi-Info (http://members.home.nl/bi-info) wrote: I certainly have that idea too. SPSS functions in a way the same, although it specialises in PC applications. Memory addition to a PC is not a very

Re: [R] sas.get problem

2007-04-11 Thread Marc Schwartz
/Technology/Products/DBMS/ HTH, Marc Schwartz __ R-help@stat.math.ethz.ch 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

Re: [R] Subsetting list of vectors with list of (boolean) vectors?

2007-04-12 Thread Marc Schwartz
, Joh lapply(seq(along = length(aPGI)), function(x) aPGI[[x]][aPGItest[[x]]]) [[1]] [1] 864 I think that this should be a generic solution for multiple (but common) levels in each list. HTH, Marc Schwartz __ [EMAIL PROTECTED] mailing list https

Re: [R] Putting 2 breaks on Y axis

2007-04-12 Thread Marc Schwartz
better visualization of the data structure. If number 2 is more appropriate, you could also use par(mfcol) to set up side by side plots. See ?par. HTH, Marc Schwartz __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE

Re: [R] making a counter of consecitive positive cases in time series

2007-04-12 Thread Marc Schwartz
want: x - rbinom(15, 1, .3) x [1] 1 1 0 0 1 0 0 0 1 1 0 1 1 0 1 rle(x) Run Length Encoding lengths: int [1:9] 2 2 1 3 2 1 2 1 1 values : num [1:9] 1 0 1 0 1 0 1 0 1 See ?rle for more information. HTH, Marc Schwartz __ [EMAIL PROTECTED] mailing

Re: [R] thousand separator (was RE: weight)

2007-04-30 Thread Marc Schwartz
the resultant character vector to numeric. HTH, Marc Schwartz On Mon, 2007-04-30 at 12:26 -0400, Liaw, Andy wrote: I've run into this occasionally. My current solution is simply to read it into Excel, re-format the offending column(s) by unchecking the thousand separator box, and write it back out

Re: [R] thousand separator (was RE: weight)

2007-04-30 Thread Marc Schwartz
Bert Gunter Genentech Nonclinical Statistics -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Marc Schwartz Sent: Monday, April 30, 2007 10:02 AM To: Liaw, Andy Cc: r-help@stat.math.ethz.ch Subject: Re: [R] thousand separator (was RE: weight

Re: [R] logrank test

2007-05-01 Thread Marc Schwartz
On Tue, 2007-05-01 at 08:34 -0700, raymond chiruka wrote: how do l programme the logrank test. l am trying to compare 2 survival curves See: library(survival) ?survdiff and take note of the 'rho' argument, which when set to 0 is the logrank test. HTH, Marc Schwartz

Re: [R] Matrix column name

2007-05-01 Thread Marc Schwartz
2 3 4 MAT[, 1, drop = FALSE] A [1,] 1 [2,] 2 [3,] 3 [4,] 4 HTH, Marc Schwartz __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html

Re: [R] sorting in barplot

2007-05-01 Thread Marc Schwartz
on top of barplot(), then by default, the factor levels of your response variable will determine the order of the bars in the plot. See ?reorder.factor for more details relative to defining the order based upon the mean of the variable. There is an example there of using the median. HTH, Marc

Re: [R] sorting in barplot

2007-05-02 Thread Marc Schwartz
. Marc Schwartz [EMAIL PROTECTED] mcast.net

Re: [R] Survival statistics--displaying multiple plots

2007-05-02 Thread Marc Schwartz
), legend.pos = 1) If this is close, see ?cut for creating a factor from a continuous vector. You can of course further tweak the plot aesthetics as you desire. HTH, Marc Schwartz On Wed, 2007-05-02 at 23:14 -0400, Gregory Pierce wrote: I should clarify. I can generate plots for each category

Re: [R] Truncating trailing digits

2007-05-03 Thread Marc Schwartz
.), including specifically the number of digits after the decimal, then see ?formatC and ?sprintf which allow for this. Also see ?cat which is how much of standard R console output is generated. HTH, Marc Schwartz __ R-help@stat.math.ethz.ch mailing list

Re: [R] keyboard issue in R console

2007-05-04 Thread Marc Schwartz
-to-work_003f Additional information is available in the R Installation/Administration Manual with your system or in HTML here: http://cran.us.r-project.org/doc/manuals/R-admin.html HTH, Marc Schwartz __ R-help@stat.math.ethz.ch mailing list https

Re: [R] Help Installing R

2007-05-04 Thread Marc Schwartz
. Thanks See this post from about 30 minutes ago: https://stat.ethz.ch/pipermail/r-help/2007-May/131236.html HTH, Marc Schwartz __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] listing R packages in our system

2007-05-04 Thread Marc Schwartz
On Fri, 2007-05-04 at 13:06 -0400, Hu, Ying (NIH/NCI) [E] wrote: Hi, I like to know the simple way to list the R package names in our linux system. Thanks Ying See ?installed.packages HTH, Marc Schwartz __ R-help@stat.math.ethz.ch

Re: [R] R question

2007-05-04 Thread Marc Schwartz
(YourDataFrame) to display information about the detailed structure and/or column names, respectively, in the data frame that you created from the imported data. HTH, Marc Schwartz __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman

Re: [R] How to latex tables?

2007-05-05 Thread Marc Schwartz
$$205$$279$$138$$351$\\ $ 19$$ 8$$391$$244$$299$$317$\\ \hline \end{tabular} \end{center} \end{table} HTH, Marc Schwartz __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http

Re: [R] How to latex tables?

2007-05-05 Thread Marc Schwartz
On Sat, 2007-05-05 at 11:35 -0500, Marc Schwartz wrote: On Sat, 2007-05-05 at 09:43 -0400, steve wrote: Suppose I have a table constructed from structable or simply just an object of class table. How can I convert it to a latex object? I looked in RSiteSearch, but only found info about

Re: [R] Centering a legend

2007-05-07 Thread Marc Schwartz
of the following: # Do your plot plot(0:1, 0:1, type = n, ann = FALSE, axes = FALSE) # Do the legend, centered legend(center, This is a test legend) See the Details section of ?legend, third paragraph. Also, the last set of examples there. HTH, Marc Schwartz __ R

Re: [R] computing logrank statistic/test

2007-05-07 Thread Marc Schwartz
Rau. Did you not see the replies? https://stat.ethz.ch/pipermail/r-help/2007-May/130956.html HTH, Marc Schwartz __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R

Re: [R] Reading a web page in pdf format

2007-05-09 Thread Marc Schwartz
( 99,3)Tj # Now parse the values out of the lines Vals - sub(.*\\((.*)\\).*, \\1, PDFFile[Lines]) Vals [1]46,699,3 # Now convert them to numeric # need to change the ',' to a '.' at least in my locale as.numeric(gsub(,, \\., Vals)) [1] 46.6 99.3 HTH, Marc Schwartz

Re: [R] Reading a web page in pdf format

2007-05-09 Thread Marc Schwartz
On Wed, 2007-05-09 at 10:55 -0500, Marc Schwartz wrote: On Wed, 2007-05-09 at 15:47 +0100, Vittorio wrote: Each day the daily balance in the following link http://www. snamretegas.it/italiano/business/gas/bilancio/pdf/bilancio.pdf is updated. I would like to set up an R

Re: [R] R 2.5.0 Help - problems with search

2007-05-10 Thread Marc Schwartz
a link in a new tab or window. Even if this search does not work on your system, you can always use help.search at the R prompt. Check on the above, including the additional information on the manual link page and if you still have no resolution, post back with further details. HTH, Marc Schwartz

Re: [R] Barplot by two variables

2007-05-10 Thread Marc Schwartz
the unique values for both the Years and the Limits to use them for the x axis labels and the legend text. HTH, Marc Schwartz __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http

Re: [R] t value two.sided and one.sided

2007-05-10 Thread Marc Schwartz
HTH, Marc Schwartz __ R-help@stat.math.ethz.ch 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] Read SAS data into R

2007-05-11 Thread Marc Schwartz
or ensuring that the entity generating the datasets outputs SAS Transport format files instead. HTH, Marc Schwartz __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org

Re: [R] differentiate groups on barplot

2007-05-14 Thread Marc Schwartz
indexing is 1 based, not 0 based. Hence: colr[0] character(0) colr[1] [1] gray colr[2] [1] pink All you really need is: barplot(test$score, beside = TRUE, space = .4, col = colr) as 'colr' will be recycled as required here. HTH, Marc Schwartz

Re: [R] legend with mixed boxes and lines (not both)

2007-05-14 Thread Marc Schwartz
information. BTW, some strategically placed spaces would help with code readability. HTH, Marc Schwartz __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting

Re: [R] conversion into capital letter

2007-05-15 Thread Marc Schwartz
of the examples therein. HTH, Marc Schwartz __ R-help@stat.math.ethz.ch 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

Re: [R] stacked barplot with positive and negatvie values

2007-05-15 Thread Marc Schwartz
# so that there is no gap par(mar = c(5, 4, 0, 2)) # Now do the negative values, using the same logic barplot(example2[4, ], yaxs = i, ylim = c(-125, 0), las = 2) HTH, Marc Schwartz __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch

Re: [R] Efficiently reading random lines form a large file

2007-05-15 Thread Marc Schwartz
earlier in the year for some ideas: http://tolstoy.newcastle.edu.au/R/e2/help/07/02/9709.html HTH, Marc Schwartz __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org

Re: [R] log rank test p value

2007-05-15 Thread Marc Schwartz
$ call : language survdiff(formula = Surv(futime, fustat) ~ rx, data = ovarian) - attr(*, class)= chr survdiff We can then do the following to secure the p value: 1 - pchisq(survtest$chisq, 1) [1] 0.3025911 See ?str and ?pchisq for more information. HTH, Marc Schwartz

Re: [R] more woes trying to convert a data.frame to a numerical matrix

2007-05-16 Thread Marc Schwartz
, which in most cases can be treated as a numeric matrix and/or you could explicitly coerce it to one. HTH, Marc Schwartz __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R

Re: [R] more woes trying to convert a data.frame to a numerical matrix

2007-05-16 Thread Marc Schwartz
(sample.data[-1, -1])) int [1:3, 1:3] 1 2 3 1 2 3 1 2 3 - attr(*, dimnames)=List of 2 ..$ : chr [1:3] 2 3 4 ..$ : chr [1:3] x y z HTH, Marc Thanks, Andrew On 5/16/07, Marc Schwartz [EMAIL PROTECTED] wrote: On Wed, 2007-05-16 at 08:10 -0400, Andrew Yee wrote: I

Re: [R] more woes trying to convert a data.frame to a numerical matrix

2007-05-16 Thread Marc Schwartz
On Wed, 2007-05-16 at 09:05 -0400, Andrew Yee wrote: Thanks for the suggestion. However, I've tried sapply and data.matrix. The problem is that it while it returns a numeric matrix, it gives back: 1 1 1 2 2 2 3 3 3 instead of 1 2 3 4 5 6 7 8 9 The latter matrix is the

Re: [R] more woes trying to convert a data.frame to a numerical matrix

2007-05-16 Thread Marc Schwartz
On Wed, 2007-05-16 at 11:29 -0400, Liaw, Andy wrote: I think this might be a bit more straight forward: R mat - do.call(cbind, scan(clipboard, what=list(NULL, 0, 0, 0), sep=,, skip=2)) Read 3 records R mat [,1] [,2] [,3] [1,]123 [2,]456 [3,]789

Re: [R] substitute x for pattern in a list, while preservign list structure. lapply, gsub, list...?

2007-05-16 Thread Marc Schwartz
78 ... .. ..$ test2: chr [1:5] green NA NA NA ... Note however, the impact of using gsub(), which is that factors are coerced to characters. So consider what you want the end game to be. See ?rapply for more information. HTH, Marc Schwartz __ R

Re: [R] substitute x for pattern in a list, while preservign list structure. lapply, gsub, list...?

2007-05-16 Thread Marc Schwartz
On Wed, 2007-05-16 at 13:18 -0400, Gabor Grothendieck wrote: On 5/16/07, Marc Schwartz [EMAIL PROTECTED] wrote: On Wed, 2007-05-16 at 09:25 -0700, new ruser wrote: I am experimenting with some of the common r functions. I had a question re:using gsub (or some similar functions

Re: [R] Re-sizing R graphics for Sweave

2007-05-16 Thread Marc Schwartz
with the various 'cex' family of parameters. See ?par for more information there. HTH, Marc Schwartz __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting

Re: [R] Split a vector(list) into 3 list

2007-05-17 Thread Marc Schwartz
in sapply() and then for the names in the result. For example: Vals - unique(Vec) Res - sapply(Vals, function(x) which(Vec == x)) names(Res) - Vals See ?unique HTH, Marc Schwartz __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo

Re: [R] Bootstrapped standard errors

2007-05-17 Thread Marc Schwartz
-Companion/appendix-bootstrapping.pdf HTH, Marc Schwartz __ R-help@stat.math.ethz.ch 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

Re: [R] ordering in list.files

2007-05-18 Thread Marc Schwartz
] 10files.csv 1abc.csv2def.csv3ghi.csv Files[order(as.numeric(sub(([0-9]*).*, \\1, Files)))] [1] 1abc.csv2def.csv3ghi.csv10files.csv See ?sub, ?regex and ?order for more information. HTH, Marc Schwartz __ R-help@stat.math.ethz.ch

Re: [R] How to repress the annoying complains from X window system

2007-05-18 Thread Marc Schwartz
message that you are seeing was fixed back in R 2.4.0: o The X11() device no longer produces (apparently spurious) 'BadWindow (invalid Window parameter)' warnings when run from Rcmdr. HTH, Marc Schwartz __ R-help@stat.math.ethz.ch

Re: [R] A programming question

2007-05-18 Thread Marc Schwartz
) predict(model, newdata, type = response) BTW, if you also want the fitted values for the actual data used to create the model, you can use fitted(model) rather than doing the matrix multiplications directly. See ?fitted for more information. HTH, Marc Schwartz

Re: [R] How to repress the annoying complains from X window system

2007-05-18 Thread Marc Schwartz
2.4.0. I don't know how the SysAdmin installed or configured it though. I am not running Rcmdr, I am developing R GUI applications using Tcl/Tk package, for some weird reason, those messages comes and goes... Thanks Hao Marc Schwartz wrote: On Fri, 2007-05-18 at 11:25 -0400, Hao

Re: [R] Catenating factors.

2007-05-22 Thread Marc Schwartz
be helpful: http://tolstoy.newcastle.edu.au/R/e2/devel/06/11/1130.html HTH, Marc Schwartz __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html

Re: [R] Aggregate to find majority level of a factor

2007-05-31 Thread Marc Schwartz
3 Plot3 small See ?which.max, ?names and ?table. HTH, Marc Schwartz __ R-help@stat.math.ethz.ch 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

Re: [R] scan a directory and then make a string vector consisting of file names

2007-05-31 Thread Marc Schwartz
-can_0027t-find-my-file HTH, Marc Schwartz __ R-help@stat.math.ethz.ch 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

Re: [R] tapply histogram

2007-06-01 Thread Marc Schwartz
leave that for you. See ?model.frame and ?split HTH, Marc Schwartz __ R-help@stat.math.ethz.ch 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

Re: [R] Excel calling R functions

2007-06-01 Thread Marc Schwartz
try my luck here. Thanks in advance. Horace W. Tso See the R-Excel add-in linked from here: http://www.sciviews.org/_rgui/projects/RDcom.html HTH, Marc Schwartz __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r

Re: [R] What is the maximum size of a matrix?

2007-06-01 Thread Marc Schwartz
and that does not differ on 64 bit systems. HTH, Marc Schwartz On Fri, 2007-06-01 at 17:36 -0400, Doran, Harold wrote: There is no maximum size. This will be driven by (at least) two issues. First, how much memory you have on your own computer and second what data you have in each cell

Re: [R] R is not a validated software package..

2007-06-08 Thread Marc Schwartz
quite enlightening. One closing comment: There is increasing use of R within the FDA itself and this will only further help to assuage the fears of prospective users over time. Best regards, Marc Schwartz __ R-help@stat.math.ethz.ch mailing list https

Re: [R] legend + expression

2007-06-08 Thread Marc Schwartz
?formatC and ?sprintf for better options. HTH, Marc Schwartz __ R-help@stat.math.ethz.ch 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

Re: [R] ylim settings

2007-06-11 Thread Marc Schwartz
vectors. See ?par for more information, specifically 'xaxs'. HTH, Marc Schwartz __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html

Re: [R] removing values from a vector, where both the value and its name are the same?

2007-06-15 Thread Marc Schwartz
that the above example will likely fail if any of the values are floats: duplicated(c(0.5 - 0.4, 0.1)) [1] FALSE FALSE in which case, you would need to use a looping structure where the value comparisons use isTrue(all.equal(...)) instead. HTH, Marc Schwartz

Re: [R] model.frame: how does one use it?

2007-06-15 Thread Marc Schwartz
On Fri, 2007-06-15 at 10:47 -0500, Dirk Eddelbuettel wrote: Philipp Benner reported a Debian bug report against r-cran-rpart aka rpart. In short, the issue has to do with how rpart evaluates a formula and supporting arguments, in particular 'weights'. A simple contrived example is

Re: [R] removing values from a vector, where both the value and its name are the same?

2007-06-15 Thread Marc Schwartz
Good catch Patrick. I am guilty of the same error. Regards, Marc On Fri, 2007-06-15 at 20:25 +0100, Patrick Burns wrote: In case it matters, the given solution has a problem if the data look like: x - c(sum=77, test=99, sum=99) By the description all three elements should be kept, but

Re: [R] model.frame: how does one use it?

2007-06-15 Thread Marc Schwartz
On Fri, 2007-06-15 at 15:34 -0500, Dirk Eddelbuettel wrote: Hi Mark, Thanks for the reply. On 15 June 2007 at 14:33, Marc Schwartz wrote: | On Fri, 2007-06-15 at 10:47 -0500, Dirk Eddelbuettel wrote: | Philipp Benner reported a Debian bug report against r-cran-rpart aka rpart

Re: [R] rect() does not work

2007-06-15 Thread Marc Schwartz
r41831) on F7. You might want to check and see what par(lty) and par(lwd) return, in case they have been set to values resulting in lines that you would not be able to see. BTW, the c() is not required in creating 'x': x - 1:10 x [1] 1 2 3 4 5 6 7 8 9 10 Marc Schwartz

Re: [R] Upgraded FC4 to FC5 - unable to start device X11 in R

2007-06-15 Thread Marc Schwartz
consider upgrading to FC6. F7 just came out and I am running it, but I would recommend that typical users wait a while before doing so to give it time to stabilize. HTH, Marc Schwartz __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman

Re: [R] R vs. Splus in Pharma/Devices Industry

2007-06-15 Thread Marc Schwartz
On Sat, 2007-06-16 at 00:43 +0100, [EMAIL PROTECTED] wrote: On 15-Jun-07 19:43:55, John Kane wrote: --- Douglas Bates [EMAIL PROTECTED] wrote: On 6/15/07, Nicholas Lewin-Koh [EMAIL PROTECTED] wrote: [...] I think you mean A, not Z. First there was S, then there was R. We're

Re: [R] Histogram using frequency data

2007-06-18 Thread Marc Schwartz
: V1 - c(A, B, C, D) V2 - c(20, 50, 60, 30) # Do the barplot, saving the bar midpoints in 'mp' mp - barplot(V2, names.arg = V1, ylim = c(0, 80)) # Now add the bar values above the bars text(mp, V2, V2, pos = 3) See ?text and ?mtext for adding annotation HTH, Marc Schwartz

Re: [R] String manipulation, insert delim

2007-06-18 Thread Marc Schwartz
(strsplit(x, )) for (i in seq(length(cs.at) - 1)) vec - append(vec, char, cs.at[i] + i - 1) paste(vec, collapse = ) } insert.char(foo, bar) [1] have,a,nice,day See ?append HTH, Marc Schwartz __ R-help@stat.math.ethz.ch mailing list https

Re: [R] plot only x- and y-axis with origin, no box()

2007-06-19 Thread Marc Schwartz
the two axes disturbing. Has anyone an idea how to let these axes go to the origin? thank you in advance See this post: http://tolstoy.newcastle.edu.au/R/help/04/03/0911.html HTH, Marc Schwartz __ R-help@stat.math.ethz.ch mailing list https

<    6   7   8   9   10   11   12   13   14   15   >