Re: [R] How to keep the same class?

2011-09-02 Thread Marc Schwartz
,]) [1] 81.00 76.36 Many thanks Ed Ed, See: http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-do-my-matrices-lose-dimensions_003f and then use: predict(fit10, testX[1, , drop = FALSE]) HTH, Marc Schwartz __ R-help@r-project.org

Re: [R] how to create data.frames from vectors with duplicates

2011-08-31 Thread Marc Schwartz
of this kind calculations, so I'd like an efficient solution. Thanks See ?rep and ?as.data.frame.table Try this: data.frame(table(rep(y, x))) Var1 Freq 1a5 2b2 3c8 HTH, Marc Schwartz __ R-help@r-project.org mailing list https

Re: [R] Entering Multiline Commands With ESS

2011-08-31 Thread Marc Schwartz
= chemdata, … to take advantage of the formula method for boxplot(). HTH, Marc Schwartz Please explain how I enter these commands. Rich __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] TAB completion in R console when using Lion OSX

2011-08-31 Thread Marc Schwartz
to rev 5901, so you should update to that. For Mac specific queries, you should subscribe and post to the r-sig-mac list: https://stat.ethz.ch/mailman/listinfo/r-sig-mac HTH, Marc Schwartz __ R-help@r-project.org mailing list https://stat.ethz.ch

Re: [R] qnorm?

2011-08-23 Thread Marc Schwartz
. HTH, 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] dummy variables from factors

2011-08-23 Thread Marc Schwartz
for general info, you do not need to do this, as R's modeling functions will do this internally for you. That being said, if you want to do this manually see ?model.matrix HTH, Marc Schwartz __ R-help@r-project.org mailing list https://stat.ethz.ch

Re: [R] Two-levels labels on x-axis?

2011-08-22 Thread Marc Schwartz
= Groups) HTH, 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] Obtaining variable's names from a list of variables

2011-08-17 Thread Marc Schwartz
[[1]] [1] 1 2 [[2]] [1] M F names(listVar) NULL On the other hand, if you use: listVar - list(age = age, sex = sex) listVar $age [1] 1 2 $sex [1] M F names(listVar) [1] age sex HTH, Marc Schwartz __ R-help@r-project.org mailing list https

Re: [R] postscript( does not save the plot

2011-08-17 Thread Marc Schwartz
the whiskers fromt he blot. B.R From: Marc Schwartz marc_schwa...@me.com Cc: R-help@r-project.org R-help@r-project.org Sent: Tuesday, August 16, 2011 7:38 PM Subject: Re: [R] postscript( does not save the plot On Aug 16, 2011, at 12:32 PM, Alaios wrote

Re: [R] Text wrap

2011-08-16 Thread Marc Schwartz
) are not interpreted in character strings in plotmath, unlike normal plotting. You would need to create each line as a separate expression and use ?mtext, if you wish, to place each line along the axis, using the 'line' argument for placement/spacing. HTH, Marc Schwartz

Re: [R] postscript( does not save the plot

2011-08-16 Thread Marc Schwartz
as horizontal = FALSE, onefile = FALSE, paper = special. Note that the bounding box is for the device region: if you find the white space around the plot region excessive, reduce the margins of the figure region viapar(mar=). HTH, Marc Schwartz __ R-help@r

Re: [R] xtable - caption missing with float=FALSE

2011-08-10 Thread Marc Schwartz
' variant places the tabular environment within a table environment. The tabular environment does not support the \caption command, table does, hence no caption if the tabular is not contained within a float (floating = FALSE). HTH, Marc Schwartz

Re: [R] Sweave - landscape figure

2011-08-04 Thread Marc Schwartz
. Then use: \begin{landscape} other code here \end{landscape} That way you can create a landscape oriented page within a document that might otherwise contain portrait orientation pages. HTH, Marc Schwartz __ R-help@r-project.org mailing list

Re: [R] Automatic creation of binary logistic models

2011-08-04 Thread Marc Schwartz
the statistician and subject matter experts, to the detriment of inference. 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

Re: [R] Multiple endpoint (possibly group sequential) sample size calculation

2011-08-04 Thread Marc Schwartz
that at least Jennison and Turnbull (1999) have a chapter on multiple endpoints. HTH, 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

Re: [R] Can glmnet handle models with numeric and categorical data?

2011-08-04 Thread Marc Schwartz
, 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] replacing elements of vector through elements of another vector

2011-07-27 Thread Marc Schwartz
A B 1 2 NA 2 3 4 3 NA 3 4 4 1 5 2 NA 6 1 4 7 NA NA 8 5 3 9 4 1 with(DF, ifelse(!is.na(B), B, A)) [1] 2 4 3 1 2 4 NA 3 1 HTH, Marc Schwartz __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] About Validation of R

