Re: [R] sum portions of a vector

2012-12-10 Thread Marc Schwartz
, findInterval(seq(along = vec), breaks + 1)), function(x) paste(sum(x), =, paste(x, collapse = + [1] 6 = 1+2+3 30 = 4+5+6+7+8 19 = 9+10 Regards, Marc Schwartz __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman

Re: [R] sum portions of a vector

2012-12-10 Thread Marc Schwartz
On Dec 10, 2012, at 2:52 PM, David Winsemius dwinsem...@comcast.net wrote: On Dec 10, 2012, at 11:29 AM, Sam Steingold wrote: How do I sum portions of a vector into another vector? E.g., for --8---cut here---start-8--- vec - 1:10 breaks - c(3,8,10)

Re: [R] sum portions of a vector

2012-12-10 Thread Marc Schwartz
On Dec 10, 2012, at 3:29 PM, Marc Schwartz marc_schwa...@me.com wrote: On Dec 10, 2012, at 2:52 PM, David Winsemius dwinsem...@comcast.net wrote: On Dec 10, 2012, at 11:29 AM, Sam Steingold wrote: How do I sum portions of a vector into another vector? E.g., for --8---cut

Re: [R] subset data frame by variable with missing value

2012-11-30 Thread Marc Schwartz
can I perform this simple task in R? Thanks in advance for your help. The easiest is probably: NewDF - subset(DF, is.na(myvalue)) See ?is.na Regards, Marc Schwartz __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r

Re: [R] Reading .gsheet within R

2012-11-30 Thread Marc Schwartz
-as-data-in-r.html I would be sure to read the comments as well. Regards, Marc Schwartz On Nov 30, 2012, at 4:12 PM, Rui Barradas ruipbarra...@sapo.pt wrote: Hello, Package sos does a good job at finding things available for R. library(sos) findFn('gsheet') found 0 matches x has zero

Re: [R] Installing R under Redhat el6

2012-11-28 Thread Marc Schwartz
is pretty much all you should need. 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

Re: [R] puzzling RODBC error

2012-11-26 Thread Marc Schwartz
that something is amiss in the configuration. 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

Re: [R] Connect R with SQLSERVER

2012-11-26 Thread Marc Schwartz
versions of the package available for Windows? Just use: install.packages(RODBC) within an R session. Finally, R version 2.12.0 is now over two years old. 2.15.2 is the current version, so you should also be updating your R installation. Regards, Marc Schwartz

Re: [R] remote connection to an Oracle database - using RODBC - RMySQL..?

2012-11-26 Thread Marc Schwartz
not reveal anything material on that point. 7. Alternatives to RODBC would include ROracle and RJDBC via CRAN. Regards, Marc Schwartz [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https

Re: [R] Stepwise analysis with fixed variables

2012-11-21 Thread Marc Schwartz
and is linked in the See Also section of ?step. To your second question, you can't. It uses AIC and this has also been discussed frequently on this list. You might look at Frank's fastbw() function in his 'rms' package on CRAN. Regards, Marc Schwartz __ R

Re: [R] Scaling values 0-255 - -1 , 1 - how can this be done?

2012-11-21 Thread Marc Schwartz
, this transforms my dataframe to 0 and 1 values, but I wish to use -1 and 1 and looking for a way in R to do this. Brian See ?ifelse ifelse(value 127.5, 1, -1) You might want to think about what happens when value == 127.5 ... Regards, Marc Schwartz

Re: [R] installing Rmpi on centos 6 with mpich

2012-11-21 Thread Marc Schwartz
in advance Ricardo There is a page here: http://www.stats.uwo.ca/faculty/yu/Rmpi/ which is linked from the CRAN page for the package. On the above page, there is an Installation for Linux link, which is likely to be helpful. Regards, Marc Schwartz __ R

Re: [R] installing Rmpi on centos 6 with mpich

2012-11-21 Thread Marc Schwartz
, which is what you are showing below. If you have tried that and failed, then I would recommend contacting the package maintainer for assistance or perhaps posting to R-SIG-HPC: https://stat.ethz.ch/mailman/listinfo/r-sig-hpc Marc On Wed, Nov 21, 2012 at 11:34 AM, Marc Schwartz marc_schwa

Re: [R] remote connection to an Oracle database - using RODBC - RMySQL..?

2012-11-21 Thread Marc Schwartz
using Kerberos authentication on my Oracle server here, so you may have to follow up on the R-SIG-DB list on that point. A search of the archives did not reveal anything material on that point. 7. Alternatives to RODBC would include ROracle and RJDBC via CRAN. Regards, Marc Schwartz

Re: [R] Deleting rows with special character

2012-11-16 Thread Marc Schwartz
is fast code. 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] Boxplot in R

2012-11-16 Thread Marc Schwartz
. The See Also on that help page points you to ?boxplot.stats which does the computation and has additional detail. Both pages list references. If all else fails, since R is open source, you can always look at the source code for both functions to follow exactly what is done. Regards, Marc Schwartz

Re: [R] install own package ?

2012-11-14 Thread Marc Schwartz
a source package. You need to use: install.packages(/Users/hoffmann/R/cwhmisc_4.0.tar.gz, repos = NULL, type = source) Regards, Marc Schwartz __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE

Re: [R] no y-axis

2012-11-12 Thread Marc Schwartz
, 'bty', for options there. Or, you can always use ?segments, knowing that par(usr) gives you the coordinates of the plot region corners... Regards, Marc Schwartz On Nov 12, 2012, at 1:04 PM, Rui Barradas ruipbarra...@sapo.pt wrote: Hello, If you want to completely remove the axis, overplot

Re: [R] Remove missings (quick question)

2012-11-09 Thread Marc Schwartz
is to remove observations with any missing data (eg. NA values) when using modeling functions. Or you can pre-process using: D.New - na.omit(D) and then use D.New for all of your subsequent analyses. See ?na.omit. Regards, Marc Schwartz __ R-help@r

Re: [R] Remove missings (quick question)

2012-11-09 Thread Marc Schwartz
On Nov 9, 2012, at 11:23 AM, Bert Gunter gunter.ber...@gene.com wrote: Marc et. al: On Fri, Nov 9, 2012 at 9:05 AM, Marc Schwartz marc_schwa...@me.com wrote: On Nov 9, 2012, at 10:50 AM, Eiko Fried tor...@gmail.com wrote: A colleague wrote the following syntax for me: D = read.csv

Re: [R] Logistic curve fitting with y values 1 (R version 2.15.2, OS is OS X 10.6.8)

2012-11-09 Thread Marc Schwartz
in R? - J You might want to look at John Fox' appendix on non-linear models for some additional insights: http://socserv.mcmaster.ca/jfox/Books/Companion/appendix/Appendix-Nonlinear-Regression.pdf Regards, Marc Schwartz __ R-help@r-project.org

Re: [R] Absolute path in gdata library

2012-11-08 Thread Marc Schwartz
On Nov 8, 2012, at 12:57 AM, Prof Brian Ripley rip...@stats.ox.ac.uk wrote: On 07/11/2012 23:12, Marc Schwartz wrote: On Nov 7, 2012, at 4:58 PM, r ric.rom...@gmail.com wrote: Dear list, I have some .xls files that I need to read into R. I am able to do so using read.xls in the gdata

Re: [R] Executing SAS Codes in R

2012-11-08 Thread Marc Schwartz
: http://cran.r-project.org/web/packages/sas7bdat/index.html 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] Absolute path in gdata library

2012-11-08 Thread Marc Schwartz
On Nov 8, 2012, at 9:33 AM, Prof Brian Ripley rip...@stats.ox.ac.uk wrote: On 08/11/2012 15:28, Marc Schwartz wrote: On Nov 8, 2012, at 12:57 AM, Prof Brian Ripley rip...@stats.ox.ac.uk wrote: On 07/11/2012 23:12, Marc Schwartz wrote: On Nov 7, 2012, at 4:58 PM, r ric.rom...@gmail.com

Re: [R] Controlling R fonts through LaTeX

2012-11-08 Thread Marc Schwartz
will then be used throughout. There is too much text to use PSFrag. Thanks for your help! Karen Take a look at ?ps.options, which is referenced in ?postscript in the Details and See Also sections there. Regards, Marc Schwartz __ R-help@r-project.org mailing

Re: [R] How to include CI in a grouped barplot?

2012-11-08 Thread Marc Schwartz
center. A conceptual note, which is that this format can be ok for proportions/percentages, but you will recommendations against using this format to display continuous data (eg. means +/- SE). In that case, point plots with CI's is preferred. Regards, Marc Schwartz

Re: [R] Formatting digits in a table with mix of numbers and characters

2012-11-08 Thread Marc Schwartz
--123.5 [9] -- matrix(Vec.new, ncol = 3, byrow = TRUE) [,1][,2][,3] [1,] 12.35 --10 [2,] 12.35 --NA [3,] --123.5 -- Regards, Marc Schwartz __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r

Re: [R] Obtaining R-squared value in Logistic Regression

2012-11-08 Thread Marc Schwartz
pseudo R^2 as part of the model output. However, be sure you understand what it means in the context of logistic regression. It is not the same as the R^2 in OLS regression. Regards, Marc Schwartz __ R-help@r-project.org mailing list https

Re: [R] extract indep vars from formula

2012-11-07 Thread Marc Schwartz
be the first element in the returned vector. So, if you just want the IV's you could use: all.vars(formula(MODEL))[-1] An example: # from ?cars fm1 - lm(log(dist) ~ log(speed), data = cars) all.vars(formula(fm1)) [1] dist speed Regards, Marc Schwartz

Re: [R] Absolute path in gdata library

2012-11-07 Thread Marc Schwartz
filename in that function in your code, so that when you use relative paths, the appropriate expansion is used and passed to the gdata function as the filename argument. I just made this change myself in the WriteXLS package at the request of another useR. Regards, Marc Schwartz

Re: [R] Problem compiling Rnw file

2012-11-05 Thread Marc Schwartz
of prior experience, but because I have never needed to. Just use the full path to whatever external files you need, rather than changing the working directory in order to avoid using the full path. That has worked for me over hundreds of Sweave reports over the course of many years. Regards, Marc

Re: [R] r-help or r-devel ?

2012-11-05 Thread Marc Schwartz
subscribe first: https://stat.ethz.ch/mailman/listinfo/r-devel as it will save the R-Devel list moderators from having to manually approve each of your posts, therefore making your posting more expedient. Thanks and regards, Marc Schwartz __ R-help

Re: [R] R 2.15.2 is released

2012-11-04 Thread Marc Schwartz
... Regards, Marc Schwartz On Sun, Nov 4, 2012 at 7:01 AM, Sam Steingold s...@gnu.org wrote: I have some packages installed using install.packages(). Do I need to reinstall them? https://r-forge.r-project.org/tracker/?func=detailatid=294aid=2224group_id=61 Not a bug: This only happens

Re: [R] Aggregate Table Data into Cell Frequencies

2012-10-31 Thread Marc Schwartz
0 0 0 3 0 0 3 1 4 4 3 5 temp9 0 0 0 0 0 6 0 0 6 2 2 3 0 4 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] Opening SAS file using read.sas7bdat() function in sas7bdat library.

2012-10-29 Thread Marc Schwartz
someone tell me what this error means? Thank you, Praveen. More than likely, a similar problem as in this recent thread, but for 64 bit, rather than 32 bit: https://stat.ethz.ch/pipermail/r-help/2012-October/325257.html Regards, Marc Schwartz

Re: [R] Opening SAS file using read.sas7bdat() function in sas7bdat library.

2012-10-29 Thread Marc Schwartz
On Oct 29, 2012, at 2:04 PM, Duncan Murdoch murdoch.dun...@gmail.com wrote: On 29/10/2012 2:54 PM, Marc Schwartz wrote: On Oct 29, 2012, at 1:28 PM, Praveen Surendran praveen.surend...@ucd.ie wrote: Hi, I have a file in .sas7bdat format. I tried to open this file using

Re: [R] Package RODBC sqlQueries

2012-10-26 Thread Marc Schwartz
, Site Mapping Detail\));) testData - sqlQuery(db, Query) It is also possible that you may not need to use the final semi-colon. Regards, Marc Schwartz I get no error messages, but I when call for testData, I get the following: testData [1] 07002 -3010 [Microsoft][ODBC Microsoft Access

Re: [R] Kaplan Meier Post Hoc?

2012-10-24 Thread Marc Schwartz
for multiple pairwise comparison adjustment methods. The most conservative, but not always the best approach, would of course be Bonferroni. Regards, Marc Schwartz __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE

Re: [R] Error in contrasts message when using logistic regression code.

2012-10-23 Thread Marc Schwartz
for the distribution of your IVs. 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

Re: [R] cannot coerce class 'rle' into a data.frame

2012-10-16 Thread Marc Schwartz
7 5 1 6 str(as.data.frame(unclass(RES))) 'data.frame': 5 obs. of 2 variables: $ lengths: int 5 4 3 2 1 $ values : int 10 9 8 7 6 Regards, Marc Schwartz __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo

Re: [R] Loss of dimensions in subsetting arrays

2012-10-12 Thread Marc Schwartz
. Helsinki You can save yourself a lot of time if you visit the R FAQ as your first action item when such questions come up. In this case: http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-do-my-matrices-lose-dimensions_003f Regards, Marc Schwartz __ R

Re: [R] Options to extend memory limit

2012-10-11 Thread Marc Schwartz
or of course install more RAM. 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

Re: [R] PKPD modelling in R

2012-10-08 Thread Marc Schwartz
in the CRAN checks for problems already found. If you have not, you might want to look at the CRAN task view here: http://cran.r-project.org/web/views/Pharmacokinetics.html which might provide some possible alternatives. Regards, Marc Schwartz

Re: [R] LaTeX consistent publication graphics from R and Comparison of GLE and R

2012-10-06 Thread Marc Schwartz
for using PSTricks. Keep in mind that since this is PostScript based, you need to use a latex + dvips + ps2pdf sequence, rather than just pdflatex. Regards, Marc Schwartz __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r

Re: [R] LaTeX consistent publication graphics from R and Comparison of GLE and R

2012-10-05 Thread Marc Schwartz
this is PostScript based, you need to use a latex + dvips + ps2pdf sequence, rather than just pdflatex. 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

Re: [R] Rainflow, range pair counting

2012-10-04 Thread Marc Schwartz
in. Regards, Marc Schwartz On Oct 4, 2012, at 10:27 AM, R. Michael Weylandt michael.weyla...@gmail.com wrote: R is used by many many folks, and most of us don't have the domain knowledge to make heads or tails of what you're mentioning here. You'll need to greatly clarify and perhaps ask

Re: [R] can stepAIC be customized to exclude coefficients with p-value less than certain values?

2012-10-04 Thread Marc Schwartz
that? SAS seems to be able to customized stepwise function with p-value or cooks'd. You might take some time to ponder the possibility that the fact that it's not easy in R might be useful information in its own right. I nominate this as a fortune candidate... Regards, Marc Schwartz

Re: [R] Regarding licensing Terms

2012-10-03 Thread Marc Schwartz
and distributing. In the latter case, whether you plan to charge for the resultant product or make it available for free, is irrelevant. Regards, Marc Schwartz __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] Regarding licensing Terms

