Re: [R] lattice legen and auto.key conflict

2012-07-30 Thread Deepayan Sarkar
On Mon, Jul 30, 2012 at 10:16 PM, Bert Gunter wrote: > David: > > I think one needs to carefully parse the xyplot help, where it says: > > "To use more than one legend, or to have arbitrary legends not > constrained by the structure imposed by key, use the legend argument. > " > > So I presume tha

Re: [R] Thinning Lattice Plot

2012-07-30 Thread Deepayan Sarkar
On Tue, Jul 31, 2012 at 2:43 AM, Elliot Joel Bernstein wrote: > Is there an easy way to "thin" a lattice plot? I often create plots from > large data sets, and use the "pdf" command to save them to a file, but the > resulting files can be huge, because every point in the underlying dataset > is re

Re: [R] How can I declare an empty zoo object?

2012-07-30 Thread R. Michael Weylandt
On Mon, Jul 30, 2012 at 11:18 PM, jpm miao wrote: > Hi, > >I let xzoo be an empty object: > >> xzoo<-{} This sounds like the start of a bad idea > > >and I have an existing zoo object x1zoo_f. I would like to combine > the two to make a new zoo object, and continue doing so in a loo

[R] How can I declare an empty zoo object?

2012-07-30 Thread jpm miao
Hi, I let xzoo be an empty object: > xzoo<-{} and I have an existing zoo object x1zoo_f. I would like to combine the two to make a new zoo object, and continue doing so in a loop, which is not shown here. However, when I type > xzoo<-cbind(xzoo, x1zoo_f) An error message emerges

Re: [R] fractal package

2012-07-30 Thread David Winsemius
On Jul 29, 2012, at 11:26 PM, mary Joy Regidor wrote: Greetings of Peace! I am new in R software. I want to use the correlation dimension corrDim in computing a map. I have installed the packages(fractal) in R. Now my problem is this, when I tried your example in the following site http:

Re: [R] Coloring Counties in a State Map