2011-07-21 Thread Marc Schwartz
Procedures that you may already have, or would need to be written for this purpose. 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

Re: [R] running previous versions of R

2011-07-15 Thread Marc Schwartz
an analysis that was done some time ago and have to use the same versions? If the former, be sure to contact the package maintainer to request that it be fixed, if they have not already orphaned it. Cheers, Marc Schwartz __ R-help@r-project.org

Re: [R] running previous versions of R

2011-07-15 Thread Marc Schwartz
On Jul 15, 2011, at 2:58 PM, jstevens wrote: I'm running Ubuntu - natty. Forgive me if I sound lost, its been just over a week since I switched over from Windows. I originally installed 2.12 using the Ubuntu software center, but have now switched to using the terminal. 2.9.2 was installed

Re: [R] Executing a function correctly

2011-07-13 Thread Marc Schwartz
) This is untested, but should work. The key is to only include the actual SQL query text in the paste call. HTH, 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

Re: [R] Connecting to Empress DB using RODBC

2011-07-12 Thread Marc Schwartz
syntax or perhaps a driver issue. HTH, 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

Re: [R] Stacked bar plot of frequency vs time

2011-07-11 Thread Marc Schwartz
0.25 22NANANA 33NANANA 44 0.55 0.25 0.20 55 0.65 0.20 0.15 # Now transpose the columns in DF to the matrix required for the plot barplot(t(DF2[, -1]), names.arg = DF2$Time) HTH, Marc Schwartz __ R-help@r

Re: [R] Making a new package: licence

2011-07-08 Thread Marc Schwartz
under the Lesser GNU General Public LIcense version 2.1. This can be displayed by RShowDoc(COPYING.LIB), or obtained at the URI given. 'Share and Enjoy.' HTH, Marc Schwartz __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r

Re: [R] Using t tests

2011-07-08 Thread Marc Schwartz
It is highly unlikely that LOS is normally distributed. HTH, Marc Schwartz On Jul 8, 2011, at 10:43 AM, Greg Snow wrote: How are you measuring length of stay? A chi-square test suggests that you have it categorized, a t-test assumes it is continuous (and relatively symmetric with the amount

Re: [R] Working with string

2011-07-07 Thread Marc Schwartz
are really saving by using it versus gsub() directly. HTH, 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

Re: [R] Working with string

2011-07-07 Thread Marc Schwartz
that, I want to report the selected string (in place of replacing with something?) What are the other related things? Can you help me giving some online reference? Thanks, -Original Message- From: Marc Schwartz [mailto:marc_schwa...@me.com] Sent: 07 July 2011 21:54 To: Bogaso

Re: [R] Access only part of last dimension of table/matrix

2011-07-02 Thread Marc Schwartz
On Jul 2, 2011, at 5:39 AM, peter dalgaard wrote: On Jul 2, 2011, at 03:29 , Marc Schwartz wrote: It actually scared me that I had any recollection of an isolated post from 10 years ago. Not sure what to make of that... If it is any consolation, the author had forgotten it entirely

Re: [R] testInstalledBasic

2011-07-01 Thread Marc Schwartz
in considering other possible solutions if locale is relevant here. HTH, Marc Schwartz On Jul 1, 2011, at 11:51 AM, Cody Hamilton wrote: Hello Uwe, Please forgive my ignorance - how can I get my diffs? Regards, -Cody --- On Fri, 7/1/11, Uwe Ligges lig...@statistik.tu-dortmund.de

Re: [R] Access only part of last dimension of table/matrix

2011-07-01 Thread Marc Schwartz
. 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] Reverse legend label order in barplot

