Re: [R] Vector with zeros and ones

2013-04-22 Thread Marc Schwartz
On Apr 22, 2013, at 6:28 PM, Marc Schwartz wrote: > On Apr 22, 2013, at 6:21 PM, Ayyappa wrote: > >> Dear group, >> >> I want to generate a vector of 10 elements that always has 20% zeroes, but >> with a random ordering of zeroes and ones. Can you please sugges

Re: [R] Why can't R understand if(num!=NA)?

2013-05-03 Thread Marc Schwartz
or FALSE result which can then be tested. See: http://cran.r-project.org/doc/manuals/r-release/R-intro.html#Missing-values Regards, Marc Schwartz __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] R and libre office base

2013-05-17 Thread Marc Schwartz
ith JDBC and there is the ODB package on CRAN (http://cran.r-project.org/web/packages/ODB/). 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

Re: [R] xtable() with booktabs option problem

2013-05-24 Thread Marc Schwartz
. Thus: > print(xtable(aa), booktabs = TRUE) % latex table generated in R 3.0.1 by xtable 1.7-1 package % Fri May 24 14:40:07 2013 \begin{table}[ht] \centering \begin{tabular}{rr} \toprule & V1 \\ \midrule a & 9 \\ b & 8 \\ c & 17 \\ d & 9 \\ e & 7

Re: [R] empty html pages for R-exts and R-intro

2013-05-31 Thread Marc Schwartz
application) and re-starting it and/or flushing the cache. 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] Strange behaviour of R graphics copied to PowerPoint

2013-06-03 Thread Marc Schwartz
In addition to the manner in which the PDF files are generated, you might want to consider the possibility that the lines are artifacts created by your PDF viewer. See: http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-are-there-unwanted-borders Regards, Marc Schwartz On Jun 3, 2013, at

Re: [R] Not sure this is something R could do but it feels like it should be.

2013-06-06 Thread Marc Schwartz
n.r-project.org/web/views/Pharmacokinetics.html There is also another package not listed above that might be relevant: http://cran.r-project.org/web/packages/scaRabee/ 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] glm.nb error

2013-06-07 Thread Marc Schwartz
a = 1.711564307, link = log) Coefficients: (Intercept)group 0.5596 -1.9459 Degrees of Freedom: 7 Total (i.e. Null); 6 Residual Null Deviance: 10.23 Residual Deviance: 6.848AIC: 25.25 Check str(y) and str(group) You should also be sure to note in your posts wh

Re: [R] glm.nb error