2012-10-03 Thread Marc Schwartz
On Oct 3, 2012, at 9:56 AM, Spencer Graves spencer.gra...@structuremonitoring.com wrote: On 10/3/2012 7:26 AM, Marc Schwartz wrote: On Oct 3, 2012, at 4:49 AM, Narendra pratap.naren...@gmail.com wrote: Hi, I have developed one application using ggmap package.It is based on google map

Re: [R] Importing a CSV file

2012-09-19 Thread Marc Schwartz
? Marc Schwartz P.S. It's International Talk Like a Pirate Day, which of course fits with a certain language we all hold dear. Somebody had to do it... ;-) Sarah -Oorspronkelijk bericht- Van: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Namens Sarah Goslee

Re: [R] Error in Installing RODBC in Linux R

2012-08-28 Thread Marc Schwartz
be accessed by using: vignette(RODBC) 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

Re: [R] variable scope

2012-08-28 Thread Marc Schwartz
a function that takes requisite arguments and runs the for() loop within the function body and returns the object you actually need. That way, any variables created within the scope of the function are gone when the function exits. Regards, Marc Schwartz

Re: [R] Search for locations of subsequences?

2012-08-28 Thread Marc Schwartz
and towards the end has a post with some timings. 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

Re: [R] Reading pdf file into R