2011-07-01 Thread Marc Schwartz
)), args.legend = list(fill = grey.colors(nrow(mat Alternatively, You can use legend() separately to add the legend to the barplot in the fashion that you desire. Thus: barplot(mat) legend(topright, legend = rownames(mat), fill = grey.colors(nrow(mat))) HTH, Marc Schwartz P.S

Re: [R] Access only part of last dimension of table/matrix

2011-07-01 Thread Marc Schwartz
On Jul 1, 2011, at 8:15 PM, David Winsemius wrote: On Jul 1, 2011, at 7:44 PM, Marc Schwartz wrote: On Jul 1, 2011, at 4:50 PM, David Winsemius wrote: I would like to do some operations inside a function using only one value for the last dimension of a table/matrix: tabfn

Re: [R] Sum Question

2011-06-30 Thread Marc Schwartz
aggregate(CONTTIME ~ DF$SCRNO, data = DF, sum) DF$SCRNO CONTTIME 1 HBA00200369 2 HBA00200873 3 HBA0020209 31 4 HBA0020213 11 5 HBA00202229 6 HBA0020292 70 See ?aggregate HTH, Marc Schwartz __ R-help@r-project.org

Re: [R] Sum Question

2011-06-30 Thread Marc Schwartz
On Jun 30, 2011, at 12:30 PM, Marc Schwartz wrote: On Jun 30, 2011, at 11:20 AM, Edgar Alminar wrote: I did this: library(data.table) dd - data.table(bl) dd[,sum(as.integer(CONTTIME)), by = SCRNO] (I used as.integer because I got an error message: sum not meaningful for factors

Re: [R] storing the return of system() function

2011-06-30 Thread Marc Schwartz
of system()? Thanks R-world, John Dennison See the 'intern' argument: system(date, intern = TRUE) [1] Thu Jun 30 17:06:12 CDT 2011 This returns a character vector of the results of the command executed. HTH, Marc Schwartz __ R-help@r

Re: [R] median time period

2011-06-29 Thread Marc Schwartz
function which has a Date method (defaulting to units in days) and also a 'lag' option: diff(as.Date(test, format = %y-%m-%d), lag = 4) Time differences in days [1] 283 224 359 367 I use 30.44 above to convert days to months. HTH, Marc Schwartz On Jun 29, 2011, at 10:50 AM, Iain Gallagher

Re: [R] Standards for delivery of GPL software in CRAN packages

2011-06-27 Thread Marc Schwartz
the packages without needing to have development tools (compilers, etc.) present on their systems. 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

Re: [R] two panel figure using barplot2

2011-06-23 Thread Marc Schwartz
be happening on your end. 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

Re: [R] change plot area in barplot2

2011-06-23 Thread Marc Schwartz
of the display (in pixels per inch) upon which the file is being viewed. See ?Devices for more information on the available output devices on your system. Then select the particular device you wish to use for details on how to adjust the dimensions. Regards, Marc Schwartz

Re: [R] Size argument in sample function

2011-06-17 Thread Marc Schwartz
Just use lapply(): set.seed(1) x - rnorm(20) lapply(1:3, function(i) sample(x, i)) [[1]] [1] -0.6264538 [[2]] [1] -0.3053884 -2.2146999 [[3]] [1] -2.21469989 -0.30538839 -0.04493361 HTH, Marc Schwartz On Jun 17, 2011, at 12:53 PM, Daniel Malter wrote: I am sure there is a more elegant

Re: [R] plot the y-axis upside down

2011-06-17 Thread Marc Schwartz
that the y-values (coordinates) are negative, which I don't want. Is there a simple way to do this? Jason This is where the 'ylim' argument to plot is helpful, along with ?rev and ?range: x - 1:10 y - 1:10 plot(x, y) versus: plot(x, y, ylim = rev(range(y))) HTH, Marc Schwartz

Re: [R] Matching vector order by indicators in a matrix

2011-06-16 Thread Marc Schwartz
,] 0.006280048 0.006280048 [2,] 0.330934659 0.330934659 If you want to overwrite Index.Matrix: Index.Matrix[] - Rates[Index.Matrix] Index.Matrix [,1][,2] [1,] 0.006280048 0.006280048 [2,] 0.330934659 0.330934659 HTH, Marc Schwartz

Re: [R] count length of continues elements in a vector

2011-06-07 Thread Marc Schwartz
] R2 $`1` [1] 4 5 3 $`2` [1] 2 4 6 4 $`3` [1] 2 2 $`4` [1] 3 4 1 Now use normal list processing to get the lengths and sums sapply(R2, length) 1 2 3 4 3 4 2 3 sapply(R2, sum) 1 2 3 4 12 16 4 8 HTH, Marc Schwartz __ R-help@r

[R] Generic function to split a vector by user defined values

2011-06-07 Thread Marc Schwartz
to folks. 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] Regular Expressions for Large Data Set

2011-06-07 Thread Marc Schwartz
33.58844 10616 0.002627 3 1 35006 AL ADGER 87.16746 33.43428 3205 0.000793 4 1 35007 AL KEYSTONE 86.81286 33.23687 14218 0.003519 5 1 35010 AL NEW SITE 85.95109 32.94145 19942 0.004935 6 1 35014 AL ALPINE 86.20893 33.33116 3062 0.000758 HTH, Marc Schwartz

Re: [R] Paid R Help

2011-06-02 Thread Marc Schwartz
each run of blockrand(), so that you can reproduce the sequencing again in the future, if required. HTH, 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

Re: [R] complex search between dataframes

2011-06-02 Thread Marc Schwartz
[findInterval(data2$position, t(data1)) %in% seq(1, 13, 2)] [1] 1 3 9 or data2$position: data2$position[findInterval(data2$position, t(data1)) %in% seq(1, 13, 2)] [1] 2 20 85 HTH, Marc Schwartz __ R-help@r-project.org mailing list https://stat.ethz.ch

Re: [R] barplot - change width of bar outline

2011-06-02 Thread Marc Schwartz
: par(lwd = 3) barplot(1:5, col = white) par(lwd = 1) barplot(1:5, density = 10, add = TRUE) If you don't need the cross hatching, just use the first two lines. HTH, Marc Schwartz __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman

Re: [R] xtable with conditional formatting using \textcolor

2011-06-01 Thread Marc Schwartz
{red}{ 6.00 } \\ 4 d \textcolor{blue}{ 8.00 } \\ 5 e \textcolor{blue}{ 10.00 } \\ \hline \end{tabular} \end{center} \end{table} HTH, Marc Schwartz __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

Re: [R] Problems Dating....

2011-06-01 Thread Marc Schwartz
convert a character/factor to a Date, you need to specify the format of the object to be converted: as.Date(3/4/2007, format = %m/%d/%Y) [1] 2007-03-04 See ?as.Date and ?strptime for more information and format specifications. HTH, Marc Schwartz __ R

Re: [R] lambda, uncertainty coefficient ( Somers D)

2011-05-31 Thread Marc Schwartz
On May 31, 2011, at 8:58 AM, David Winsemius wrote: On May 31, 2011, at 6:18 AM, Nora M wrote: Dear Marc Schwartz, I would also like to request the R code for doing this nominal measure of association analyses (if you dont mind..) You should learn to search: RSiteSearch

Re: [R] where two matrices differ?

2011-05-31 Thread Marc Schwartz
the use of ?all.equal due to: http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f HTH, Marc Schwartz On May 31, 2011, at 9:52 AM, Alaios wrote: Thanks alot. Unfortunately I can not apply this to much bigger matrices as I can not visually check

Re: [R] predictive accuracy

2011-05-31 Thread Marc Schwartz
looking at FDA panel discussion transcripts, search for related general stats terms confined to site:fda.gov Thanks for your help... Al -Original Message- From: Marc Schwartz [mailto:marc_schwa...@me.com] Sent: Thursday, May 26, 2011 10:54 AM To: El-Tahtawy, Ahmed Cc: r-help@r

Re: [R] Thiel's Uncertainty Coefficient

2011-05-26 Thread Marc Schwartz
of that code, or does anyone know if the calculation is now available in an R package? Please advise. Many thanks. --John J. Sparks, Ph.D. John, The code file in question has been sent offlist to you. Regards, Marc Schwartz __ R-help@r-project.org

Re: [R] R proxy settings for Mac

2011-05-26 Thread Marc Schwartz
.html HTH, 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] Time and db precision