2013-06-07 Thread Marc Schwartz
ta.ml(Y, mu, sum(w), w, limit = control$maxit, trace = control$trace > > : > iteration limit reached > 2: In theta.ml(Y, mu, sum(w), w, limit = control$maxit, trace = control$trace > > : > iteration limit reached > Execution halted > > So might be the err

Re: [R] Default colors for barplot() XXXX

2013-06-12 Thread Marc Schwartz
e control of the colors when you call barplot() and define the 'col' argument to colors of your choosing, which you can then use in the call to legend(). Regards, Marc Schwartz __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman

Re: [R] alternative to ifelse

2013-06-19 Thread Marc Schwartz
0,] 30 20 5 22 [11,] 2 12 24 15 [12,] 5 21 13 22 [13,] 23 17 28 3 [14,] 1 7 24 14 [15,] 12 15 8 8 Then you can use: > rowSums(cbind(x1, x2, x3, x4) == 1) [1] 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 which gets you the same result as: > ifelse(x1 == 1 | x2 == 1 | x3 == 1 | x4 == 1, 1, 0)

Re: [R] alternative to ifelse

2013-06-19 Thread Marc Schwartz
22 [11,] 2 12 24 15 [12,] 5 21 13 22 [13,] 23 17 28 3 [14,] 1 7 24 14 [15,] 12 15 8 8 Then you can use: > rowSums(cbind(x1, x2, x3, x4) == 1) [1] 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 which gets you the same result as: > ifelse(x1 == 1 | x2 == 1 | x3 == 1 | x4 == 1, 1, 0) [1] 0 1 0 0 0 0 0

Re: [R] alternative to ifelse

2013-06-19 Thread Marc Schwartz
On Jun 19, 2013, at 1:23 PM, Marc Schwartz wrote: > > On Jun 19, 2013, at 8:24 AM, Brian Perron wrote: > >> Greetings: >> >> I am looking for a way to avoid using the ifelse function for >> constructing a new variable. More specifically, assume I have

Re: [R] alternative to ifelse

2013-06-19 Thread Marc Schwartz
On Jun 19, 2013, at 1:23 PM, Marc Schwartz wrote: > > On Jun 19, 2013, at 8:24 AM, Brian Perron wrote: > >> Greetings: >> >> I am looking for a way to avoid using the ifelse function for >> constructing a new variable. More specifically, assume I have

Re: [R] Lexical scoping is not what I expect

2013-06-24 Thread Marc Schwartz
2 and not x = 5 # is being use within f() > f(2) [1] 12 # Here is where your code starts # missing the preceding code where 'a' was # defined globally f <- function(x) { a<-5; g(x) } g <- function(y) y + a # Now it works, showing that 'a <- 5' within f() is

Re: [R] Write an Excel workbook?

2013-06-27 Thread Marc Schwartz
dule is Text::CSV_XS (because it contains C code requiring compilation), with the exception of (as of the last time I checked) the ActiveState Perl distribution. The ActiveState distribution includes pre-compiled binaries of the Perl modules for the target OS's, which obviates the need for

Re: [R] Importing a CSV file

2012-09-19 Thread Marc Schwartz
;> someone who uses Windows! > > I use Windows and the answer is no, the four backslashes don't make sense, > because like Frans said, c:\\ becomes c:\ > (There is no such thing as c: ---> c:\\). > > Rui Barradas Ahoy Mateys, Not to mention, creating file paths on W

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 r

Re: [R] Regarding licensing Terms

2012-10-03 Thread Marc Schwartz
On Oct 3, 2012, at 9:56 AM, Spencer Graves wrote: > On 10/3/2012 7:26 AM, Marc Schwartz wrote: >> On Oct 3, 2012, at 4:49 AM, Narendra wrote: >> >>> Hi, >>> >>> I have developed one application using ggmap package.It is based on google >>> m

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 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 on

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

2012-10-04 Thread Marc Schwartz
do >> 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 nominat

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

2012-10-05 Thread Marc Schwartz
rious other online resources 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://s

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

2012-10-06 Thread Marc Schwartz
at 8:14 AM, Frank Harrell wrote: > Hi Marc, > > It would be interesting to compare with tikz for ease of use. > > As an aside I've been wishing that someone would write an R function for > creating clinical trial disposition charts using tikz or pstricks ... > >

Re: [R] PKPD modelling in R

2012-10-08 Thread Marc Schwartz
result. It already has NOTE entries 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] Options to extend memory limit

2012-10-11 Thread Marc Schwartz
nt to evaluate some of the Large Memory options on the HPC task view: http://cran.r-project.org/web/views/HighPerformanceComputing.html or of course install more RAM. Regards, Marc Schwartz __ R-help@r-project.org mailing list https://stat.ethz.ch/m

Re: [R] Loss of dimensions in subsetting arrays

2012-10-12 Thread Marc Schwartz
turn this behaviour off? > > best, > Markku Karhunen > Uni. 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

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

2012-10-16 Thread Marc Schwartz
ribute, you can unclass() it and then coerce to a data.frame: > as.data.frame(unclass(RES)) lengths values 1 5 10 2 4 9 3 3 8 4 2 7 5 1 6 > str(as.data.frame(unclass(RES))) 'data.frame': 5 obs. of 2 variables: $ len

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

