Re: [R] Select first element of each factor and convert to NA

2013-02-28 Thread PIKAL Petr
Hi > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Cesar Terrer > Sent: Friday, March 01, 2013 4:21 AM > To: r-help@r-project.org > Subject: [R] Select first element of each factor and convert to NA > > Hi all, > > > > I h

Re: [R] Ploting different values with different colors

2013-02-28 Thread PIKAL Petr
Hi > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Benoit Gendreau-Berthiaume > Sent: Friday, March 01, 2013 12:54 AM > To: r-help@r-project.org > Subject: [R] Ploting different values with different colors > > Hello I am tr

Re: [R] Returning index of vector element matching specific value

2013-02-28 Thread davidwood
Thanks very much AK so indeed they are floats! I'll be more careful next time when performing equality comparisons. Cheers, Dave -- View this message in context: http://r.789695.n4.nabble.com/Returning-index-of-vector-element-matching-specific-value-tp4659952p4659959.html Sent from the R help

Re: [R] Returning index of vector element matching specific value

2013-02-28 Thread davidwood
Thanks for the reply AK. >From R FAQ 7.31: "The only numbers that can be represented exactly in R's numeric type are integers and fractions whose denominator is a power of 2" I'm not sure though that this is the problem here, does this statement apply to only floating point numbers? Is 0.15 a fl

[R] Select first element of each factor and convert to NA

2013-02-28 Thread Cesar Terrer
Hi all, I have a dataframe of the following type: DayPlace dendrometermax 1 1 1 4684 2 1 1 4831 .. 1 1 2 2

[R] Extracting coefficients of covariates in a LME-model

2013-02-28 Thread Kyran Graham
Hi all, I have created a linear mixed-effects model using lmer. My dependent variable is comp.score and my main independent variable is delay.type, a repeated-measures within-subject variable (2 levels: Synch and Asynch, order counter-balanced across participants). I had a series of covariates tha

[R] Results from clogit out of range?

2013-02-28 Thread lisa
I do appreciate this answer. I heard that in SAS, conditional logistic model do predictions in the same way. However, this formula can only deal with in-sample predictions. How about the out-of-sample one? Is it like one of the former responses by Thomas, say, it's impossible to do the out-of-sa

[R] Ploting different values with different colors