2011-05-26 Thread Marc Schwartz
timestamp 2011-05-26 08:15:12.005103 HTH, 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

Re: [R] predictive accuracy

2011-05-26 Thread Marc Schwartz
, if the covariate is removed, you of course need to engage in fully re-evaluating the model. You cannot just drop the covariate and continue to use model fit assessments made on the full model. HTH, Marc Schwartz __ R-help@r-project.org mailing list

Re: [R] Using read.xls

2011-05-26 Thread Marc Schwartz
are passing the correct worksheet identifier. Also, as I am thinking about it, I believe that read.xls() is not set up to handle XLSX files, so be sure that this is not the case. If so, you will need to re-save the file to an XLS format file. HTH, Marc Schwartz

Re: [R] table of Design regressions?

2011-05-26 Thread Marc Schwartz
installation accordingly. If your output is the result of consolidating multiple such outputs, xtable() has a matrix method and a data frame method, whereby you could create the appropriate object as needed and then use xtable() on that. HTH, Marc Schwartz

Re: [R] Using read.xls

2011-05-26 Thread Marc Schwartz
On May 26, 2011, at 10:16 AM, Gabor Grothendieck wrote: On Thu, May 26, 2011 at 11:09 AM, Marc Schwartz marc_schwa...@me.com wrote: On May 26, 2011, at 5:09 AM, vioravis wrote: I am using read.xls command from the gdata package. I get the following error when I try to read a work sheet