2012-10-23 Thread Marc Schwartz
a set (to make sure that you have factors and not character vectors) and to get a sense 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 postin

Re: [R] Kaplan Meier Post Hoc?

2012-10-24 Thread Marc Schwartz
.adjust, which provides a generic framework 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

Re: [R] Package RODBC sqlQueries

2012-10-26 Thread Marc Schwartz
e query using ?paste Query <- paste("SELECT tblDataFieldRawSiteVisit.*", "FROM tblDataFieldRawSiteVisit", "WHERE (((tblDataFieldRawSiteVisit.dataForm)=\"Oyster Transition Plan", "Site Mapping Detail\"));&q

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

2012-10-29 Thread Marc Schwartz
; unknown host X64_7PRO". > > Could 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.c

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 wrote: > On 29/10/2012 2:54 PM, Marc Schwartz wrote: >> On Oct 29, 2012, at 1:28 PM, Praveen Surendran >> wrote: >> >> > Hi, >> > >> > >> > >> > I have a file in .sas7bdat for

Re: [R] Error logistic analysis

2014-04-08 Thread Marc Schwartz
glm() with 'family = binomial': Single_model1 <- glm(openhrs1 ~ genhealt1 + age + sexpat1 + hhincome1 + edupat1 + etniciteit1, family = binomial, data = Slovakije) Regards, Marc Schwartz __ R-help@r-project.org mailing list https://s

Re: [R] moses extreme reaction test

2014-04-08 Thread Marc Schwartz
to implement it. http://cran.r-project.org/web/packages/DescTools/ 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 pr

Re: [R] get element of list with default?

2014-04-15 Thread Marc Schwartz
t in the list. If it is in a sub-list of the main list, you would need to think about a recursive approach of some type, along the lines of what ?rapply does. 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] get element of list with default?

2014-04-15 Thread Marc Schwartz
On Apr 15, 2014, at 11:22 AM, Marc Schwartz wrote: > On Apr 15, 2014, at 10:53 AM, Spencer Graves > wrote: > >> Hello: >> >> >> Do you know of a simple function to return the value of a named element >> of a list if that exist

Re: [R] Summary to data frame in R!!

2014-05-07 Thread Marc Schwartz
t;mpg" "disp" If you actually want a data frame, you can coerce the result: > as.data.frame(sapply(mtcars[, c("mpg", "disp")], summary)) mpg disp Min.10.40 71.1 1st Qu. 15.42 120.8 Median 19.20 196.3 Mean20.09 230.7 3rd Qu. 22.80 326.0 Max.

Re: [R] reference category in binomal glm

2014-05-27 Thread Marc Schwartz
response, you are predicting 1's and if you use a two level factor, you are predicting the second level of the factor. Regards, Marc Schwartz __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the p

Re: [R] Login

2014-05-27 Thread Marc Schwartz
a plethora of list archives on the web and there is no provision for removing specific posts from all sites that might possibly have a copy of your post. Google, by the way, is not the only search engine that will include and archive your post in sear

Re: [R] Help with arrays

2014-05-29 Thread Marc Schwartz
10L)) See ?which.max, which returns the index of the *first* maximum in the vector passed to it: > W[1, which.max(W[2, ])] [1] 119 You should consider what happens if there is more than one of the maximum value in the first row and if it might correspond to non-unique values in the second

Re: [R] Help with arrays

2014-05-29 Thread Marc Schwartz
On May 29, 2014, at 11:22 AM, Marc Schwartz wrote: > > On May 29, 2014, at 11:02 AM, Olivier Charansonney > wrote: > >> Hello, >> >> I would like to extract the value in row 1 corresponding to the maximum in >> row 2 >> >> >> >&

Re: [R] looking at C code from the stats package

2014-05-29 Thread Marc Schwartz
R-3-0-branch/src/main/ and there is a file 'names.c' that can be helpful in locating specific C functions and their associated declared C names. For Recommended packages, there is also a separate SVN repo at: https://svn.r-project.org/R-packages/ but it may be easier to dow