2012-08-27 Thread Marc Schwartz
itself is predicated upon the source PDF not being a scanned image of a text page, in which case you would need an OCR based application. Regards, Marc Schwartz On Aug 27, 2012, at 1:48 PM, Christofer Bogaso bogaso.christo...@gmail.com wrote: Thanks Berend for your reply. However I

Re: [R] R minimal calculation error

2012-08-24 Thread Marc Schwartz
results like -2.315223e-18 This is really near to 0 but not very aesthetic. Can I prevent this? Or is this behaviour desired? Thank you very much! Burtan Read this: http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f Regards, Marc Schwartz

Re: [R] if then in R versus SAS

2012-08-24 Thread Marc Schwartz
-Statistics-Computing/dp/0387094172 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

Re: [R] Sweave: R chunk inside caption?

2012-08-21 Thread Marc Schwartz
. it is multiple lines/function calls, etc.), I will generally have the R code in an R chunk, assign the result to a scalar and then include that scalar in the \Sexpr{}: This is referenced in the Sweave manual and FAQ: http://www.statistik.lmu.de/~leisch/Sweave/ Regards, Marc Schwartz

Re: [R] make check fails two tests on RHEL 6 build

2012-08-21 Thread Marc Schwartz
there is as easy as adding the EPEL to your repo list and using 'yum install R' as root (eg. via sudo) from the CLI. Regards, Marc Schwartz __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] jpeglib.h not found