Re: [R] Time and db precision

2011-05-26 Thread Marc Schwartz
On May 26, 2011, at 10:04 AM, Mikkel Grum wrote: Thanks Marc, I had just come up with another, slightly more convoluted solution. Add as.is = TRUE to the query and then get the timetoken with timetoken - df$timestamp[df$timestamp == max(as.POSIX(df$timestamp))] While it looks like

Re: [R] NaN, Inf to NA

2011-05-26 Thread Marc Schwartz
a 1 NA 2 NaN 3 Inf 4 1 5 2 6 3 Thanks! Cheers!! Albert-Jan The canonical way is to use is.na() to assign the NA value based upon a condition. See ?is.na for more information. is.na(df$a) - !is.finite(df$a) df a 1 NA 2 NA 3 NA 4 1 5 2 6 3 HTH, Marc Schwartz

Re: [R] Different behavior of median and mean function - Why?

2011-05-26 Thread Marc Schwartz
' for data frames, whereas mean does. HTH, 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

Re: [R] Processing large datasets

2011-05-25 Thread Marc Schwartz
, there will still be object size limitations predicated upon the fact that R uses 32 bit signed integers for indexing into objects. See ?Memory-limits for more information. HTH, Marc Schwartz On May 25, 2011, at 8:49 AM, Roman Naumenko wrote: Thanks Jonathan. I'm already using RMySQL

Re: [R] barplot groups of different size i.e. height is NOT a matrix

2011-05-25 Thread Marc Schwartz
from barplots to use point or dot plots and similar formats, especially where you also need to include some type of confidence interval for each measure. HTH, Marc Schwartz __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r

Re: [R] stepwise selection cox model

2011-05-25 Thread Marc Schwartz
upon this 1998 Stata FAQ recently during a related search: http://www.stata.com/support/faqs/stat/stepwise.html and there are more recent literature citations and books that reinforce those points. HTH, Marc Schwartz On May 25, 2011, at 4:28 AM, linda Porz wrote: Sorry, I have wrote a wrong

Re: [R] Accessing elements of a list

2011-05-25 Thread Marc Schwartz
be coerced to 3 (a character 3, not the number 3). If your actual data contains the same type in each element, replace lapply() above with sapply() and that will return a vector. HTH, Marc Schwartz __ R-help@r-project.org mailing list https://stat.ethz.ch

Re: [R] Formatting names.arg

2011-05-23 Thread Marc Schwartz
with a newline character ('\n'): barplot(1:9, names.arg = gsub( , \\\n, speciesnames), cex.names = 0.5) That will put the labels on two lines. See ?gsub and note that I used 3 '\' preceding the 'n'. HTH, Marc Schwartz __ R-help@r-project.org