Re: [R] glm.fit: fitted probabilities numerically 0 or 1 occurred for a continuous variable?

2014-06-16 Thread Marc Schwartz
the problem will depend upon first confirming the etiology of it and then, within the context of subject matter expertise, making some decisions on how to proceed. If you Google "logistic regression separation", you will get some resources that can be helpful. Regards, Marc Schwar

Re: [R] Output levels of categorical data to Excel using with()

2014-06-19 Thread Marc Schwartz
system, how comfortable you may or may not be relative to installing additional software, do you want to create a new Excel file with each export or be able to append to existing worksheets and how you may want to structure or format the worksheet(s) in Excel. Regards, Marc Schwartz P.S. I

Re: [R] odd behavior of seq()

2014-07-03 Thread Marc Schwartz
s what is going on here? See the MFAQ[1]: http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f Regards, Marc Schwartz [1] Most Frequently Asked Question __ R-help@r-project.org mailing list ht

Re: [R] access an element of a list without looping

2014-07-03 Thread Marc Schwartz
ist elements to scan. If you have "sub-levels" within the list, you might want to look at ?rapply, which is a recursive version. Regards, Marc Schwartz __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help P

Re: [R] < symbols in a data frame

2014-07-09 Thread Marc Schwartz
an also just create a new column that is numeric and go from there: metals$CC.Num <- as.numeric(gsub("<", "", metals$Cedar.Creek)) > str(metals) 'data.frame': 19 obs. of 3 variables: $ Parameter : Factor w/ 20 levels "Antimony","Arsenic&q

Re: [R] table over a matrix dimension...

2014-07-10 Thread Marc Schwartz
ot; "b" "b" "b" "b" "b" "a" [8,] "c" "b" "a" "d" "d" "d" "b" "c" "d" "a" [9,] "c" "d" "

Re: [R] Problems with read.table and data structure

2014-07-11 Thread Marc Schwartz
excel to mess up the "save as tab-delimited text", but the text > file seems fine with me on surface (i dont know how the numbers are stored > internally). I just see correct numbers, also the View command > yields the correct content. > > > > Anyone knows help? Its pre

Re: [R] Problems with read.table and data structure