2012-08-20 Thread Marc Schwartz
specific R e-mail list at: https://stat.ethz.ch/mailman/listinfo/r-sig-fedora You should subscribe to and post there with any follow ups or future Fedora specific R queries. Regards, Marc Schwartz __ R-help@r-project.org mailing list https

Re: [R] A LaTeX question -- Hope people won't mind

2012-08-20 Thread Marc Schwartz
Forest Model Using Scoring Data (N = 700)} 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

Re: [R] problem installing mgcv

2012-08-14 Thread Marc Schwartz
here: https://stat.ethz.ch/mailman/listinfo/r-sig-mac 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

Re: [R] subsetting levels of a vector

2012-08-10 Thread Marc Schwartz
the use of '!' before Electrode to negate the boolean logic. 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

Re: [R] r-forge down?

2012-08-07 Thread Marc Schwartz
That's not the same site, as is noted at the bottom of that site's main page. It does appear that R-Forge is down, albeit the domain is resolving and the server IP is responding quickly to pings with no packet loss. Regards, Marc Schwartz On Aug 7, 2012, at 5:29 PM, Roy Mendelssohn

Re: [R] test if elements of a character vector contain letters

2012-08-07 Thread Marc Schwartz
On Aug 7, 2012, at 3:02 PM, Liviu Andronic landronim...@gmail.com wrote: On Mon, Aug 6, 2012 at 7:35 PM, Marc Schwartz marc_schwa...@me.com wrote: is.letter - function(x) grepl([[:alpha:]], x) is.number - function(x) grepl([[:digit:]], x) Another follow-up. To test for (non-)alphanumeric