2013-02-28 Thread Benoit Gendreau-Berthiaume
Hello I am trying to plot a 20 x 20 grid of points with the colors of each point refering to percent cover of that specific point So basically the point are all the same size and their position on the graph is base on their coordinates (x,y). I want the color (a grey scale from white=0 to black =

Re: [R] issue creating a subset

2013-02-28 Thread Jim Lemon
On 03/01/2013 12:53 PM, Pablo Menese wrote: I'm performing item response theory with eRm packages I am excluding the persons that doesn't fit in the infit/outfit persons. for that I created a condition. then I have to create a new subset or matrix but with the condition. So: ORIGINAL matrix<-c

[R] issue creating a subset

2013-02-28 Thread Pablo Menese
I'm performing item response theory with eRm packages I am excluding the persons that doesn't fit in the infit/outfit persons. for that I created a condition. then I have to create a new subset or matrix but with the condition. So: ORIGINAL matrix<-cbind(item1, item2, item3, item4) IF I PERFORM

Re: [R] Issue attaching a dataset

2013-02-28 Thread Pablo Menese
thanks a lot. works!!! On Tue, Feb 26, 2013 at 7:58 AM, Prof Brian Ripley wrote: > On 26/02/2013 09:55, Milan Bouchet-Valat wrote: > >> Le lundi 25 février 2013 à 20:26 -0300, Pablo Menese a écrit : >> >>> I use to work whit stata dataframe, so, when I use R I type read.dta >>> Until today I do

Re: [R] using a personal template for new R scripts

2013-02-28 Thread Jason Edgecombe
On 02/28/2013 05:40 PM, Steve Taylor wrote: Does anyone know if there's an easy facility to create and specify a template file to be used for new R scripts? I found myself creating this function which works well (in RStudio on Windows). newR = function(filename=tempfile(tmpdir='.',fileext='.R'

Re: [R] query labels in iplot() (or other interactive scatterplot)

2013-02-28 Thread Greg Snow
The HWidentify and HTKidentify functions in the TeachingDemos package let you specify a label for each point, then that label is displayed when you hover over that point with the mouse (and it goes away when you move the mouse away from that point). On Thu, Feb 28, 2013 at 8:36 AM, Agustin Lobo w

Re: [R] Results from clogit out of range?

2013-02-28 Thread David Winsemius
On Feb 28, 2013, at 5:26 AM, Miss SHENG Lisha wrote: > I still don't think the exp(lp)/(1+exp(lp)) gonna work. Since this is > conditional logit model, while this formula is only used in unconditional > ones. By using this, one neglects the information based on stratum. Though I > don't know h

[R] resizing panels but some strip letters disappeared (dotplot)

2013-02-28 Thread Elaine Kuo
Hello, I am using library(latticeExtra) resizePanels to have better visual display in dotplot (lattice). However, some panels became smaller and the strip letters of those panels were partially missing. Please kindly advise how to keep all strip letters remaining when resizing panels. Thank you.

Re: [R] put strip below the panel (dotplot)

2013-02-28 Thread Peter Ehlers
On 2013-02-28 04:20, Elaine Kuo wrote: Hello I am using lattice dotplot and I would like to put the strip under the panel. I found the code “strip” is for the strip above the panel, and “strip.left” for the strip left to the panel. Please kindly advise how to write the code for the strip und

[R] using a personal template for new R scripts

2013-02-28 Thread Steve Taylor
Does anyone know if there's an easy facility to create and specify a template file to be used for new R scripts? I found myself creating this function which works well (in RStudio on Windows). newR = function(filename=tempfile(tmpdir='.',fileext='.R'), open=TRUE) { template = paste(Sys.getenv(

[R] data grouping and fitting mixed model with lme function

2013-02-28 Thread KAYIS Seyit Ali
Dear all,   I have data from the following experimental design and trying to fit a mixed model with lme function according to following steps but struggling. Any help is deeply appreciated.   1) Experimental design: I have 40 plants each of which has 4 clones. Each clone planted to one of 4 b

[R] Question concerning directory/path names

2013-02-28 Thread Lane, Michael
This seems like a very basic question so I have searched the FAQ site, several manuals, and the R-Seek site as well as Googling for an answer but can't seem to come up with one. I am trying to import an Excel file that resides on a University network. The path name of the file is to a network d

Re: [R] Iteration through a list in R

2013-02-28 Thread David Winsemius
On Feb 28, 2013, at 4:30 AM, Sahana Srinivasan wrote: > Hello :) > I'm just starting out with R and would appreciate your help with a couple > of problems I am running into. You do need to work through the examples in "Introduction to R" > I have used Sys.glob to get a list of all filenames hav

Re: [R] Iteration through a list in R

2013-02-28 Thread Bert Gunter
1. I have forwarded this to the list in order to increase your chance of getting a response. I hope that is OK. 2. I would have thought that by putting in the effort to understand the tutorial is how a complete beginner advances beyond that stage. Cheers, Bert On Thu, Feb 28, 2013 at 1:43 PM, Sa

Re: [R] Dealing with parentheses within variable names

2013-02-28 Thread Duncan Murdoch
On 28/02/2013 11:08 AM, Jesus Munoz Serrano wrote: Dear all I'm having some problems with a data set that has parenthesis within the variable names. A example of this kind of variable names is the following: fBodyGyroskewness()Z The case is that R is having a l

Re: [R] Iteration through a list in R

2013-02-28 Thread Bert Gunter
Have you read "An Introduction to R" (ships with R) or other of the many web tutorials. If not, please do so before posting. -- Bert On Thu, Feb 28, 2013 at 4:30 AM, Sahana Srinivasan wrote: > Hello :) > I'm just starting out with R and would appreciate your help with a couple > of problems I am

Re: [R] Dealing with parentheses within variable names