2014-07-11 Thread Marc Schwartz
On Jul 11, 2014, at 2:36 PM, Marc Schwartz wrote: > > On Jul 11, 2014, at 9:15 AM, Tim Richter-Heitmann > wrote: > >> Hi there! >> >> I have huge datafile of 600 columns 360 samples: >> >> data <- read.table("small.txt", header = T

Re: [R] Norton Virus program indicates that R3.1.1 is not reliable

2014-07-13 Thread Marc Schwartz
system for this detection, it will take the Symantec user community to file reports and get it removed from detection. Regards, Marc Schwartz On Jul 13, 2014, at 10:30 AM, jim holtman wrote: > Glad to see that I am not the only one seeing the error. I was > getting it on my other (c

Re: [R] Aggregate Table Data into Cell Frequencies

2012-10-31 Thread Marc Schwartz
"temp16", "temp17", "temp17", "temp17", "temp18", "temp18", >"temp18", "temp18", "temp18", "temp19", "temp2", "temp2", >"temp2", "temp20", &q

Re: [R] R 2.15.2 is released

2012-11-04 Thread Marc Schwartz
; R version 2.15.1. > If 1.2.3 is the current latest version of X, then update.packages() will > _not_ try to update it, but, apparently, at least for some packages, I > do need to rebuild them against the new R version 2.15.2. > > Thanks. Take note of the 'checkBuilt

Re: [R] Problem compiling Rnw file

2012-11-05 Thread Marc Schwartz
nment in which Sweave is operating are changed. Perhaps not all, since some things still seem to work. I have never used setwd() within a .Rnw file, not because of prior experience, but because I have never needed to. Just use the full path to whatever external files you need, rather than c

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

2012-11-05 Thread Marc Schwartz
ne those things, then post to R-Devel, but please do 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 ___

Re: [R] extract indep vars from formula

2012-11-07 Thread Marc Schwartz
'poly(x, 3)'). A general approach would be: all.vars(formula(MODEL)) where the response variable would typically 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

Re: [R] Absolute path in gdata library

2012-11-07 Thread Marc Schwartz
en do tilde expansion, etc. when relative file paths are passed rather than absolute paths are used. A workaround for now, would be to wrap your filename in that function in your code, so that when you use relative paths, the appropriate expansion is used and passed to the gdata functio

Re: [R] Absolute path in gdata library

2012-11-08 Thread Marc Schwartz
On Nov 8, 2012, at 12:57 AM, Prof Brian Ripley wrote: > On 07/11/2012 23:12, Marc Schwartz wrote: >> On Nov 7, 2012, at 4:58 PM, r 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 gdat

Re: [R] Executing SAS Codes in R

2012-11-08 Thread Marc Schwartz
ge: 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 a

Re: [R] Absolute path in gdata library

2012-11-08 Thread Marc Schwartz
On Nov 8, 2012, at 9:33 AM, Prof Brian Ripley wrote: > On 08/11/2012 15:28, Marc Schwartz wrote: >> >> On Nov 8, 2012, at 12:57 AM, Prof Brian Ripley wrote: >> >>> On 07/11/2012 23:12, Marc Schwartz wrote: >>>> On Nov 7, 2012, at 4:58 PM, r wrot

Re: [R] Controlling R fonts through LaTeX

2012-11-08 Thread Marc Schwartz
and the same font 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

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

2012-11-08 Thread Marc Schwartz
t barplot() returns the bar midpoints, which then allow you to position vertical lines for each bar 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 d

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

2012-11-08 Thread Marc Schwartz
smart enough to differentiate between an object named 'table' and the built-in function table(), I would avoid it, because there may be times when you will run into a problem and be scratching your head as to the source of the error. Vec <- c(12.34567, "--", 10, 12.

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

2012-11-08 Thread Marc Schwartz
rovide Nagelkerke's 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 mailin

Re: [R] Remove missings (quick question)

2012-11-09 Thread Marc Schwartz
t so that you don't have to post-process it. See ?read.csv for more info. Once that is done, R's default behavior is to remove observations with any missing data (eg. NA values) when using modeling functions. Or you can pre-process using:

Re: [R] Remove missings (quick question)

2012-11-09 Thread Marc Schwartz
On Nov 9, 2012, at 11:23 AM, Bert Gunter wrote: > Marc et. al: > > On Fri, Nov 9, 2012 at 9:05 AM, Marc Schwartz wrote: >> On Nov 9, 2012, at 10:50 AM, Eiko Fried wrote: >> >>> A colleague wrote the following syntax for me: >>> >>> D =

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
-fit logistic curve for this data 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 _

Re: [R] no y-axis

2012-11-12 Thread Marc Schwartz
ecifically, '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 wrote: > Hello, > > If you want to completely r

Re: [R] install own package ?

2012-11-14 Thread Marc Schwartz
"pkgType") [1] "mac.binary.leopard" which is referenced in ?install.packages. It is looking for a binary version of your package, rather than a source package. You need to use: install.packages("/Users/hoffmann/R/cwhmisc_4.0.tar.gz", repos = NULL,

Re: [R] Deleting rows with special character

2012-11-16 Thread Marc Schwartz
ply(testdata, 1, function(x)all(x == "A")), > ,drop = FALSE]) user system elapsed 0.454 0.047 0.503 > system.time(Sub2 <- testdata[rowSums(testdata == "A") == ncol(testdata), , > drop = FALSE]) user system elapsed 0.089 0.001 0.090 >

Re: [R] Boxplot in R

