Re: [R] Adding across columns ignoring NA

2013-07-19 Thread Bert Gunter
Berend: No. The OP's "variables" appear to be vectors. sum() sums columnwise (vectorwise). Something like rowSums(cbind(var1,var2,var3,var4,var6), na.rm=TRUE) appears to be what is wanted. But of course,Jin Choi appears to need to do some homework -- e.g. by reading the Introduction to R online

Re: [R] Adding across columns ignoring NA

2013-07-19 Thread Berend Hasselman
On 20-07-2013, at 06:37, Jin Choi wrote: > I am having difficulty finding a solution to devising an R code to do the > following: > > I have 5 numerical variables and I would like to create a new variable that > is the sum of those 5 variables. However, there are many NA values > throughout the

[R] Adding across columns ignoring NA

2013-07-19 Thread Jin Choi
I am having difficulty finding a solution to devising an R code to do the following: I have 5 numerical variables and I would like to create a new variable that is the sum of those 5 variables. However, there are many NA values throughout these 5 variables and everytime I run the following code n

[R] Different x-axis scales using c() in latticeExtra

2013-07-19 Thread Jeff Stevens
Hi, I would like to combine multiple xyplots into a single, multipanel display. Using R 3.0.1 in Ubuntu, I have used c() from latticeExtra to combine three plots, but the x-axis for two plots are on a log scale and the other is on a normal scale. I also have included equispace.log=FALSE to clean

Re: [R] how to calculate the average values of each row in a matrix

2013-07-19 Thread R. Michael Weylandt
On Jul 19, 2013, at 20:19, Elaine Kuo wrote: > Hello, > > I have a matrix (class matrix) composed of GridCell (row and column). > The matrix value is the beta diversity index value between two grids. > > Now I would like to get the average value of each GridCell. > Please kindly advise how to

[R] how to calculate the average values of each row in a matrix

2013-07-19 Thread Elaine Kuo
Hello, I have a matrix (class matrix) composed of GridCell (row and column). The matrix value is the beta diversity index value between two grids. Now I would like to get the average value of each GridCell. Please kindly advise how to make the calculation. Thank you. Elaine The matrix looks lik

[R] [R-pkgs] WriteXLS Version 3.0.0 Released

2013-07-19 Thread Marc Schwartz
Hi all, Version 3.0.0 of the WriteXLS package has been released to CRAN. Source tarballs are being mirrored and binaries for Windows and OSX should appear in due course. Main CRAN URL: http://cran.r-project.org/web/packages/WriteXLS/index.html WriterXLS is a cross-platform Perl based R functio

Re: [R] Identify Leverage Points

2013-07-19 Thread Mark Leeds
see the hatvalues function in the car package. also, I highly recommend john's CAR book. there's a new edition that came out a year or so ago. On Fri, Jul 19, 2013 at 6:14 PM, Noah Silverman wrote: > Hello, > > I'm working on some fairly standard regression models (linear, logistic, > and poiss

Re: [R] S4 method signature - integer matrix