2013-02-28 Thread arun
Hi, You could also try: gsub("[()]","",names(dataFrame)) set.seed(15)  datF<- data.frame(sample(1:10,15,replace=TRUE))  names(datF)<-   "fBodyGyroskewness()Z" gsub("[()]","",names(datF)) #[1] "fBodyGyroskewnessZ" sub("\\(\\)","",names(datF)) #[1] "fBodyGyroskewnessZ" A.K. - Original Messa

Re: [R] Hidden information in an object

2013-02-28 Thread David L Carlson
Below is what happens when you let hotmail format your message using html. Always use plain text emails. The command "attach(cats)" told R to put the data.frame in the search path so that the variables in cats would be visible without specifying the name of the data frame: detach(cats) data(cats)

Re: [R] Dealing with parentheses within variable names

2013-02-28 Thread Bert Gunter
Oops -- forgot that you have to double the backslashes: So use: sub("\\(\\)","", names(dataFrame)) -- Bert On Thu, Feb 28, 2013 at 1:20 PM, Bert Gunter wrote: > Please read ?regex, where it says: > > " Any metacharacter with special meaning may be quoted by preceding it > with a backslash. Th

Re: [R] Dealing with parentheses within variable names

2013-02-28 Thread Bert Gunter
Please read ?regex, where it says: " Any metacharacter with special meaning may be quoted by preceding it with a backslash. The metacharacters in EREs are . \ | ( ) [ { ^ $ * + ?, but note that whether these have a special meaning depends on the context. " So use: sub("\(\)","", names(dataFrame))

Re: [R] Hidden information in an object