Re: [R] Formatting names.arg

2011-05-23 Thread Marc Schwartz
On May 23, 2011, at 4:31 PM, David Winsemius wrote: On May 23, 2011, at 4:32 PM, Marc Schwartz wrote: On May 23, 2011, at 3:13 PM, Adrienne Keller wrote: I am making a barplot using barplot2 from gplots and would like to format the names of my categorical variables (tree species

Re: [R] trouble with summary tables with several variables using aggregate function

2011-05-19 Thread Marc Schwartz
Another approach, using aggregate(), presuming that the data is in a data frame called 'DF': with(DF, aggregate(Var3, list(Var1 = Var1, Var2 = Var2), table)) Var1 Var2 x.D x.I 1 S1 T1 2 2 2 S2 T1 2 2 3 S1 T2 2 2 4 S2 T2 0 4 HTH, Marc Schwartz On May 19

Re: [R] Summarize by two or more attributes

2011-05-17 Thread Marc Schwartz
of various types, matrices, data frames and even lists of lists. A quick example would be objects returned by R's model functions. Run example(lm) and after the graphs finish, use str(lm.D9) to give an example of the structure of a somewhat complex list object. HTH, Marc Schwartz

Re: [R] Summarize by two or more attributes

2011-05-17 Thread Marc Schwartz
column. The vector would be ordered in such a fashion as to match up with the original rows, based upon Bin and Type. I am tempted to quote a famous line from Cool Hand Luke, but I'll leave that for now... :-) Regards, Marc Schwartz __ R-help@r

Re: [R] Summarize by two or more attributes

2011-05-17 Thread Marc Schwartz
On May 17, 2011, at 2:55 PM, ROLL Josh F wrote: Marc, How could I also apply the spline function to each of the 'columns' found in the result from tapply(Df$Rate,list(Df$Bin,Df$Type),sum) ?? Something along the lines of the following:

Re: [R] Creating dataframes

2011-05-13 Thread Marc Schwartz
398 See ?split for more information. HTH, 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

Re: [R] Simple order() data frame question.

2011-05-12 Thread Marc Schwartz
that help? 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

Re: [R] R versions for Red Hat Linux

2011-05-11 Thread Marc Schwartz
at: https://stat.ethz.ch/mailman/listinfo/r-sig-fedora HTH, 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

Re: [R] Sweave: no eps fig

2011-05-06 Thread Marc Schwartz
a good idea to read news() if running a new version... :-) See ?RweaveLatex You can either set: echo=TRUE, fig=TRUE, label=Fig1, eps=true= or globally: \SweaveOpts{eps=true} HTH, Marc Schwartz __ R-help@r-project.org mailing list https

Re: [R] convert count data to binary data

2011-05-06 Thread Marc Schwartz
128 15 75 If you might need something more generalized to handle generating 'raw' data of various types from a contingency table, search the list archives for the function expand.dft, which I posted a few years ago and I think found its way into a couple of CRAN packages. HTH, Marc Schwartz

Re: [R] subset without removing NAs

2011-04-28 Thread Marc Schwartz
NA HTH, 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] histogram of dates

2011-04-22 Thread Marc Schwartz
for a missing value for this argument. truehist() does not have a method for Date class objects, but you could do: truehist(as.numeric(temp)) or perhaps use cut.Date() on the vector and create the intervals/breakpoints that you wish to use. HTH, Marc Schwartz

Re: [R] Create 2x2 table from summary data and run chi square test.

2011-04-22 Thread Marc Schwartz
= 0.9141, df = 1, p-value = 0.339 HTH, 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

Re: [R] What does the - operator mean?

2011-04-21 Thread Marc Schwartz
the potential confusion over variable scoping issues, which is why - and - may not be interchangeable as you are observing. HTH, Marc Schwartz __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] Power Analysis

2011-04-19 Thread Marc Schwartz
to the core R function. HTH, 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

Re: [R] Simple question

2011-04-19 Thread Marc Schwartz
to love lists. It will be rewarding! :-) Fortunes candidate :-) Cheers, 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