2013-07-19 Thread David Winsemius
On Jul 19, 2013, at 9:54 AM, Simon Zehnder wrote: > Dear R-Users and R-Devels, > > I am programming a package with S4 classes and I search for a solution of the > following problem: > > If you want an S4 method to await an integer argument you set the signature > like this > > setMethod("my

Re: [R] Adding List Elements To A Data Frame

2013-07-19 Thread Bert Gunter
Folks: I think it worth noting that the solutions provided by Brian and David, which look exactly the same when print()ed, are entirely different beasts. Brian's gives a column of strings; David;s gives a column of lists (a list of lists). str() will provide details. Both solutions are "correct"

Re: [R] Using text and variable in ggtitle (ggplot2)

2013-07-19 Thread Rainer Schuermann
Not sure whether I understand your question fully but I guess paste() is your friend: ggtitle( paste( "RR(overall) =", RR, "N =", N, "alpha =", alpha1 ) ) On Friday 19 July 2013 17:17:24 Manisha Brahma chary wrote: > Hello, > I am using ggplot2 to plot a graph and I want to give a title to the

[R] Identify Leverage Points

2013-07-19 Thread Noah Silverman
Hello, I'm working on some fairly standard regression models (linear, logistic, and poisson.) Unfortunately, the data is rather messy. A visual inspection, using either a histogram or a density plot indicates some significant outliers. Furthermore, summary statistics of the data indicate the

[R] Using text and variable in ggtitle (ggplot2)

2013-07-19 Thread Manisha Brahma chary
Hello, I am using ggplot2 to plot a graph and I want to give a title to the plot that has both text and variables. I have tried a couple of ways, but none of the methods work. Below is my code. Under ggtitle RR, N, alpha1 are variables and "RR(overall), "N", "alpha" are strings. Require(ggplot2

Re: [R] Adding List Elements To A Data Frame

2013-07-19 Thread Rui Barradas
Hello, If you create the 3rd column like that, it will be named V3, not z. You must do one of myDataframe$z <- I(myList) myDataframe[["z"]] <- I(myList) Rui Barradas Em 19-07-2013 22:28, David Winsemius escreveu: On Jul 19, 2013, at 12:54 PM, Pete Brecknock wrote: Hi I am trying to add

[R] help with matrix

2013-07-19 Thread Kátia Emidio
Hi, I am a beginner at R and I would like to get information from a matrix, where the numbers are larger than or equal to 50m . This means that plants need to be apart at least 50m. I need to get the selection as in a way that I can identify which pair of species are 50m or more apart. here a

Re: [R] Kruskal.test

2013-07-19 Thread arun
Hi, You could try: Chisq1<-do.call(cbind,lapply(c(0.05,0.001),function(i) {x1<-sapply(seq_len(nrow(Specc)),function(i) chisq.test(as.table(unlist(Specc[i,-c(1:3)])))$p.value); sum(x1 To: arun Sent: Friday, July 19, 2013 1:25 PM Subject: Re: Kruskal.test Thank you. But I need to construct a

Re: [R] Adding List Elements To A Data Frame

2013-07-19 Thread David Winsemius
On Jul 19, 2013, at 12:54 PM, Pete Brecknock wrote: > Hi > > I am trying to add the contents of the list "myList" to a new column "z" in > the data frame "myDataframe" > > myList <- list(c("A1","B1"), c("A2","B2","C2"), c("A3","B3")) > > myDataframe <- data.frame(x=c(1,2,3), y=c("R","S","T"))

Re: [R] help with matrix

2013-07-19 Thread Duncan Murdoch
On 19/07/2013 10:17 AM, Kátia Emidio wrote: Hi, I am a beginner at R and I would like to get information from a matrix, where the numbers are larger than or equal to 50m . This means that plants need to be apart at least 50m. I need to get the selection as in a way that I can identify which

Re: [R] Adding List Elements To A Data Frame

2013-07-19 Thread Brian Diggs
On 7/19/2013 12:54 PM, Pete Brecknock wrote: > Hi > > I am trying to add the contents of the list "myList" to a new column "z" in > the data frame "myDataframe" > > myList <- list(c("A1","B1"), c("A2","B2","C2"), c("A3","B3")) > > myDataframe <- data.frame(x=c(1,2,3), y=c("R","S","T")) > > Would li

Re: [R] Adding List Elements To A Data Frame

2013-07-19 Thread Pete Brecknock
Thanks Brian. Perfect. Brian Diggs wrote > On 7/19/2013 12:54 PM, Pete Brecknock wrote: >> Hi >> >> I am trying to add the contents of the list "myList" to a new column "z" >> in >> the data frame "myDataframe" >> >> myList <- list(c("A1","B1"), c("A2","B2","C2"), c("A3","B3")) >> >> myDataframe

[R] Adding List Elements To A Data Frame

2013-07-19 Thread Pete Brecknock
Hi I am trying to add the contents of the list "myList" to a new column "z" in the data frame "myDataframe" myList <- list(c("A1","B1"), c("A2","B2","C2"), c("A3","B3")) myDataframe <- data.frame(x=c(1,2,3), y=c("R","S","T")) Would like to produce x y z 1 R A1,B1 2 S A2,B2,C2 3 T A3,B

Re: [R] extracting variance and covariance

2013-07-19 Thread S Ellison
> -Original Message- > I am not able to 'extract variance and covariance' I'm having a little trouble extracing meaning. What data or model do you intend extracing variances and covariances from? S *** This email and any

[R] S4 method signature - integer matrix

2013-07-19 Thread Simon Zehnder
Dear R-Users and R-Devels, I am programming a package with S4 classes and I search for a solution of the following problem: If you want an S4 method to await an integer argument you set the signature like this setMethod("myfunction", signature(object = "myClass", y = "integer"), function(obj

Re: [R] Help: Error when installing R 2.8.1 in IBM AIX system from source code

2013-07-19 Thread Duncan Murdoch
On 19/07/2013 9:27 AM, De Xin Luan wrote: Hello, They can't solve the problem of R installation and direct me to contact R help. I want to follow your standard way to install R 2.8.1 in AIX 7.1 64bit system. Please guide me to install R 2.8.1. Thank you. Presumably you're paying them, so

Re: [R] construct stem and leaf plot

2013-07-19 Thread Sarah Goslee
Hi, On Fri, Jul 19, 2013 at 2:15 AM, Roslina Zakaria wrote: > Dear r-users, > > I would like to construct tem and leaf plot using iris data. It should be > easy, but I don't understand why the plot is not right. > > Thank you so much for your help. > > dat <- iris[,1] > stem(dat) The decimal p

Re: [R] Help: Error when installing R 2.8.1 in IBM AIX system from source code

2013-07-19 Thread Duncan Murdoch
On 19/07/2013 6:16 AM, De Xin Luan wrote: Hi Jeff, Thanks for your quick response. Let me describe more about my situation. 1. Patch file - Yes, I found patch didn't change any file, so I manually changed 4 files(R-2.8.1/configure, R-2.8.1/configure.ac, R-2.8.1/Makeconf.in, R-2.8.1/src/main/Mak

[R] [R-pkgs] new package 'prevalence'

2013-07-19 Thread Brecht Devleesschauwer
Dear list members, A new package, called *prevalence *(version 0.1.0), is now available on CRAN: http://cran.r-project.org/package=prevalence This package provides Frequentist and Bayesian methods useful in prevalence assessment studies. More specifically, the following functions are currently

Re: [R] question...

2013-07-19 Thread arun
Hi, dat<-read.table(text="   1 0  1  1  1  1    0  0  1  0  0  1    1  0  0  0  0  0    2  1  1  2  1  1 ",sep="",header=FALSE)  which(sapply(seq_len(nrow(dat)),function(i) wilcox.test(unlist(dat[i,]))$p.value)>0.05) #there will be warnings() though #[1] 2 3 table(sapply(seq_len(nrow(dat)),functi

[R] [R-pkgs] acs package version 1.1: download and analyze census data from the ACS

2013-07-19 Thread Ezra Haber Glenn
We are pleased to announce that version 1.1 of the acs package is now available on CRAN. The package allows users to automatically download, analyze, and present data from the U.S. Census American Community Survey. Major improvements in versions 1.0 and 1.1 include: * A single "acs.fetch()" f

Re: [R] R Help

2013-07-19 Thread PIKAL Petr
Hi It would be better if you provided either str(yourdata) or dput(yourdata) (or a part illustrating those 2 kinds of missing values) Anyway I would use NA for missing and some other identifier for empty. temp a b c 1 1 empty 2 NA filled xx 3 2 filled xx is.na(temp) a

[R] Heckit model with Robus std error fit

2013-07-19 Thread Pedro Galindo
Hi, I am currently usind R to do a heckit maxlikehood model and I was wondering if there is anyway to do it but specifying the robustness of the std error. I would like it robust. I am currently working with: heckit(selection= ,outcome= , method "ml") Is there anithing else to type into this fu

Re: [R] Help: Error when installing R 2.8.1 in IBM AIX system from source code

2013-07-19 Thread De Xin Luan
Hi Jeff, Thanks for your quick response. Let me describe more about my situation. 1. Patch file - Yes, I found patch didn't change any file, so I manually changed 4 files(R-2.8.1/configure, R-2.8.1/configure.ac, R-2.8.1/Makeconf.in, R-2.8.1/src/main/Makefile.in) by reading the patch file. 2. why

[R] R Help

2013-07-19 Thread Mª Teresa Martinez Soriano
Hi everyone, I have a dataset which I am handling with R . Unfortunately I have two kinds of empty cells, one corresponds to missing values and the other one is empty because it has to. I ‘m going to put an example (just a part of my dataset ) to try to clarify my question: missing values are r

[R] mgcv: Impose monotonicity constraint on single or more smooth terms

2013-07-19 Thread Kathrine Veie
Dear R help list, This is a long post so apologies in advance. I am estimating a model with the mgcv package, which has several covariates both linear and smooth terms. For 1 or 2 of these smooth terms, I "know" that the truth is monotonic and downward sloping. I am aware that a new package "s

Re: [R] [R-sig-eco] extract beta.sim from dist type data (package betapart)

2013-07-19 Thread Elaine Kuo
Hello Sarah, Thank you for the help very much. Please kindly advise manuals dealing with the object list (or dist). In addition, I would like to show the beta diversity index in a map. Please kindly advise any other R package in need. Elaine On Wed, Jul 17, 2013 at 10:20 PM, Sarah Goslee wrote

[R] Fwd: extracting variance and covariance

2013-07-19 Thread G Girija
hi, Please help me in calculating variance and covariance as i am getting the following error Error in lambda * S + (1 - lambda) * a : non-conformable arrays -- Forwarded message -- From: G Girija Date: Thu, Jul 18, 2013 at 10:20 PM Subject: extracting variance and covariance To