Re: [R] test if elements of a character vector contain letters

2012-08-07 Thread Marc Schwartz
On Aug 7, 2012, at 3:18 PM, Marc Schwartz marc_schwa...@me.com wrote: On Aug 7, 2012, at 3:02 PM, Liviu Andronic landronim...@gmail.com wrote: On Mon, Aug 6, 2012 at 7:35 PM, Marc Schwartz marc_schwa...@me.com wrote: is.letter - function(x) grepl([[:alpha:]], x) is.number - function(x

Re: [R] test if elements of a character vector contain letters

2012-08-06 Thread Marc Schwartz
b10 c8 d3 e6 f1 g5 ... system.time(is.letter(x)) user system elapsed 0.011 0.000 0.010 system.time(is.number(x)) user system elapsed 0.010 0.000 0.011 Regards, Marc Schwartz On Aug 6, 2012, at 11:51 AM, Rui Barradas ruipbarra...@sapo.pt wrote: Hello, Fun

Re: [R] test if elements of a character vector contain letters

2012-08-06 Thread Marc Schwartz
On Aug 6, 2012, at 12:06 PM, Marc Schwartz marc_schwa...@me.com wrote: Perhaps I am missing something, but why use sapply() when grepl() is already vectorized? is.letter - function(x) grepl([:alpha:], x) is.number - function(x) grepl([:digit:], x) Sorry, typos in the above from my CP

Re: [R] Logistic regression X^2 test with large sample size (fwd)

2012-07-31 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] Help with NaN when 0 divided by 0