2012-11-16 Thread Marc Schwartz
lts to 1.5. 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

Re: [R] Stepwise analysis with fixed variables

2012-11-21 Thread Marc Schwartz
in ?stepAIC in V&R's MASS package, which is a default part of R 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 'rm

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

2012-11-21 Thread Marc Schwartz
function of the biclust package, > 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 h

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

2012-11-21 Thread Marc Schwartz
t configure.args but the result is the same, i > cant seem to install it... > > Is there someone who has been through the same problem? or that knows a > guide i can follow or something? > > Thanks in advance > > Ricardo There is a page here: http://www.stats.uwo.ca/facu

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

2012-11-21 Thread Marc Schwartz
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 wrote:

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

2012-11-21 Thread Marc Schwartz
ion 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 __ 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] puzzling RODBC error

2012-11-26 Thread Marc Schwartz
so perhaps you have already looked into this. There is some additional info on this in the RODBC vignette and some posts in the archives suggesting that you might get other errors, but worth considering if you have not. The crash suggests that something is amiss in the configuration. Rega

Re: [R] Connect R with SQLSERVER

2012-11-26 Thread Marc Schwartz
s://stat.ethz.ch/mailman/listinfo/r-sig-db Please use that in the future, not R-Help. Second, why are you trying to install the *source* version of RODBC when there are pre-compiled binary versions of the package available for Windows? Just use: install.packages("RODBC") wi

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

2012-11-26 Thread Marc Schwartz
ur system and > > properly configured. You may need to get that from Oracle or other parties > > depending upon your OS which is unstated here. You may also need to get > > assistance with that process from your SysAdmin or DBAdmin. > > > > 5. If you use RODBC

Re: [R] Installing R under Redhat el6

2012-11-28 Thread Marc Schwartz
sudo yum install R 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

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

2012-11-30 Thread Marc Schwartz
'; > run; > > How 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 l

Re: [R] Reading .gsheet within R

2012-11-30 Thread Marc Schwartz
sheet-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 wrote: > Hello, > > Package sos does a good job at finding things available for R. > > library(sos) > findFn('gsheet') &g

Re: [R] sum portions of a vector

