Re: [R] R plot-par(mfrow=c(x,y)) on multiple pages

2016-01-20 Thread Mohsen Jafarikia
Dear Jim, Your wild guess was a good guess :=) Thanks to you and Sarah for your comments. Regards, Mohsen On Wed, Jan 20, 2016 at 6:08 PM, Jim Lemon wrote: > Hi Mohsen, > I'll have a wild guess at this. I suspect that you have either calculated a > value for the ylim=

[R] strange answer when using 'aggregate()' with a formula

2016-01-20 Thread Chel Hee Lee
Could you kindly test the following codes? It is because I found strange answer when 'aggregate()' is used with a formula. I am trying to count how many missing data entries are in each group. For this exercise, I created data as below: > tmp <- data.frame(grp=c(2,3,2,3), y=c(NA, 0.5, 3,

[R] tcltk: write '[' and ']' in a table cell

2016-01-20 Thread Dalthorp, Daniel
I know it should not be difficult to write the string: i<-4 j<-17 lbl<-paste0("[", i, ", ", j, "]") # to a table, but I'm having a devil of a time trying to figure out how to do it. # the following gives lbl surrounded by braces. tt<-tktoplevel() tfr <- tkframe(tt) tkgrid(tfr) junk<-tclArray()

Re: [R] Fwd:

2016-01-20 Thread Jim Lemon
Hi maryam, I think you have just restricted yourself to zero and negative numbers for the new cases. Well, I suppose there are imaginary numbers... Jim On Thu, Jan 21, 2016 at 8:26 AM, maryam firoozi via R-help < r-help@r-project.org> wrote: > Hello, > i made a population about 4500

Re: [R] Splitting strings in data files R

2016-01-20 Thread David Winsemius
> On Jan 20, 2016, at 3:33 PM, Zilefac Elvis wrote: > > I did not want to include attachments but as they are requested I am > attaching the original files. > File1=dx701S001 > > File2= dt402DAF0 These are fixed width files. The "upper-left corner of the file looks

Re: [R] R editor for Mac

2016-01-20 Thread Sandeep Rana
Christopher, Download TextWrangler from App store. I’m using it and its very convenient. Regards, Sunny > On 20-Jan-2016, at 11:52 PM, Christofer Bogaso > wrote: > > Hi, > > Could you please suggest a good R editor for Mac OS X (10.7.5) > Previously my operating

[R] Fwd:

2016-01-20 Thread maryam firoozi via R-help
Hello, i made a population about 4500 individual.this has two sex(female and male).they had pedigree. i wanted to enter new indiviual but their ID of indiviual mustnot be same perivous and their ID number mustnot be bigger than 4500. first population's ID number is 1:4500. how can i handel it?

Re: [R] strange answer when using 'aggregate()' with a formula

2016-01-20 Thread Fox, John
Dear Chel Hee Lee, With the formula method, the default na.action is na.omit; thus, > aggregate(y~grp, data=tmp, function(x) sum(is.na(x)), na.action=na.pass) grp y 1 2 1 2 3 0 I hope this helps, John - John Fox, Professor McMaster University Hamilton,

Re: [R] R editor for Mac

2016-01-20 Thread William Michels via R-help
Hello Christofer! For text-editing the R.app GUI has always been fabulous. An old mainstay on the Mac (after Apple's TextEdit) has been TextWrangler, and its big-brother, BBEdit. For development RStudio is quite nice, and--based partly on RStudio's offering of a Vim-compatibility mode--Vim has

Re: [R] Survival::coxph (clogit), survConcordance vs. summary(fit) concordance

2016-01-20 Thread Joe Ceradini
Thanks for pointing that out, Chris. That was a thoughtless typo on my part when I was simplifying my model for the sake of posting. I've run a whole set of models without any problems/warning. My main question is regarding the difference between the concordance estimate that summary(fit) reports

Re: [R] R editor for Mac

2016-01-20 Thread Roy Mendelssohn - NOAA Federal
Hi: Both the default Mac OS X installation of R (with the GUI) as well as RStudio, have very nice editors for coding in R. -Roy > On Jan 20, 2016, at 10:22 AM, Christofer Bogaso > wrote: > > Hi, > > Could you please suggest a good R editor for Mac OS X

Re: [R] R editor for Mac

2016-01-20 Thread Rich Shepard
On Wed, 20 Jan 2016, Christofer Bogaso wrote: Could you please suggest a good R editor for Mac OS X (10.7.5) Previously my operating system was Windows and there I used Notepad++, I really had very nice experience with it. However I dont see any Mac version is available for Mac. Emacs might

[R] Simple syntax question (I think)

2016-01-20 Thread Bert Gunter
Could someone please explain to me my mal-understanding of the following, which I expected to give the same results without errors. TIA. -- Bert > z <- list(x=1) > z[[2]] <- 3 > z $x [1] 1 [[2]] [1] 3 > list(x = 1)[[2]] <- 3 Error in list(x = 1)[[2]] <- 3 : target of assignment expands to

[R] problem of interpretation using mediation package

2016-01-20 Thread kende jan
Dear all, I am using the package mediation in order to perform a parametric mediation analysis on survival data. I have 8 variables: - Mediator - Treat - time (days) - death (event) - X1-X4 (confounding variables) I ran the following code to estimate the causal mediation effects. med.m =

[R] spline.correlog (ncf package) - Error message: tol must be strictly positive and finite

2016-01-20 Thread Diego Pavon
Dear all I am trying to run the spline.correlogram in package ncf to check for spatial autocorrelation in the residuals of my models, but I get an error message: Error in smooth.spline(u, v, df = df) : 'tol' must be strictly positive and finite I have googled the error and I got to the

Re: [R] R editor for Mac

2016-01-20 Thread Duncan Murdoch
On 20/01/2016 1:22 PM, Christofer Bogaso wrote: Hi, Could you please suggest a good R editor for Mac OS X (10.7.5) Previously my operating system was Windows and there I used Notepad++, I really had very nice experience with it. However I dont see any Mac version is available for Mac.

[R] R editor for Mac

2016-01-20 Thread Christofer Bogaso
Hi, Could you please suggest a good R editor for Mac OS X (10.7.5) Previously my operating system was Windows and there I used Notepad++, I really had very nice experience with it. However I dont see any Mac version is available for Mac. Appreciate your positive feedback. Thanks and regards,

Re: [R] (no subject)

2016-01-20 Thread ruipbarradas
Hello, Please respond to the list, not just to me. If you just want the first vector ofm the matrices, try the following. fun <- function(..., n, replace = FALSE){     m <- do.call(rbind, list(...))     idx <- sample(nrow(m), n, replace = replace)     m[idx, 1] } n <- 3 * nrow(Young.list1) *

[R] Error using Rhipe

2016-01-20 Thread Paulo Moniz
I am integrating with R Hadoop using Rhipe and my configuration is as follows: • Ubuntu 14. • Hadoop 1.0.3 • R 3.2.2 • Rhipe 0.73.1 • library rJava installed When starting at the R environment rhinit () the following message appears: > rhinit () Rhipe: Using Rhipe.jar file

Re: [R] Simple syntax question (I think)

2016-01-20 Thread Marc Schwartz
> On Jan 20, 2016, at 12:26 PM, Bert Gunter wrote: > > Could someone please explain to me my mal-understanding of the > following, which I expected to give the same results without errors. > > TIA. > > -- Bert > >> z <- list(x=1) >> z[[2]] <- 3 >> z > $x > [1] 1 > >

Re: [R] Simple syntax question (I think)

2016-01-20 Thread Duncan Murdoch
On 20/01/2016 2:21 PM, Bert Gunter wrote: Thanks Marc. Actually, I think the cognate construction for a vector (which is what a list is also) is: > vector("numeric",2)[2] <- 3 Error in vector("numeric", 2)[2] <- 3 : target of assignment expands to non-language object but this works: >

Re: [R] R editor for Mac

2016-01-20 Thread Franklin Bretschneider
Dear Christofer Bogaso, Re: > Could you please suggest a good R editor for Mac OS X (10.7.5) Indeed, as Roy Mendelssohn wrote, the editor built into "R.app", the GUI program which is part of the standard R for OS X, has a beautiful editor, complete with syntax colouring and bracket

Re: [R] R editor for Mac

2016-01-20 Thread boB Rudis
If you don't want to run RStudio, Sublime Text has both great R code syntax highlighting/formatting and a REPL mode for an interactive console in-editor. Atom also has decent R support. They both play well with "Dash" which is an alternative way (separate app) to lookup R docs on OS X. On Wed,

Re: [R] R editor for Mac

2016-01-20 Thread Duncan Murdoch
On 20/01/2016 2:22 PM, Franklin Bretschneider wrote: Dear Christofer Bogaso, Re: > Could you please suggest a good R editor for Mac OS X (10.7.5) Indeed, as Roy Mendelssohn wrote, the editor built into "R.app", the GUI program which is part of the standard R for OS X, has a beautiful

Re: [R] Simple syntax question (I think)

2016-01-20 Thread Bert Gunter
Thanks Marc. Actually, I think the cognate construction for a vector (which is what a list is also) is: > vector("numeric",2)[2] <- 3 Error in vector("numeric", 2)[2] <- 3 : target of assignment expands to non-language object but this works: > "[<-"(vector("numeric",2),2,3) [1] 0 3 I would

Re: [R] Simple syntax question (I think)

2016-01-20 Thread William Dunlap via R-help
Note that the expression x[1] <- 10 is equivalent not to `[<-`(x, 1, value=10) but to x <- `[<-`(x, 1, value=10) so there is no conflict between your two expressions. Saying c(1,2,3) <- `[<-`(c(1,2,3), 1, value=10) is not allowed because there is no name to assign something to. There

Re: [R] R editor for Mac

2016-01-20 Thread Berend Hasselman
> On 20 Jan 2016, at 20:22, Franklin Bretschneider wrote: > > Dear Christofer Bogaso, > > > Re: > > >> Could you please suggest a good R editor for Mac OS X (10.7.5) > > > > Indeed, as Roy Mendelssohn wrote, the editor built into "R.app", the GUI > program which is

Re: [R] Simple syntax question (I think)

2016-01-20 Thread Bert Gunter
Thanks to both Bill and Duncan for their help. As I said, my mal-understanding of the syntax. Best, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Wed,

Re: [R] Splitting strings in data files R

2016-01-20 Thread Mark Sharp
Looks like homework. R. Mark Sharp, Ph.D. Director of Primate Records Database Southwest National Primate Research Center Texas Biomedical Research Institute P.O. Box 760549 San Antonio, TX 78245-0549 Telephone: (210)258-9476 e-mail: msh...@txbiomed.org > On Jan 20, 2016, at 2:53 PM, R.

[R] Splitting strings in data files R

2016-01-20 Thread Zilefac Elvis via R-help
Please I need help processing files with strings in R. All the files have two patterns (thus,examine separately): Pattern 1 (see file1 below): Delete Lines 1,2 & 4 in file1. Line 3 contains the column names. Then find anything as.character and delete. Please do not delete any values (e.g.

Re: [R] R plot-par(mfrow=c(x,y)) on multiple pages

2016-01-20 Thread Sarah Goslee
Use a device like pdf() or postscript() that supports multiple pages. Or start a new default device with dev.new() so you can see two figures simultaneously. Sarah On Wed, Jan 20, 2016 at 3:37 PM, Mohsen Jafarikia wrote: > Hello everyone: > > I have 12 plots that I am using

[R] R plot-par(mfrow=c(x,y)) on multiple pages

2016-01-20 Thread Mohsen Jafarikia
Hello everyone: I have 12 plots that I am using par(mfrow=c(3,2)) to have 6 of them in a single page. R only prints the 6 first graph in a single page. Any comments how I can ask R to print all 12 graphs in two pages. Thanks very much, Mohsen __

Re: [R] tcltk tkwidget(..."table")

2016-01-20 Thread Dalthorp, Daniel
Thanks, Peter. I'm sure that's right, but it requires knowing: (1) that there's something called the "width subcommand", and (2) how to format the call to that command/subcommand. I was able to do it eventually but only after a few hours of effort searching the web for help. E.g. with a table

Re: [R] (no subject)

2016-01-20 Thread Jim Lemon
Hi Maryam, c(Young.list1[sample(1:20,5),], Young.list2[sample(1:20,5),], Young.list3[sample(1:20,5),]) # or for a more general solution nrows<-dim(Young.list1)[1] c(Young.list1[sample(1:nrows,nrows/4),], Young.list2[sample(1:nrows,nrows/4),], Young.list3[sample(1:nrows,nrows/4),]) Jim On

Re: [R] tcltk tkwidget(..."table")

2016-01-20 Thread peter dalgaard
> On 19 Jan 2016, at 20:48 , Dalthorp, Daniel wrote: > > Does anyone know a simple way to create a tcltk table with columns of > varying widths? Create a table, then set the width of the columns with the width subcommand? -pd pathName width ?col? ?value col value ...? If

Re: [R] R plot-par(mfrow=c(x,y)) on multiple pages

2016-01-20 Thread Jim Lemon
Hi Mohsen, I'll have a wild guess at this. I suspect that you have either calculated a value for the ylim= argument or used explicit values for ylim= in the first plot, then propagated the error by copying and pasting. Jim On Thu, Jan 21, 2016 at 8:56 AM, Mohsen Jafarikia

[R] Gsarima and Method

2016-01-20 Thread Lorenzo Isella
Dear All, While tuning some time series model with gsarima (which is primarily a wrapper for arima) from the astsa package, I encounter the following error message Error in stats::arima(xdata, order = c(p, d, q), seasonal = list(order = c(P, : non-stationary seasonal AR part from CSS

[R] adehabitat and tcltk

2016-01-20 Thread Emiliano Manzo
Hi there, is anybody knows how to install adehabitat on latest release? because r said that need tcltk but this package is not available for the latest version. Can anybody help me? Emiliano Manzo emiliano.ma...@gmail.com __ R-help@r-project.org

Re: [R] Splitting strings in data files R

2016-01-20 Thread David Winsemius
> On Jan 20, 2016, at 12:53 PM, Zilefac Elvis via R-help > wrote: > > > > > Please I need help processing files with strings in R. All the files have > two patterns (thus,examine separately): You do need help, that much is clear. But the first thing to do is retrace

Re: [R] R plot-par(mfrow=c(x,y)) on multiple pages

2016-01-20 Thread Sarah Goslee
On Wed, Jan 20, 2016 at 4:56 PM, Mohsen Jafarikia wrote: > Thanks very much for the comment. > > I was also wondering why all the y-axis on all 12 plots are similar to > the first plot. I have 12 plots and scale of the values for these > plots are different. It seems R is

Re: [R] R plot-par(mfrow=c(x,y)) on multiple pages

2016-01-20 Thread Mohsen Jafarikia
Thanks very much for the comment. I was also wondering why all the y-axis on all 12 plots are similar to the first plot. I have 12 plots and scale of the values for these plots are different. It seems R is using the x-axis for each individual plot correctly but y-axis is the same for all 12

Re: [R] R editor for Mac

2016-01-20 Thread Richard M. Heiberger
Emacs with ESS is very simple to operate when you use the menu. See Paul Johnson's document [Emacs has no learning curve: Emacs and ESS] http://pj.freefaculty.org/guides/Rcourse/emacs-ess/emacs-ess.pdf Rich On Wed, Jan 20, 2016 at 2:59 PM, Duncan Murdoch wrote: > On

[R] Where to get quantiles (1st parameter q) for pnorm? (Normal approximation to binomial distribution)

2016-01-20 Thread mviljamaa
I'm doing Normal approximation to binomial distribution. My variables are generated by rbinom. Here: http://msemac.redwoods.edu/~darnold/math15/spring2013/R/Activities/ApproxBinomWithNorm.html it's claimed that normal approximation is done using the command pnorm. Question: Where to get

Re: [R] config args for Rmpfr to link to mpfr and gmp?

2016-01-20 Thread Martin Maechler
Dear Seija, > Seija Sirkiä > on Wed, 20 Jan 2016 10:01:05 +0200 writes: > Hello, > Sorry to bother with you with this, I'll be very brief: How do I communicate to the Rmpfr package that the (correct versions of) mpfr and gmp libraries are somewhere

Re: [R] Where to get quantiles (1st parameter q) for pnorm?(Normalapproximation to binomial distribution)

2016-01-20 Thread Gerrit Eichner
Hi, Matti, use ?pnorm and read about qnorm. Hth -- Gerrit On Wed, 20 Jan 2016, mviljamaa wrote: I'm doing Normal approximation to binomial distribution. My variables are generated by rbinom. Here:

Re: [R] LSD value

2016-01-20 Thread Franklin Mairura via R-help
How can this be achieved in 2-way or 3 way experiments? On Monday, January 18, 2016 7:31 AM, Jianling Fan wrote: Thanks David, That's exactly what I need! Thanks very much for your example. Best regards, Julian On 18 January 2016 at 13:00, David L

Re: [R] Survival::coxph (clogit), survConcordance vs. summary(fit) concordance

2016-01-20 Thread Andrews, Chris
I only get the digest, sorry if this has already been answered. When I run your code (after creating some data) I get a warning that "weights are ignored in clogit". This is a result of miscalling the clogit function. The first 2 commas should be +s. library(survival) nn <- 1000 dat <-