2012-07-31 Thread Marc Schwartz
, Jen You could use ?ifelse: ifelse(var2 == 0, 0, var1 / var2) [1] 0.0 13.9 53.79000 0.0 150.0 350.0 It is very common in programming to include code to handle exceptions, so don't be shy about using conditional coding as may be appropriate. Regards, Marc Schwartz

Re: [R] svyglm AIC: NA??????'

2012-07-25 Thread Marc Schwartz
in a post earlier today: https://stat.ethz.ch/pipermail/r-help/2012-July/319508.html Also, please start a new thread when you post, rather than replying to an existing thread. Regards, Marc Schwartz __ R-help@r-project.org mailing list https

Re: [R] Crosstab with Average and Count

2012-07-20 Thread Marc Schwartz
) 10 20 30 1 100 NA NA 2 NA 200 NA 3 NA NA 300 tapply(z, list(x, y), function(x) sum(!is.na(x))) 10 20 30 1 2 NA NA 2 NA 3 NA 3 NA NA 3 Regards, Marc Schwartz __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r

Re: [R] Cost Effectiveness Example

2012-07-17 Thread Marc Schwartz
these analyses seem overlap to an extent with that domain: http://cran.us.r-project.org/web/views/MachineLearning.html 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

Re: [R] Power analysis for Cox regression with a time-varying covariate

2012-07-17 Thread Marc Schwartz
Covariates F.Y. Hsieh and Philip W. Lavori Controlled Clinical Trials 21:552–560 (2000 A skillful Google search will find both available online if you don't have access otherwise. Regards, Marc Schwartz On Jul 17, 2012, at 12:33 PM, Greg Snow wrote: One quick (though probably not canned

Re: [R] Vuong test

2012-07-13 Thread Marc Schwartz
want a negative binomial model, you should be using glm.nb() in VR's MASS package: require(MASS) NB1 - glm.nb(...) Then you can use the Vuong test from pscl. If you have not, you might want to read: vignette(countreg) Regards, Marc Schwartz __ R

Re: [R] Compare date Oracle with Sys.time

2012-07-06 Thread Marc Schwartz
still use ?as.Date to coerce the column to a Date class and use the above incantation. See ?subset for additional information on that function. Regards, Marc Schwartz __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] How to import SAS data in R?