2012-12-10 Thread Marc Schwartz
[1] 6 30 19 Did you just want the above, or did you really want: > as.vector(sapply(split(vec, 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

Re: [R] sum portions of a vector

2012-12-10 Thread Marc Schwartz
On Dec 10, 2012, at 2:52 PM, David Winsemius 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 wrote: > > On Dec 10, 2012, at 2:52 PM, David Winsemius wrote: > >> >> On Dec 10, 2012, at 11:29 AM, Sam Steingold wrote: >> >>> How do I sum portions of a vector into another vector? >>&

Re: [R] Tools for Building Packages (Fedora)

2012-12-11 Thread Marc Schwartz
nd that may not be a part of a typical Fedora install these days. If you get to the point where you have R package development questions that are not really Fedora specific, those should be posted to the R-Devel list: https://stat.ethz.ch/mailman/listinfo/r-devel Regards, Marc Schwartz _

Re: [R] Exporting R graphics into Word without losing graph quality

2013-12-16 Thread Marc Schwartz
e shared with others. In most cases, the image quality was fine. Regards, Marc Schwartz > You > can edit a metafile in Word, but different versions seem to have > different issues. Earlier versions would lose clipping if you > tried to edit the file, but World 2013 works reasonably well.

Re: [R] replace "" to NA.

2014-01-06 Thread Marc Schwartz
> the above loop script does not work on this data frame as NA is has > logical class and does not return TRUE/FALSE. > > Can anyone provide some help? See ?is.na, which is used to test for NA values and is the canonical way to replace values with NA: > test test1 test2 test3 1

Re: [R] Subsetting on multiple criteria (AND condition) in R

2014-01-14 Thread Marc Schwartz
er subsetting; unused levels are not automatically removed. See droplevels for a way to drop all unused levels from a data frame." Your syntax is fine and the behavior is as expected. 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] Different output for lm Mac vs PC

2014-01-14 Thread Marc Schwartz
g some type of GUI on your Mac (eg. the default R.app or perhaps RStudio), try running R from a terminal session, using 'R --vanilla' from the command line, to be sure that you are not loading a default workspace containing objects that are resulting in the altered behavior. Then r

Re: [R] Different output for lm Mac vs PC

2014-01-14 Thread Marc Schwartz
ed. Regards, Marc On Jan 14, 2014, at 3:55 PM, Greg Snow <538...@gmail.com> wrote: > I would suggest running the code: > > options('contrasts') > > on both machines to see if there is a difference. Having the default > contrasts set differently would be one e

Re: [R] Different output for lm Mac vs PC

2014-01-15 Thread Marc Schwartz
ordered > "contr.treatment" "contr.poly" > > > I've changed the mac with > > options(contrasts=c('contr.treatment','contr.poly')) > > > and that has solved the issue. > > Thanks Greg and

Re: [R] Doubt in simple merge

2014-01-16 Thread Marc Schwartz
ar.y in the result. In the case of two occurrences of the same ID but two different ages, if that is possible, both rows would be added to the result using the above code. Regards, Marc Schwartz On Jan 16, 2014, at 9:04 AM, Frede Aakmann Tøgersen wrote: > Ups, sorr

Re: [R] barplot: segment-wise shading

2014-01-16 Thread Marc Schwartz
tion. See ?dim and ?prod Be aware that a vector (eg. 1:5) will be 'dim-less', thus if you are going to use this approach for a vector based data object, you would want to use ?length Regards, Marc Schwartz __ R-help@r-project.org mailing

Re: [R] barplot: segment-wise shading

2014-01-16 Thread Marc Schwartz
On Jan 16, 2014, at 5:03 PM, Martin Weiser wrote: > Marc Schwartz píše v Čt 16. 01. 2014 v 16:46 -0600: >> On Jan 16, 2014, at 12:45 PM, Martin Weiser wrote: >> >>> Dear listers, >>> >>> I would like to make stacked barplot, and to be able to def

Re: [R] Doubt in simple merge

2014-01-17 Thread Marc Schwartz
ge(Elder, Younger, by = c("ID", "age"), all = TRUE)) 'data.frame': 6 obs. of 2 variables: $ ID : Factor w/ 5 levels "ID1","ID2","ID3",..: 1 2 3 3 4 5 $ age: num 38 35 31 NA 29 21 > merge(Elder, Younger, by = c("ID", "a

Re: [R] barplot: segment-wise shading

2014-01-17 Thread Marc Schwartz
On Jan 16, 2014, at 9:09 PM, Martin Weiser wrote: > Jim Lemon píše v Pá 17. 01. 2014 v 13:21 +1100: >> On 01/17/2014 10:59 AM, Marc Schwartz wrote: >>> >>> ... >>> Arggh. >>> >>> No, this is my error for not actually looking at the plot

Re: [R] summary() and the mode

2014-01-23 Thread Marc Schwartz
is case: plot(dx) abline(v = dx$x[which.max(dx$y)]) See ?table, ?density and ?which.max 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-proj

Re: [R] How to read this data correctly

2014-01-24 Thread Marc Schwartz
e some form of post import data clean up, even with the other options depending upon how they function. Regards, Marc Schwartz On Jan 24, 2014, at 2:49 PM, Christofer Bogaso wrote: > Hi Rui, > > Thanks for your reply. > > However why you said, 'shouldn't read prop

Re: [R] Handling large SAS file in R

2014-01-28 Thread Marc Schwartz
ort R versions, to take on the task of providing some of these facilities and providing them back to the community as a service. But, that is up to them to consider in their overall business plan and the value that they perceive it brings to their products. Regards, Marc Schwartz On Jan 28, 2014, at

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