Re: [R] as.formula doesn't want to take a phrase

2011-04-18 Thread Marc Schwartz
for.my.example ~ group HTH, 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

Re: [R] Rotating the x-axis labels of a barplot

2011-04-16 Thread Marc Schwartz
) HTH, 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] str() on a data frame with 600 variables

2011-04-15 Thread Marc Schwartz
901 902 903 904 905 906 907 908 909 910 ... $ V200: int 951 952 953 954 955 956 957 958 959 960 ... HTH, 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

Re: [R] saving a regression model to a file

2011-04-14 Thread Marc Schwartz
output. When using load(), it restores the saved objects in the file to the current workspace. If you use: ls() you should see 'pcrmodel' listed, along with anything else in your current workspace. HTH, Marc Schwartz getting summary of model after loading### summary

Re: [R] Find number of elements less than some number: Elegant/fast solution needed

2011-04-14 Thread Marc Schwartz
, and I need to convert them to the corresponding 'index' if the 'y' values are removed. Something like the following might work, if I correctly understand the problem: match(x, x[-y]) [1] 1 NA 2 3 NA NA 4 5 NA 6 HTH, Marc Schwartz __ R-help@r

Re: [R] Quick recode of -999 to NA in R

2011-03-30 Thread Marc Schwartz
, specifically the assignment variant. 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

Re: [R] postscript rotation (bug?)

2011-03-30 Thread Marc Schwartz
/2005-March/067051.html HTH, 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

Re: [R] Compare three or more values?

2011-03-23 Thread Marc Schwartz
] FALSE Note that this is fine for character and integer values, but should not be expected to work for floats. In the latter case, see ?all.equal and R FAQ 7.31: Why doesn't R think these numbers are equal? HTH, Marc Schwartz __ R-help@r

Re: [R] median survival time from survfit

2011-03-18 Thread Marc Schwartz
information specific to this function. HTH, 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

Re: [R] R Statistical Package Installation

2011-03-05 Thread Marc Schwartz
. If by chance you are on a Linux variant, there are binaries available for selected distributions, but we would need more information to guide you further. HTH, Marc Schwartz P.S. I dropped the R-devel e-mail cc:. Please only send queries to one list. See the Posting Guide: http://www.R-project.org

Re: [R] R and Android

2011-03-02 Thread Marc Schwartz
If you search the list archives (using keywords such as iPhone or iPad), you will see extensive discussions on this point. There is/was an option to install a full R application on so-called jail broken Apple mobile units **only**. Otherwise, it's client/server. HTH, Marc Schwartz On Mar 2

Re: [R] accuracy of measurements

2011-02-25 Thread Marc Schwartz
studies, primarily based upon methods by Bland and Altman. HTH, 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

Re: [R] R in different OS

2011-02-25 Thread Marc Schwartz
: On Unixen (eg. Linux, OSX) .Platform$OS.type [1] unix and on Windows, will be windows. If needed, look at the additional functions listed in the See Also on the help page (eg. ?Sys.info, etc.). HTH, Marc Schwartz __ R-help@r-project.org mailing list https

Re: [R] barplot with errorbars

2011-02-17 Thread Marc Schwartz
and ?segments functions typically serve as the basis for drawing the CIs around the points representing the means. HTH, Marc Schwartz On Feb 17, 2011, at 2:38 PM, Aldi Kraja wrote: Hi Toby and Maria, I did a check on Toby's suggestion and it is not there: R version 2.12.1 (2010-12-16

Re: [R] Modifying a package name / Build from sources (rpart)

2011-02-10 Thread Marc Schwartz
by using rpart::FunctionName versus YourPackage::FunctionName, where FunctionName is the same. You might want to review The Writing R Extensions manual for more information. HTH, Marc Schwartz __ R-help@r-project.org mailing list https://stat.ethz.ch

Re: [R] Problem with long number (from character to numeric class)

2011-02-09 Thread Marc Schwartz
with very large integers. Perhaps look at gmp and Rmpfr. You are hitting R's limit of 15 significant digits, resulting in the loss of precision in the internal representation of the number, which is in turn, presented in the resultant coercion. HTH, Marc Schwartz

<    3   4   5   6   7   8   9   10   11   12   >