2012-07-06 Thread Marc Schwartz
enough, there is an entire manual on importing and exporting data to/from R: http://cran.r-project.org/manuals.html Several suggestions there for SAS in the relevant manual: http://cran.r-project.org/doc/manuals/R-data.html#Importing-from-other-statistical-systems Regards, Marc Schwartz

Re: [R] Is R BOOT package available for 2.15.1 version for Mac OS?

2012-07-06 Thread Marc Schwartz
' is part of the standard R installation as a recommended package. All you need to do is either: library(boot) or require(boot) Regards, Marc Schwartz __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

Re: [R] RODBC tables

2012-07-05 Thread Marc Schwartz
table? You may want to verify that with your DBAdmin. Is that actually the name of the table? 3. Try using: nowfetchmewilwheaton - sqlQuery(check, select * from ANYTHING) and see if that works. Regards, Marc Schwartz __ R-help@r-project.org

Re: [R] Decrete value check in a matrix

2012-07-02 Thread Marc Schwartz
TRUE 4 5.6 6.7 FALSE FALSE Regards, Marc Schwartz On Jul 2, 2012, at 7:46 AM, John Kane wrote: You are not asking for a Decrete [sic] (descrete) value check but rather if the numbers are intergers. Try this: # from the ?is.integer help page is.wholenumber - function(x

Re: [R] trend in incidence rate

2012-06-28 Thread Marc Schwartz
rates? I checked epiR and epitools. It seems they do not have this function. Thank you for the help. You can use ?prop.trend.test or you can also look at the ?independence_test function with 'teststat = quad', which is in the coin package on CRAN. Regards, Marc Schwartz

Re: [R] Zero inflated: is there a limit to the level of inflation

2012-06-26 Thread Marc Schwartz
will also be helpful in that setting and you would likely be pointed to the glmer() function in the lme4 package for that application, which provides for GLMs in a mixed effects framework. Regards, Marc Schwartz __ R-help@r-project.org mailing list

Re: [R] Chi square value of anova(binomialglmnull, binomglmmod, test=Chisq)

2012-06-06 Thread Marc Schwartz
to consider using some of the tools in Frank's rms package on CRAN to further evaluate/validate that model. 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

Re: [R] Why do I have a column called row.names?

2012-06-04 Thread Marc Schwartz
, or Ed might use ?debug to follow the code execution in read.table() and see where the relevant flags get triggered. The latter option would help Ed learn how to use the debugging tools that R provides to dig more deeply into such issues. Regards, Marc Schwartz On Jun 4, 2012, at 1:30 PM

Re: [R] regular expression and R

2012-06-04 Thread Marc Schwartz
typically use for reference are: http://www.regular-expressions.info/ and Mastering Regular Expressions Jeffrey Friedl http://www.amazon.com/Mastering-Regular-Expressions-Second-Edition/dp/0596002890 Regards, Marc Schwartz __ R-help@r-project.org

Re: [R] regression methods for rare events?

2012-06-04 Thread Marc Schwartz
and is due RSN. Perhaps there will be copies at useR in Nashville next week? One could hope... :-) 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

Re: [R] how to add a 'label' column

2012-06-01 Thread Marc Schwartz
, Marc Schwartz On Jun 1, 2012, at 3:06 PM, Rui Barradas wrote: Hello, Try score2$subject - rep(score$subject, 7) Hope this helps, Rui Barradas Em 01-06-2012 20:47, Jason Love escreveu: Hello R users, I'd like to ask a question about how to add a new column. So, below is my

Re: [R] linux

2012-05-27 Thread Marc Schwartz
On May 27, 2012, at 9:45 AM, Soheila Khodakarim wrote: Dear All Pleade give me an URL that I can download R for cenos linux 64 bit. R is available from the EPEL for RHEL, CentOS and Scientific Linux: http://fedoraproject.org/wiki/EPEL Regards, Marc Schwartz

Re: [R] problem with installing rms package

2012-05-25 Thread Marc Schwartz
but it didnt work regards GRR The latest version of survival on CRAN is 2.36-14. When you install rms, be sure to use: install.packages(rms, dependencies = TRUE) to be sure that package dependencies are satisfied during the installation. Regards, Marc Schwartz