2013-02-28 Thread Ista Zahn
Hi Rasmus, Things will be much less confusing if you don't use attach. I know that sounds flippent, but I'm quite serious. Best, Ista On Thu, Feb 28, 2013 at 7:50 AM, Rasmus Hedegaard wrote: > > > > > Hello, The dataset "cats" contain information about the heart weight ("Hwt"), > body weight (

Re: [R] Negative Binomial Regression - glm.nb

2013-02-28 Thread Rolf Turner
On 02/28/2013 08:27 PM, Martin Spindler wrote: Dear all, I would like to ask, if there is a way to make the variance / dispersion parameter $\theta$ (referring to MASS, 4th edition, p. 206) in the function glm.nb dependent on the data, e.g. $1/ \theta = exp(x \beta)$ and to estimate the param

Re: [R] positioning of R windows

2013-02-28 Thread Glenn Stauffer
Ahh, I should have known about the MDI and SDI options - choosing SDI lets me do what I want. Thanks. On #2, I realized that when the change directory dialog window pops up, if I resize it, R remembers the resizing so that now the entire window is visible. I should have tried that before I posted.

[R] Dealing with parentheses within variable names

2013-02-28 Thread Jesus Munoz Serrano
Dear all I'm having some problems with a data set that has parenthesis within the variable names. A example of this kind of variable names is the following: fBodyGyroskewness()Z The case is that R is having a lot of troubles to identify the variable (probably it

[R] query labels in iplot() (or other interactive scatterplot)

2013-02-28 Thread Agustin Lobo
By Ctr-moving the cursor over a point in an iplot() scatterplot (package iplots) it is possible to check the exact x,y coordinates of a given point. Is it possible to check a text label for that point as well? (i.e., the same info that would get printed on the graphic using text(x,y, labels=v) or w

[R] How do I calculate prediction intervals for GLM, BRT and MARS models in R?

2013-02-28 Thread Christian Kampichler
I'm working across the statistical literature to find methods for calculating prediction intervals for GLM, BRT (boosted regression tree) models and MARS (multivariate adaptive regression spline) models, but unfortunately my statistical background is too weak to understand most of the stuff I re

[R] Results from clogit out of range?

2013-02-28 Thread Miss SHENG Lisha
I still don't think the exp(lp)/(1+exp(lp)) gonna work. Since this is conditional logit model, while this formula is only used in unconditional ones. By using this, one neglects the information based on stratum. Though I don't know how to solve it to. I am also working on a project on this and I

[R] Hidden information in an object

2013-02-28 Thread Rasmus Hedegaard
Hello, The dataset "cats" contain information about the heart weight ("Hwt"), body weight ("Bwt") and gender ("Sex") of a group of 144 cats. I write the following piece of code: library(MASS)attach(cats)ratio <- Hwt/Bwtmale <- ratio[Sex == "M"]female <- ratio[Sex == "F"] My question is, when

[R] Iteration through a list in R

2013-02-28 Thread Sahana Srinivasan
Hello :) I'm just starting out with R and would appreciate your help with a couple of problems I am running into. I have used Sys.glob to get a list of all filenames having a particular file extension (in my case, *.txt) I would now like to use this list in the following manner: I would like to use

Re: [R] new question

2013-02-28 Thread arun
Hi, directory<- "/home/arunksa111/data.new" #first function filelist<-function(directory,number,list1){ setwd(directory) filelist1<-dir(directory) direct<-dir(directory,pattern = paste("MSMS_",number,"PepInfo.txt",sep=""), full.names = FALSE, recursive = TRUE) list1<-lapply(direct, function(x) rea

Re: [R] Separation issue in binary response models - glm, brglm, logistf

2013-02-28 Thread Ben Bolker
Xochitl CORMON ifremer.fr> writes: > Le 28/02/2013 17:22, Ben Bolker a écrit : > > Xochitl CORMON ifremer.fr> writes: > >> I am encountering some issues with my data and need some help. I am > >> trying to run glm analysis with a presence/absence variable as > >> response variable and several ex

Re: [R] How to plot 2 continous variables on double y-axis with 2 factors: ggplot2, gplot, lattice, sciplot?

2013-02-28 Thread John Kane
It is not at all clear to me exactly what you want but ggplot2 does not allow double-y graphs. However does this suggest anything useful? http://grokbase.com/t/r/r-help/104yxg1q38/r-plotting-multiple-cis John Kane Kingston ON Canada > -Original Message- > From: a...@ecology.su.se > Se

Re: [R] Separation issue in binary response models - glm, brglm, logistf

2013-02-28 Thread Xochitl CORMON
Le 28/02/2013 17:22, Ben Bolker a écrit : Thank you for your help ! Xochitl CORMON ifremer.fr> writes: Dear all, I am encountering some issues with my data and need some help. I am trying to run glm analysis with a presence/absence variable as response variable and several explanatory vari

Re: [R] Separation issue in binary response models - glm, brglm, logistf

2013-02-28 Thread Ben Bolker
Xochitl CORMON ifremer.fr> writes: > Dear all, > > I am encountering some issues with my data and need some help. > I am trying to run glm analysis with a presence/absence variable as > response variable and several explanatory variable (time, location, > presence/absence data, abundance data)

Re: [R] positioning of R windows

2013-02-28 Thread Duncan Murdoch
On 28/02/2013 11:00 AM, Glenn Stauffer wrote: Ahh, I should have known about the MDI and SDI options - choosing SDI lets me do what I want. Thanks. On #2, I realized that when the change directory dialog window pops up, if I resize it, R remembers the resizing so that now the entire window is vis

Re: [R] ARMA and AR in R

2013-02-28 Thread Rui Barradas
Hello, This is a statistics question, not an R one. If you want to fit an ARMA model, your time series can have any values, zero, negative or positive. Please revise your knowledge of time series. Hope this helps, Rui Barradas Em 28-02-2013 10:40, Nnina escreveu: Hello, I would like to comp

Re: [R] PCA with spearman and kendall correlations

2013-02-28 Thread David L Carlson
Spearman would be easier since you just convert the data to ranks and use the Pearson correlation: > set.seed(42) > x <- data.frame(matrix(sample(1:9, 20, replace=TRUE), 10, 2)) > x X1 X2 1 9 5 2 9 7 3 3 9 4 8 3 5 6 5 6 5 9 7 7 9 8 2 2 9 6 5 10 7 6 > cor(x)

Re: [R] best ordination method for binary variables

2013-02-28 Thread David L Carlson
It is always useful to look at the data in multiple ways. The unique() function will remove the duplicates in your data so that isoMDS will work: > set.seed(42) > x <- matrix(sample(0:1, 20, replace=TRUE), 10, 2) > x [,1] [,2] [1,]10 [2,]11 [3,]01 [4,]10

Re: [R] Negative Binomial Regression - glm.nb

2013-02-28 Thread Ben Bolker
Martin Spindler gmx.de> writes: > > Dear all, > > I would like to ask, if there is a way to make the > variance / dispersion parameter $\theta$ (referring to > MASS, 4th edition, p. 206) in the function glm.nb dependent on the > data, e.g. $1/ \theta = exp(x \beta)$ and > to estimate the param

Re: [R] positioning of R windows

2013-02-28 Thread Gabor Grothendieck
On Wed, Feb 27, 2013 at 5:33 PM, Glenn Stauffer wrote: > I have 2 (related, I think) questions about positioning of windows within R. > > 1. I often work with a second monitor and sometimes like to arrange 1 > or more plot windows on the second monitor, while keeping the console on the > pri

[R] put strip below the panel (dotplot)

2013-02-28 Thread Elaine Kuo
Hello I am using lattice dotplot and I would like to put the strip under the panel. I found the code “strip” is for the strip above the panel, and “strip.left” for the strip left to the panel. Please kindly advise how to write the code for the strip under the panel Thank you Elaine

Re: [R] Debugging (was Re: HELP!!!)

2013-02-28 Thread Duncan Murdoch
On 13-02-28 4:20 AM, Patrick Connolly wrote: On Fri, 22-Feb-2013 at 02:23PM -0500, jim holtman wrote: |> Run with: |> |> options(error=utils::recover) |> |> Then at the point of the error you will be able to examine sigma2$id |> which is probably not a numeric. Any time you get an error like th

Re: [R] help for an R automated procedures

2013-02-28 Thread PIKAL Petr
Hi exactly what is fortune("surgery") about. Anyway, you can save yourself a lot headache, if you start using lists for your objects. Lists can be used easily in cycles. for (i in 1:n) { some.list[i] <- some.function(some.other.list[i]) } and also lapply/sapply functions can be useful sap

[R] ARMA and AR in R

2013-02-28 Thread Nnina
Hello, I would like to compute ARMA and AR using arima-function in R. My question is: If I have Null=zero values in my data, what should I do? Remove ? or doesn't matter for ARIMA-models and I can estimate my coefficients including zero values in data in arima-function in R ? What is the better

[R] help for an R automated procedures

2013-02-28 Thread Gustavo Vieira
Dear, I would like to post the following question to the r-help on Nabble (thanks in advance for the attention, Gustavo Vieira): Hi there. I have a data set on hands with 5,220 cases and I'd like to automate some procedures (but I have almost no programming knowledge). The data has some continuou

[R] PCA with spearman and kendall correlations

2013-02-28 Thread BOURGADE Eric
Hello, I would like to do a PCA with dudi.pca or PCA, but also with the use of Spearman or Kendall correlations Is it possible ? Otherwise, how can I do, according to you ? Thanking you in advance Eric Bourgade RTE France [[alternative HTML version deleted]] __

Re: [R] sys.frame() and variables from parent frame

2013-02-28 Thread José Miguel Delgado
On 02/27/2013 07:30 PM, David Winsemius wrote: > On Feb 27, 2013, at 10:16 AM, Bert Gunter wrote: > >> Some additional comments inline below to add to David's >> clarifications, proffered largely in response to the poster's remark >> about coming to R from another language. >> >> On Wed, Feb 27, 2

[R] Debugging (was Re: HELP!!!)

2013-02-28 Thread Patrick Connolly
On Fri, 22-Feb-2013 at 02:23PM -0500, jim holtman wrote: |> Run with: |> |> options(error=utils::recover) |> |> Then at the point of the error you will be able to examine sigma2$id |> which is probably not a numeric. Any time you get an error like this, |> if you have been using the above state

Re: [R] lattice xyplot point labelling

2013-02-28 Thread maxbre
hi duncan, thanks a lot for your help! yes, your solution is working fine with a little tweaking of the vector "poscec" : but on the other hand it's just affecting the relative position of labels around respective points; to get more flexibility would be probably better to supply (even if I do