2012-07-30 Thread Ray Brownrigg
On 07/29/12 08:56, arcata wrote: > I am mapping U.S. state counties in individual states maps, e.g. A map of > Montana, with county lines. > How do I fill specific counties with a different color? > Do you mean something like: m <- map("county", "Montana") map("county", m$names[c(1, 4)], fill=TRU

Re: [R] Latest version of R on Ubuntu

2012-07-30 Thread Jeff Newmiller
Amazingly, RTFM. Linux typically uses "repositories" to download software from. If you follow the instructions on CRAN specific to Ubuntu, you can add a repository that has current versions of R. Admittedly, some of the steps are non-obvious due to security concerns, but the instructions are pr

Re: [R] low resolution word map

2012-07-30 Thread Ray Brownrigg
On 07/28/12 23:46, Thomas Steiner wrote: > Hi, > I'd like to have a low resolution word map in R. > The "maps" package has this option, but if I use the argument, the map > looses sense: Russia and Australia get empty etc > > library("maps") > m=map(col="skyblue",fill=TRUE,plot=TRUE,resolution=10)

Re: [R] cannot install RSTAR, MSVAR, and MSVECM packages

2012-07-30 Thread Ario Ario
Hi, Thank you. I've tried to find the substitute of such packages with google, but I couldn't find any. Could you please tell me how to find it? Sorry, I'm a beginner user of this software. Regards, Ario On Tue, Jul 31, 2012 at 12:19 AM, Uwe Ligges < lig...@statistik.tu-dortmund.de> wrote: > > >

Re: [R] mgcv 1.7-19, vis.gam(): "invalid 'z' limits'

2012-07-30 Thread Simon Wood
Jan, Could you send the exact gam call and exact vis.gam call that did this please? Also, if 'm' denotes your fitted model, what result does 'fitted(m)' give? and what is the output from print(m)? best, Simon On 07/30/2012 09:19 PM, janvanhove wrote: Hi everyone, I ran a binomial GAM consi

[R] Latest version of R on Ubuntu

2012-07-30 Thread jim holtman
I am a newbie when it comes to Ubuntu having "grown up" on Windows using R. I installed 12.04 on a laptop and it went fine. When I went out to CRAN and followed the directions (hopefully) to install R, seems to have gone fine, except that when I start R I get 2.14.1: jim@jim-winbook:~$ R R vers

Re: [R] Alternating between "for loops"

2012-07-30 Thread Mercier Eloi
Or, assuming you only have 4 different elements : mat<- matrix(rep(c(1,2,"A", "B"),each=10),10,10, byrow=F) mat2 <- as.data.frame(mat) mat [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] "1" "2" "A" "B" "1" "2" "A" "B" "1" "2" [2,] "1" "2" "A" "B" "1" "2" "A" "B"

Re: [R] Alternating between "for loops"

2012-07-30 Thread Rui Barradas
Hello, Maybe something along the lines of J <- 10 cols <- rep(c(TRUE, TRUE, FALSE, FALSE), 3)[seq_len(J)] for(i in which(cols)) { do something } for(i in which(!cols)) { do something else } Hope this helps, Rui Barradas Em 31-07-2012 00:18, Claudia Penaloza escreveu: Dear All, I would like t

[R] Alternating between "for loops"

2012-07-30 Thread Claudia Penaloza
Dear All, I would like to apply two different "for loops" to each set of four columns of a matrix (the loops here are simplifications of the actual loops I will be running which involve multiple if/else statements). I don't know how to "alternate" between the loops depending on which column is "run

Re: [R] Thinning Lattice Plot

2012-07-30 Thread David L Carlson
You might also check ?pdf on your system. On Windows the default is for compression. Your code creates a 186K file although it is slow to load reflecting the overhead from decompressing the file. -- David L Carlson Associate Professor of Anthropology Te

[R] Accents and special character using hwriter (on Windows)

2012-07-30 Thread ramonovelar
Hello, I have a problem with special characters such as "í" or "ñ" when using hwriter. This only happens when I use windows, it works fine on mac. If I do: print(datosdv) "Ciencias Sociales y Jurídicas n:74 | 33.94%" but: hwrite(datosdv, p, br=TRUE) "Ciencias Sociales y Jur�dicas n:74 | 33.94

Re: [R] Getting warning message

2012-07-30 Thread arun
Hello, Your str() is different from mine.  It has G,Y,R, and T as factors.  You can do one thing, add stringsAsFactors=FALSE in read.table().  Even without it, I don't have any problems as this will only affect the Summary column.  Z16<-read.table(text="  Summary G Y R  T   Ac

[R] covariance estimate in function sem (Lavaan)

2012-07-30 Thread Luna
Dear R users, I have a hard time interpreting the covariances in the parameter estimates output (standardized), even in the example documented (PoliticalDemocracy). Can anyone tell me if the estimated covariances are residual covariances (unexplained by the model), or the covariances of the obser

Re: [R] Getting warning message

2012-07-30 Thread namit
Hi Arun, when i'm using the logic which you mentionI'm getting error..can you please help me on this. > Z16<-str(Z16) 'data.frame': 5 obs. of 5 variables: $ Summary: chr "Accts" "AcctCov" "Cov%" "UnCov%" ... $ G : Factor w/ 5 levels "224","39","568",..: 3 1 2 4 5 $ Y : Factor

Re: [R] Appending the column names

2012-07-30 Thread arun
Hello, It's not "Colnames".  It is colnames().  Also, you should use stringsAsFactors=FALSE.  I tried to reply it to nabble.  But, seems like nabble webpage is redirecting to some porn site.  Anyway, X<-read.table(text="     Summary    G  Y R   Acc   12    12   13  

Re: [R] R- Help (looping)

2012-07-30 Thread Rui Barradas
Hello, Try the following. # make up some data dds <- 1e3 nc <- 10 xss <- data.frame(matrix(runif(nc*dds, min=-1, max=1), ncol=nc)) names(xss) <- paste0("xs", 1:10) # two functions with descriptive names getControlLimits <- function(x, L = 3){ mu <- mean(x) sigma <- sd(x) c(lcl = mu

Re: [R] MANOVA polynomial contrasts

2012-07-30 Thread John Fox
Dear Mauro, I believe that I've answered a version of this question three times this month alone, so I'll be brief. Are you aware that if you use type-III tests, even if you are careful to employ contrasts, such as orthogonal polynomial contrasts, that are orthogonal for different terms in the r

Re: [R] Thinning Lattice Plot

2012-07-30 Thread David Winsemius
On Jul 30, 2012, at 2:13 PM, Elliot Joel Bernstein wrote: Is there an easy way to "thin" a lattice plot? I often create plots from large data sets, and use the "pdf" command to save them to a file, but the resulting files can be huge, because every point in the underlying dataset is render

Re: [R] Calculating percentiles for multiple dates

2012-07-30 Thread Rui Barradas
Hello, Sorry for my earlier post, they show the problem of not providing context. Fortunatelly, arun's post made me realize there was some data posted somwhere after all. So, try this: aggregate(DEPTH ~ LOG_DATE, data = dat1, quantile, probs = c(0.025, 0.975)) LOG_DATE DEPTH.2.5% DEPTH.97.5

Re: [R] Appending the column names

2012-07-30 Thread David L Carlson
You can't always get what you want (a data.frame with two sets of column headings), but you do have several options. Maybe they will help you think about what you are trying to do. Given X and Y as Arun provided earlier, you can create Z > Z <- rbind(X,colnames(Y),Y) > Z Summary G Y R 1

Re: [R] Turning off continuation prompt?

2012-07-30 Thread Uwe Ligges
On 30.07.2012 15:36, Robert Baer wrote: On Mon, 30 Jul 2012 09:58:09 +0100 (BST) (Ted Harding) wrote: Greetings All. My apologies for a question whose answer is probably readily available somewhere (for some interpetation of "somewhere") ... Say I have just typed (from a sheet of paper) seve

Re: [R] MANOVA polynomial contrasts

2012-07-30 Thread Manzoni, GianMauro
Dear Prof. John Fox, I found the paper very useful. Thank you very much for attaching the link! Which type of SS (II or III) do you suggest for a multivariate model with 2 unbalanced factors and 2 covariates? I think that type III is the right one but Mauro 2012/7/30 > Dear GMM, > > > --

[R] Thinning Lattice Plot

2012-07-30 Thread Elliot Joel Bernstein
Is there an easy way to "thin" a lattice plot? I often create plots from large data sets, and use the "pdf" command to save them to a file, but the resulting files can be huge, because every point in the underlying dataset is rendered in the plot, even though it isn't possible to see that much deta

Re: [R] barplot question

2012-07-30 Thread Rui Barradas
Hello, Try the following. plants_herbs_input_top10 <- structure(list(total = c(28L, 17L, 11L, 6L, 6L, 5L, 4L, 3L, 3L, 2L), young = c(29L, 22L, 15L, 8L, 5L, 3L, 2L, 2L, 2L, 2L), old = c(36L, 11L, 11L, 8L, 6L, 5L, 4L, 3L, 2L, 2L)), .Names = c("total", "young", "old"), class = "data.frame", row.

Re: [R] Appending the column names

2012-07-30 Thread R. Michael Weylandt
On Mon, Jul 30, 2012 at 3:17 PM, namit wrote: > Hi Freinds, > > I have two data frames X,Y. I want to append both the data frames into one, > along with the columns names from both the data frames (it should look like > Z). > > X: > SummaryG Y R > Acc 1212

Re: [R] sprintf doesn't care of escape characters

2012-07-30 Thread Edwin Helbert Aponte Angarita
Thank you very much. I didn't know about this difference, I thought it just behaved as in C/C++. Thanks. On Mon, 2012-07-30 at 14:15 -0400, jim holtman wrote: > sprintf is working just fine. Your problem is the interpretation of > what the results are. Displaying the object will show the escape

Re: [R] curve comparison

2012-07-30 Thread arun
Hello, You could try some non-parametric tests for comparison such as Kolmogorov-Smirnov test (ks.test() package: truncgof)or Cramer-von Mises test (cvmts.pval() package: CvM2SL2Test). A.K. - Original Message - From: Luis Fernando García Hernández To: r-help@r-project.org Cc: Sent:

[R] mgcv 1.7-19, vis.gam(): "invalid 'z' limits'

2012-07-30 Thread janvanhove
Hi everyone, I ran a binomial GAM consisting of a tensor product of two continuous variables, a continuous parametric term and crossed random intercepts on a data set with 13,042 rows. When trying to plot the tensor product with vis.gam(), I get the following error message: Error in persp.default

[R] Appending the column names

2012-07-30 Thread namit
Hi Freinds, I have two data frames X,Y. I want to append both the data frames into one, along with the columns names from both the data frames (it should look like Z). X: SummaryG Y R Acc 1212 13 Bcc 1114 15 Ccc

Re: [R] If/then statement, if in a list then

2012-07-30 Thread Bert Gunter
Sorry, one error: On Mon, Jul 30, 2012 at 1:18 PM, Bert Gunter wrote: > ?? > > On Mon, Jul 30, 2012 at 11:46 AM, R. Michael Weylandt > wrote: >> On Mon, Jul 30, 2012 at 8:49 AM, Bert Gunter wrote: >>> Not necessarily. If the OP really meant the R list() structure, then >>> is.element does not a

Re: [R] If/then statement, if in a list then

2012-07-30 Thread Bert Gunter
?? On Mon, Jul 30, 2012 at 11:46 AM, R. Michael Weylandt wrote: > On Mon, Jul 30, 2012 at 8:49 AM, Bert Gunter wrote: >> Not necessarily. If the OP really meant the R list() structure, then >> is.element does not apply. > > Perhaps... > > x <- list(1:5, "a", `+`, rnorm, NULL, list(letters)) Not

Re: [R] R-neuralnet code

2012-07-30 Thread arun
Hello, You can check this link (http://econometricsense.blogspot.com/2010/12/r-code-example-for-neural-networks.html).  A.K. From: Rahul Bhalla To: arun Sent: Monday, July 30, 2012 3:51 PM Subject: R-neuralnet code Can you please give me a simple R-n

Re: [R] Calculating percentiles for multiple dates

2012-07-30 Thread arun
Hi, If you look at the output from the given data, the lwr and upr is constant for a particular date.  So, I guess you can use that value as the percentile.  I assume that your statement of grouping all of one date together so as to average out the observations.  In that case, there will be o

Re: [R] multicore R

2012-07-30 Thread R. Michael Weylandt
Load the parallel package as David suggested, and look at example(mclapply) -- it gives a bootstrapping example in the "don't run" section. Michael On Mon, Jul 30, 2012 at 2:50 PM, Chet Seligman wrote: > I have already consulted multicore.pdf and wondered if anyone could offer > specific code fo

Re: [R] multicore R

2012-07-30 Thread Chet Seligman
I have already consulted multicore.pdf and wondered if anyone could offer specific code for doing loops, apply's and/or cross-validation on a multicore machine? On Mon, Jul 30, 2012 at 12:07 PM, David Winsemius wrote: > > On Jul 30, 2012, at 11:56 AM, Chet Seligman wrote: > > Can anyone provide

Re: [R] Convert variable to STring

2012-07-30 Thread Rui Barradas
Hello, Is this it? function1 <- function(x) print(x) name.function1 <- deparse(substitute(function1)) name.function1 Hope this helps, Rui Barradas Em 30-07-2012 11:47, Alaios escreveu: > Dear all, > I have a variable that I would like also to use it as a string. The reasons > is that I want to

Re: [R] Calculating percentiles for multiple dates

2012-07-30 Thread Rui Barradas
Sorry, I've sent this only to the op, forgetting to cc the list. Hello, Percentile of what? You probably have a dataset with dates and a variable, right? What is the nature of that variable? Post a data example: dput(head(myData), 20) # or 30 Copy the output of that command and paste it in

Re: [R] If/then statement, if in a list then

2012-07-30 Thread Rui Barradas
Hello, Em 30-07-2012 19:46, R. Michael Weylandt escreveu: On Mon, Jul 30, 2012 at 8:49 AM, Bert Gunter wrote: Not necessarily. If the OP really meant the R list() structure, then is.element does not apply. Perhaps... x <- list(1:5, "a", `+`, rnorm, NULL, list(letters)) letters %in% x # Work

Re: [R] quantreg Wald-Test

2012-07-30 Thread Brian S Cade
Stefan: Your comparison of two models, one with a nested reduced set of parameters by fixing the others at zero, with anova() can be used to make inference either based on a likelihood ratio form of test or the rankscore test for a given quantile (see ?anova.rq and the vignette for literature

Re: [R] A "matching problem"

2012-07-30 Thread arun
Hi, Not sure what you wanted. But, this will be just a subset of possible combinations as you described in the post. vector1<-sample(LETTERS[1:6])  vector2<-sample(letters[1:6]) b<-list() for(i in 1:length(vector1)){  b[[i]]<-list()  b[[i]]<-sample(vector1)  } d<-list()  for(j in 1:length(vector

Re: [R] multicore R

2012-07-30 Thread David Winsemius
On Jul 30, 2012, at 11:56 AM, Chet Seligman wrote: Can anyone provide code example(s) for doing loops, apply's and/or cross-validation on a multicore machine? help(package=parallel) -- David Winsemius, MD Alameda, CA, USA __ R-help@r-project.org

[R] multicore R

2012-07-30 Thread Chet Seligman
Can anyone provide code example(s) for doing loops, apply's and/or cross-validation on a multicore machine? Chet Seligman [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLE

Re: [R] If/then statement, if in a list then

2012-07-30 Thread R. Michael Weylandt
On Mon, Jul 30, 2012 at 8:49 AM, Bert Gunter wrote: > Not necessarily. If the OP really meant the R list() structure, then > is.element does not apply. Perhaps... x <- list(1:5, "a", `+`, rnorm, NULL, list(letters)) letters %in% x # Works -- vectorized, mostly false, but the "a" is there, per b

Re: [R] Problem creation tensor

2012-07-30 Thread Petr Savicky
On Mon, Jul 30, 2012 at 04:11:40AM -0700, GiuseppeRicci wrote: > Hi, > > thank Petr for your help. > I have implemented you code suggestion but there is another problem. > It seems that the code: > > for (i in 1:m){ > Z[i,,]=table(occ, data_matrix[,i]) > } > > don't charge any values in Z. > Is

Re: [R] sprintf doesn't care of escape characters

2012-07-30 Thread Jeff Newmiller
I am unable to determine what you think the problem is from your description. A wild guess is that you just don't know what you are looking at in the output. Do you understand the difference between the output of the "print" function and of the "cat" function? Try cat( sprintf("a\"bc\"d") ) an

Re: [R] Optimization help

2012-07-30 Thread Petr Savicky
On Mon, Jul 30, 2012 at 06:51:47AM -0700, Megh Dal wrote: > Hi, I have following optimization problem: > > Min: x1 + x2 +...+ x7 > subject to: > > x1 + x2 >= 80 > x2 + x3 >= 65 > x3 + x4 >= 40 > > all xi are ***positive integer***. > > Can somebody help me in this optimization problem? Hi. As

Re: [R] sprintf doesn't care of escape characters

2012-07-30 Thread jim holtman
sprintf is working just fine. Your problem is the interpretation of what the results are. Displaying the object will show the escape characters, but if you use "cat", or output to a file, you will see that the result is correct: > cat( sprintf("a\nb")) a b> > cat(sprintf("a\"bc\"d")) a"bc"d> >

Re: [R] A "matching problem"

2012-07-30 Thread MacQueen, Don
Does this do what you want? (using just three letters to keep the list of results short) > tmp <- expand.grid(v=letters[1:3],V=LETTERS[1:3]) > tmp v V 1 a A 2 b A 3 c A 4 a B 5 b B 6 c B 7 a C 8 b C 9 c C > > subset(tmp, tolower(tmp$V) != tmp$v) v V 2 b A 3 c A 4 a B 6 c B 7 a C 8 b C -Don

Re: [R] Histogram

2012-07-30 Thread David Winsemius
On Jul 30, 2012, at 9:29 AM, Jim Silverton wrote: I have the following codes: Now, suppose I have x = runif(1000,0,1, rep(1, 250), rep(0, 100) and I want to create a 'bin' for the 0's and the 1's and put the rest of the values in say about 20 bins. How can this be done? ?cut -- David.

[R] sprintf doesn't care of escape characters

2012-07-30 Thread Edwin Helbert Aponte Angarita
Hi. I am having trouble with something that should be simple. I am unable to get sprintf using escape sequences: > sprintf("a\nb") [1] "a\nb" > sprintf("a\"bc\"d") [1] "a\"bc\"d" But it seems to need them any way: > sprintf("a\"bc"d") Error: unexpected symbol in "sprintf("a\"bc"d" Any suggest

Re: [R] Calculating percentiles for multiple dates

2012-07-30 Thread guzzom
I was hoping to calculate the percentile for each date. So group all of one date together, calculating the value of the 2.5 and 97.5 percentile. -- View this message in context: http://r.789695.n4.nabble.com/Calculating-percentiles-for-multiple-dates-tp4638183p4638378.html Sent from the R help

[R] Are there any package for sub-sampling data

2012-07-30 Thread Bruce Miller
Hi all, I need to sub sample some large data sets. The problem is using complete data samples for bats that are ± data per 1-minute time blocks using acoustic data collection and a method I published some time back. Miller, B. W. 2001. A method for determining relative activity of free flying

Re: [R] A "matching problem"

2012-07-30 Thread Petr Savicky
On Mon, Jul 30, 2012 at 08:40:59PM +0545, Christofer Bogaso wrote: > Dear all, I was encountering with a typical Matching problem and was > wondering whether R can help me to solve it directly. > > Let say, I have 2 vectors of equal length: > vector1 <- LETTERS[1:6] > vector2 <- letters[1:6] > >

[R] te( ) interactions and AIC model selection with GAM

2012-07-30 Thread Ricardogg
Hello R users, I'm working with a time-series of several years and to analyze it, I’m using GAM smoothers from the package mgcv. I’m constructing models where zooplankton biomass (bm) is the dependent variable and the continuous explanatory variables are: -time in Julian days (t), to creat a long-

Re: [R] If equal statement for character objects

2012-07-30 Thread Bert Gunter
1. Please read an Intro to R before posting further. In your previous post you confused "=" with "==". These and other basic matters are discussed there, so you can save yourself -- and this list -- a lot of time and aggravation by familiarizing yourself with it.(Unless this was just a typo). 2. I

[R] Optimization help

2012-07-30 Thread Megh Dal
Hi, I have following optimization problem: Min: x1 + x2 +...+ x7 subject to: x1 + x2 >= 80 x2 + x3 >= 65 x3 + x4 >= 40 all xi are ***positive integer***. Can somebody help me in this optimization problem? Thanks for your help __ R-help@r-project.org

[R] Unable to install gsl package

2012-07-30 Thread Michael Hughes
I'm attempting to install the gsl package using the following command: install.packages("c:/users/mike/documents/R/win-library/gsl_1.9-9.tar.gz",repos=NULL,type="source") My attempt is failing. Please help. The message supplied is: Installing package(s) into ‘C:/Users/Mike/Documents/R/win-lib

[R] multiple comparison tests using medians

2012-07-30 Thread Data Analytics Corp.
Hi, A client has asked for a series of pair-wise tests similar to Tukey's but using medians as opposed to means. The reason is that the distributions are highly right skewed. Are there such tests (I'm finding nothing) and if so, is there anything in R? Thanks, Walt __

Re: [R] MANOVA polynomial contrasts

2012-07-30 Thread Manzoni, GianMauro
Dear Prof. John Fox, thank you very much for your suggestions. However, I still do not know how to use the contrasts after generating them. Once I generate the matrix with the polynomial contrasts, what are the following steps toward the statistical test? A whole example would be very useful. Tha

Re: [R] curve comparison

2012-07-30 Thread Will Shadish
I'm very much a novice with R, and not a statistician. But as my group has been working with generalized additive models (semi-parametric regression), we have followed Wood's advice about using the R anova function to do model comparison for different regressions. I would imagine at least some

Re: [R] MANOVA polynomial contrasts

2012-07-30 Thread jesse.fox
Dear GMM, > -Original Message- > From: Manzoni, GianMauro [mailto:gm.manz...@auxologico.it] > Sent: July-30-12 9:49 AM > To: John Fox > Cc: r-help@r-project.org; Greg Snow > Subject: Re: [R] MANOVA polynomial contrasts > > Dear Prof. John Fox, > thus all I should do to test quadratic and

Re: [R] Convert variable to STring

2012-07-30 Thread arun
Hello, Not sure whether this is what you need. colnames(mymatrix)<-c("function1","function2","function3") > toString(colnames(mymatrix)) #[1] "function1, function2, function3" A.K. - Original Message - From: Alaios To: R help Cc: Sent: Monday, July 30, 2012 6:47 AM Subject: [R] Con

Re: [R] MANOVA polynomial contrasts

2012-07-30 Thread Manzoni, GianMauro
Dear Prof. John Fox, thus all I should do to test quadratic and cubic effects is to change the second argument of the linearHypothesis() function, right? So, for testing the cubic effect: > linearHypothesis (mod, "f.C") Is there a chapter or paragragh about contrasts in your book "An R companion

Re: [R] Problem creation tensor

2012-07-30 Thread GiuseppeRicci
Hi, thank Petr for your help. I have implemented you code suggestion but there is another problem. It seems that the code: for (i in 1:m){ Z[i,,]=table(occ, data_matrix[,i]) } don't charge any values in Z. Is there some error? Thanks. Giuseppe -- View this message in context: http://r.78969

[R] Problem with Bootres dcc and Dendroclim match

2012-07-30 Thread Rasmus_Jorgensen
Dear all, I hope someone can assist with soliving my problems with the DCC function in the BOOTRES package. Initially did my analyses in Dendroclim, but when I tried to repeat the analyses in dcc I encountered some problems, that I think I should report. First I encountered that that one varia

[R] barplot question

2012-07-30 Thread Michael Eisenring
Dear r-help members. I would like to: a) control the margin around my legend box. Unfortunately I did not find an appropriate command under "?legend". The margin around the actual legend is way too wide. There is a lot of unnecessary "empty space" on the right side. b) increase the width of t

[R] pairwise comparisons in accordance with regression fit

2012-07-30 Thread Andres LaCortadora
Hello, I have a unconventional question arising from my current master thesis on regression modeling. Suppose we have fitted a (linear) relationship between a dependent variable y and an independent variable x. Now we choose two points on the x-axis, i.e. according to percentiles x10 and x90. Thes

[R] Marginal effects in mlogit

2012-07-30 Thread Lee van Cleef
Dear all, does anybody have experience with the calculation of marginal effects (“effects”) in Mlogit (see Croissant, Package ‘mlogit’, p.8)? 1) Is there a good qualitative explanation available for the listed options for the argument “type” (“aa”, …)? When do I have to choose aa, ar…? And w

Re: [R] cell blocking in log-linear models with a survey sample

2012-07-30 Thread Robert Arnold
Hello. I hope someone can suggest a way to test log-linear models with cells blocked when working with survey data. The tables I am working with come from a multi-stage stratified sample. The command 'svyloglin' in the package 'survey' works well when I want to choose between models with tw

[R] length of variable in mlogit

2012-07-30 Thread Lee van Cleef
Dear all, does anybody have experience with building logits in Mlogit? I want to test the use of a couple of alternative specific variables with a generic regression coefficient. However, one of them simply does not work. R says the length of this variable is different. Problem: If I check the l

Re: [R] Hmisc improveProb() and PredictABEL reclassification () function and continuous NRI

2012-07-30 Thread Frank Harrell
If you type improveProb at the command line you'll see all the code, which is quite simple. I'm glad you are not attempting to classify risk as this is almost always futile. Frank Svingen, Gard Frodahl wrote > > Dear Sirs. > > I am working with the R packages Hmisc and PredictABEL to make NRI

Re: [R] How can I use IPF function correctly?

2012-07-30 Thread David L Carlson
I’m not sure what SAS is doing (or if you are using it correctly). In R you do not create marginal totals independent of the data and try to fit them to the data. In your first example you create a matrix called raw, but you do not use it for anything. Your loglin() call is for the all cells 16.67

Re: [R] Z score in gplots

2012-07-30 Thread David Winsemius
On Jul 29, 2012, at 9:49 PM, Khush gg wrote: Hi, Can anyone tell me how to set Z-score according to my own requirement as the below code is taking as per the file entries. Any help would be appreciable. That was a bit vague and hard to parse, but I'm thinking I may need to make allowan

Re: [R] Possible bug in class 'POSIXlt' when including microseconds?

2012-07-30 Thread jim holtman
FAQ 7.31 In floating point, you get about 15 digits of precision. If you look at the value of time for today you will see: 1343668783 If you add 5 more digits after the decimal point, you will see that there is not resolution to a microsecond level. I usually assume that I can get millisecond

Re: [R] cannot install RSTAR, MSVAR, and MSVECM packages

2012-07-30 Thread Uwe Ligges
On 30.07.2012 11:42, peter dalgaard wrote: On Jul 30, 2012, at 11:08 , Ario Ario wrote: *Hi all, I got problems installing RSTAR, MSVAR, and MSVECM packages. * No such thing exists on CRAN (nor its Archive section), so little wonder. Similarly named packages exist for the Ox matrix langua

[R] Possible bug in class 'POSIXlt' when including microseconds?

2012-07-30 Thread Janko Thyson
Dear list, I'm a bit puzzled by an ambiguity with respect to the representation of micro-/milliseconds when using 'POSIXlt' objects. It seems that the last digit of the 'sec' attribute sometimes seems to differ from the digits shown when printing the 'POSIXlt' object. You'll find a little SO

Re: [R] lattice legen and auto.key conflict

2012-07-30 Thread Bert Gunter
David: I think one needs to carefully parse the xyplot help, where it says: "To use more than one legend, or to have arbitrary legends not constrained by the structure imposed by key, use the legend argument. " So I presume that this is to be interpreted as: "ONLY the legend argument will be use

Re: [R] distance matrix and hclustering

2012-07-30 Thread David L Carlson
For basic hierarchical clustering use groups <- hclust(dist(qmu)) But there are many options for function dist() and for function hclust() and these will affect the results. For basic plotting use plot(groups) But as you will see, there are too many cases for the labels to be legible. Hierarchi

Re: [R] use R to read/print the system hardware configuration

2012-07-30 Thread David Winsemius
On Jul 30, 2012, at 8:42 AM, Jie wrote: Sorry to miss the OS information. I run it on Window 7 32 bit, 64 bit and Unix (version unclear, it is a grid machine.) Have you looked at: ?.Machine -- David. Best wishes, Jie On Mon, Jul 30, 2012 at 11:39 AM, Prof Brian Ripley wrote: On 30/0

Re: [R] how to sort huge (> 2^31 row) dataframes quickly

2012-07-30 Thread jim holtman
This is where the sort/merge application on the mainframe has excelled for the last 40 years. If you can not send it to a mainframe, you can look at the SyncSort package that runs on UNIX machines. On Mon, Jul 30, 2012 at 12:25 PM, Matthew Keller wrote: > Hello all, > > I have some genetic datas

Re: [R] replace values in vector from a replacement table

2012-07-30 Thread Liviu Andronic
On Mon, Jul 30, 2012 at 6:00 PM, jim holtman wrote: > try this: >> indx <- match(x, repl.tab[, 1], nomatch = 0) >> x[indx != 0] <- repl.tab[indx, 2] >> x > [1] "A" "B" "c" "D" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" "o" "p" > "q" "r" "s" "t" "u" "v" "w" > [24] "x" "y" "z" "A" "B" "c" "D" "e" "f"

Re: [R] Histogram

2012-07-30 Thread Jim Silverton
I have the following codes: Now, suppose I have x = runif(1000,0,1, rep(1, 250), rep(0, 100) and I want to create a 'bin' for the 0's and the 1's and put the rest of the values in say about 20 bins. How can this be done? Jim On Thu, Jul 5, 2012 at 4:08 PM, Sarah Goslee wrote: > Which gives

[R] how to sort huge (> 2^31 row) dataframes quickly

2012-07-30 Thread Matthew Keller
Hello all, I have some genetic datasets (gzipped) that contain 6 columns and upwards of 10s of billions of rows. The largest dataset is about 16 GB on file, gzipped (!). I need to sort them according to columns 1, 2, and 3. The setkey() function in the data.table package does this quickly, but of

[R] lattice legen and auto.key conflict

2012-07-30 Thread GOUACHE David
Hello R-helpers, I'm trying to customize a graphic in lattice using the 'legend' argument to add labels on my plot but in the process I'm losing the legend drawn by 'auto.key', despite the fact that I'm actually not sticking these on the same sides of the graphic. I worked up a quick and simple

Re: [R] replace values in vector from a replacement table

2012-07-30 Thread jim holtman
try this: > (x <- rep(letters,2)) [1] "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" "o" "p" "q" "r" "s" "t" "u" "v" "w" [24] "x" "y" "z" "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" "o" "p" "q" "r" "s" "t" [47] "u" "v" "w" "x" "y" "z" > values <- c("aa", "a", "b", NA, "d", "z

[R] replace values in vector from a replacement table

2012-07-30 Thread Liviu Andronic
Dear all I've got stuck when trying to replace values in a vector by selecting replacements from a replacement table. I'm trying to use only base functions. Here's a dummy example: > (x <- rep(letters,2)) [1] "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" "o" "p" "q" "r" "s" "t" "u" "v" [

Re: [R] A "matching problem"

2012-07-30 Thread jim holtman
Is this what you want: > vector1 <- sample(LETTERS[1:6]) # randomize > vector2 <- letters[1:6] > # convert to lower case for matching > vector1 <- tolower(vector1) > vector2 <- tolower(vector2) > # count the number of matches so order does not matter > count <- match(vector1, vector2) > if (length

Re: [R] use R to read/print the system hardware configuration

2012-07-30 Thread Jie
Sorry to miss the OS information. I run it on Window 7 32 bit, 64 bit and Unix (version unclear, it is a grid machine.) Best wishes, Jie On Mon, Jul 30, 2012 at 11:39 AM, Prof Brian Ripley wrote: > On 30/07/2012 16:08, Jie wrote: > >> Dear All, >> >> I am curious if there is any why to use R to

Re: [R] use R to read/print the system hardware configuration

2012-07-30 Thread Prof Brian Ripley
On 30/07/2012 16:08, Jie wrote: Dear All, I am curious if there is any why to use R to know the specification of the machine that runs on, i.e. read the cpu model, memory size, those hardware info, maybe even with thesoftware information. Thank you for your attention. There are ways ... howeve

Re: [R] locked binding of setwd() in R 2.15.x causes .Rprofile to fail

2012-07-30 Thread William Dunlap
Does trace() do what you want from a .Rprofile file? It works from the command line: > trace(setwd,print=FALSE,quote(options(prompt=paste0(dir,"> " Tracing function "setwd" in package "base" [1] "setwd" > setwd("z:/") z:/> getwd() [1] "z:/" z:/> setwd("c:/temp") c:/temp> pi

[R] locked binding of setwd() in R 2.15.x causes .Rprofile to fail

2012-07-30 Thread Michael Friendly
[Env: Win XP, R 2.14.2, R 2.15.0] I have a replacement function for setwd() in my .Rprofile which displays the current R path in the R window title. It no longer works in R 2.15.x, giving the error below. Worse, the error prevents the rest of my .Rprofile script from completing. Is there some

[R] use R to read/print the system hardware configuration

2012-07-30 Thread Jie
Dear All, I am curious if there is any why to use R to know the specification of the machine that runs on, i.e. read the cpu model, memory size, those hardware info, maybe even with thesoftware information. Thank you for your attention. Best wishes, Jie [[alternative HTML version deleted

[R] A "matching problem"

2012-07-30 Thread Christofer Bogaso
Dear all, I was encountering with a typical Matching problem and was wondering whether R can help me to solve it directly. Let say, I have 2 vectors of equal length: vector1 <- LETTERS[1:6] vector2 <- letters[1:6] Now I need to match these 2 vectors with all possible ways like: (A,B,C,D,E) & (

Re: [R] If equal statement for character objects

2012-07-30 Thread cm
nevermind. all.equal() works! -- View this message in context: http://r.789695.n4.nabble.com/If-equal-statement-for-character-objects-tp4638359p4638361.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

[R] If equal statement for character objects

2012-07-30 Thread cm
I have a data frame (trans) 123 P 143 z ...ect I want to write a statement that says: if ((trans[i,2]="p")&(trans[1+1,2]="z")){ but I get the warning message that states: operations are possible only for numeric, logical or complex types Any ideas? Thanks -- View this message i

  1   2   >