Re: [R] problem with installing rms package

2012-05-25 Thread Marc Schwartz
of package 'AER' had non-zero exit status 18: In install.packages(rms, dependencies = TRUE) : installation of package 'dynlm' had non-zero exit status what can be done? Regards GRR On 25 May 2012 10:09, Marc Schwartz marc_schwa...@me.com wrote: On May 25, 2012, at 8:51 AM, ramakanth

Re: [R] Breaking up a vector

2012-05-25 Thread Marc Schwartz
of the original x. Regards, Marc Schwartz On May 25, 2012, at 10:56 AM, Rui Barradas wrote: Hello, Tip: see the difference between the following two. for(i in 1:7) cat(i, :, (i-1)*7:(i)*7, \n) for(i in 1:7) cat(i, :, ((i-1)*7):(i*7), \n) (operator ':' has high precedence

Re: [R] Question on if i am allowed to do something

2012-05-24 Thread Marc Schwartz
in Electrical and Mechanical Engineering --- -Original Message- From: Marc Schwartz Sent: Thursday, May 24, 2012 3:58 AM To: Duncan Murdoch Cc: Giannis Mamalikidis ; r-help@r-project.org Subject: Re: [R] Question

Re: [R] R Error: System is computationally singular

2012-05-24 Thread Marc Schwartz
events given the distribution of LOCS in your data. Regards, Marc Schwartz On May 24, 2012, at 2:41 PM, Nathan Svoboda wrote: Hi David, My apologies, I am not sure if this makes a big difference in your assessment of the problem, but the results I just sent were only from a portion (1/15

Re: [R] Get variable names from results of lm()

2012-05-23 Thread Marc Schwartz
(Petal.Length ~ ., data = iris) formula(LM) Petal.Length ~ Sepal.Length + Sepal.Width + Petal.Width + Species all.vars(formula(LM)) [1] Petal.Length Sepal.Length Sepal.Width Petal.Width [5] Species Regards, Marc Schwartz On Wed, May 23, 2012 at 10:58 AM, jdubj...@ramas.com wrote: What

Re: [R] Get variable names from results of lm()

2012-05-23 Thread Marc Schwartz
On May 23, 2012, at 2:52 PM, arun wrote: Hi Marc, Just to point out some difference, x - 1:20 y - x + (x/4 - 2)^3 + rnorm(20, sd=3) names(y) - paste(O,x,sep=.) ww - rep(1,20); ww[13] - 0 summary(lmxy - lm(y ~ x + I(x^2)+I(x^3) + I((x-10)^2),

Re: [R] Question on if i am allowed to do something

2012-05-23 Thread Marc Schwartz
of you before proceeding. 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] write.xls

2012-05-20 Thread Marc Schwartz
depends upon what assumptions you want to make pertaining to maximizing your potential user base, while minimizing the installation challenges useRs may face with your package. Regards, Marc Schwartz __ R-help@r-project.org mailing list https

Re: [R] write.xls

2012-05-20 Thread Marc Schwartz
with a worksheet in the XLS file for each factor level in iris$Species. 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] Recoding numeric value

2012-05-18 Thread Marc Schwartz
has specific behavior in dealing with NA values. 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

Re: [R] registry vulnerabilities in R

2012-05-09 Thread Marc Schwartz
counterpart, known as SIPRNet. As a consequence, the level of security oversight is higher and more restrictive than what one might find on typical commercial or academic networks. Regards, Marc Schwartz __ R-help@r-project.org mailing list https

Re: [R] registry vulnerabilities in R

2012-05-09 Thread Marc Schwartz
On May 9, 2012, at 11:00 AM, Barry Rowlingson wrote: Someone said: Once R is accepted, you could ask for an RStudio test if you want. I had another thought shortly after my initial email. Suppose yes, R is accepted. Great. You run R. Then you think, Oh, I need ggplot2 (yes you do). Do

<    1   2   3   4   5   6   7   8   9   10   >