Re: [R] Divide matrix columns by different numbers

2013-05-01 Thread Pascal Oettli
Hi, ?sweep Regards, Pascal On 05/02/2013 03:28 PM, Sachinthaka Abeywardana wrote: Hi all, I have a feeling the most efficient way to do the following is to use apply, but I'm still wrapping my head around the function. k=matrix(1:6,nrow=3) div=1:2 Questions is how do I get R to divide th

Re: [R] Divide matrix columns by different numbers

2013-05-01 Thread Berend Hasselman
On 02-05-2013, at 08:28, Sachinthaka Abeywardana wrote: > Hi all, > > I have a feeling the most efficient way to do the following is to use > apply, but I'm still wrapping my head around the function. > > k=matrix(1:6,nrow=3) > > div=1:2 > > > Questions is how do I get R to divide the firs

[R] R issue with unequal large data frames with multiple columns

2013-05-01 Thread Adeel Amin
I'm a bit of an amateur R programmer. I can do simple R scenarios but my handle on complex grammatical issues isn't steady. I have 12 CSV files that I've read into dataframes. Each has 8 columns and over 200 rows. Each dataframe has data associated by time component and a date component in

[R] Divide matrix columns by different numbers

2013-05-01 Thread Sachinthaka Abeywardana
Hi all, I have a feeling the most efficient way to do the following is to use apply, but I'm still wrapping my head around the function. k=matrix(1:6,nrow=3) div=1:2 Questions is how do I get R to divide the first column by 1 (div[1]) and the second column by 2 (div[2]) k/div treats k as a ve

Re: [R] vegan -varpart is bigger than 100% in total?

2013-05-01 Thread Jari Oksanen
Ozgul Inceoglu ulb.ac.be> writes: > > I am trying to find the percentage of the parameters explaining the bacterial community composition. I > have one data matrix with relative abundance of OTUs and one with environmental parameters. I used > varpart in vegan package but the values in the venn

Re: [R] Lattice xyplot multipanels

2013-05-01 Thread Santosh
Thanks for all tips/suggestions.. Just a few more comments.. The same code I use with a different data set in another project does not create those curly braces! Regards, Santosh On Wed, May 1, 2013 at 8:16 PM, Santosh wrote: > Sorry about the word "brackets".. Yes, I meant curly braces! I h

Re: [R] rda variance partioning in vegan problems

2013-05-01 Thread Jari Oksanen
Thomas, Thomas Parr maine.edu> writes: > > My question is related to partitioning the variance in rda (vegan) results > for multiple groups of variables. I have a high dimensional dataset with > 79 explanatory variables and 9 response variables. Within those 79 > explanatory variables there

Re: [R] rpy2 postgres qgis problem

2013-05-01 Thread Enzo Cocca
Thanks Michael! I solved using the form Pyper example: def on_calcola_pressed (self): # bottone per calcoli statistici from pyper import * r = R() r('library(RPostgreSQL)') r('drv <- dbDriver("PostgreSQL")') r('con <- dbConnect(drv, host="127.0.0.1", dbname="pyarchinit", port="5432"

Re: [R] Lattice xyplot multipanels

2013-05-01 Thread Duncan Mackay
Hi Santosh Try this : q <- data.frame(G=rep(paste("G",1:3,sep=""),each=50), D=rep(paste("D",1:5,sep=""),each=30), a=rep(1:15,each=10),t=rep(seq(10),15), b=round(runif(150,10,20))) q$grp <- paste(q$D,q$a,sep=":") q$grp <- ordered(q$grp, levels=unique(q$grp)) q$dc

[R] R CMD building SPEEDY

2013-05-01 Thread ren_az
Hello every one: I get following warning when building my R package with R-3.0.0. building 'SPEEDY.tar.gz' Warning in utils::tar(filepath, pkgname, compression = "gzip", compression_level = 9L, : number of items to replace is not a multiple of replacement length thanks Michael I have no idea

Re: [R] Lattice xyplot multipanels

2013-05-01 Thread David Winsemius
On May 1, 2013, at 8:16 PM, Santosh wrote: > Sorry about the word "brackets".. Yes, I meant curly braces! I have not > heard of "curley braces"! :). Curly braces surrounding the values of > "strip.levels" appear on the strip of multipanel plots. Not in my running of your code. > Thanks, >

Re: [R] rda variance partioning in vegan problems

2013-05-01 Thread David Winsemius
On May 1, 2013, at 8:37 PM, Thomas Parr wrote: > This is not a request for coding help so there is no reproducible code, So this is a general statistical problem? Perhaps you should try: CrossValidated.com > > rather I am trying to figure out if anyone had had a similar experience. > > My q

[R] Problems with reading data by readWorksheetFromFile of XLConnect Package

2013-05-01 Thread jpm miao
Hi, Attached are two datasheet to be read. My raw data "130502temp.xlsx" contains numbers with ' symbols, and they can't be read as numbers. Even if I copy and paste as numbers to form a new file "130502temp_number1.xlsx", they could not be read smoothly. 1. How can I read the datasheet

[R] rda variance partioning in vegan problems

2013-05-01 Thread Thomas Parr
This is not a request for coding help so there is no reproducible code, rather I am trying to figure out if anyone had had a similar experience. My question is related to partitioning the variance in rda (vegan) results for multiple groups of variables. I have a high dimensional dataset with 79

Re: [R] Lattice xyplot multipanels

2013-05-01 Thread Santosh
Sorry about the word "brackets".. Yes, I meant curly braces! I have not heard of "curley braces"! :). Curly braces surrounding the values of "strip.levels" appear on the strip of multipanel plots. Thanks, Santosh On Wed, May 1, 2013 at 7:44 PM, David Winsemius wrote: > > On May 1, 2013, at 6:

Re: [R] R Function to extract columnNames

2013-05-01 Thread arun
HI, I am not sure what is wrong in your side.  I cut and paste the same code and I get this: library(plyr) set.seed(25)  mydf<- data.frame(subid=rep(1:5,each=3),Col=sample(c(0:5,NA),15,replace=TRUE))  retsample <- function(df, Column,size) {  set.seed(1234)  mysel <- ddply(df, .(subid),function(

Re: [R] Combine multiple tables into one

2013-05-01 Thread arun
#or library(magic)  adiag(table1,table2) #rownames are preserved # [,1] [,2] [,3] [,4] #row1    1    1    0    0 #row2    1    2    0    0 #row3    0    0    0    1 #row4    0    0    0    4 A.K. - Original Message - From: Dennis Murphy To: David Winsemius Cc: arun ; R help Sent: W

Re: [R] Tiff plot Resolution issues

2013-05-01 Thread Ranjan Maitra
Actually, quite a few journals do ask for .tiff (or, often, also .eps) only (as part of their webpage instructions) but my experience has been that many take .pdf without a lot of fuss. The OP could try and see if pdf will fly. If not, then (s)he can go for TIFF images. If this is at the journal

Re: [R] Combine multiple tables into one

2013-05-01 Thread Dennis Murphy
Isn't this just a block diagonal matrix? library(pracma) blkdiag(table1, table2) [,1] [,2] [,3] [,4] [1,]1100 [2,]1200 [3,]0001 [4,]0004 Dennis On Wed, May 1, 2013 at 5:41 PM, David Winsemius wrote: > add2blocks <- function(m

Re: [R] Lattice xyplot multipanels

2013-05-01 Thread David Winsemius
On May 1, 2013, at 6:16 PM, Santosh wrote: > Derar Rxperts, > I have a strange situation.. I see curly brackets Wait right here. What do you mean by "brackets"? In some locales, such as mine, that might mean "[" ; in other domains... well, who knows? I don't see any "[". The Urban Legends N

Re: [R] help understanding hierarchical clustering

2013-05-01 Thread epi
Hi David, thank yuou so much for helping me! Il giorno 01/mag/2013, alle ore 10:16, David Carlson ha scritto: > You need to clarify what you are trying to achieve and fix some errors in > your code. First, thanks for giving us reproducible data. > i tried to fix the errors , thanks for you

Re: [R] R Function to extract columnNames

2013-05-01 Thread arun
Hi, If you are using Rstudio, please check this link (http://support.rstudio.org/help/discussions/problems/850-ddply-misbehaving-in-rstudio-and-only-in-rstudio). A.K. - Original Message - From: arun To: R help Cc: David Winsemius Sent: Wednesday, May 1, 2013 9:49 PM Subject: Re: R

[R] Lattice xyplot multipanels

2013-05-01 Thread Santosh
Derar Rxperts, I have a strange situation.. I see curly brackets around "strip.levels" in multipanel strips while using lattice::xyplot. .How do I get rid of the curly brackets? For some reason, I am not able to reproduce the problem using an example below... Any suggestions are highly welcome! Tha

Re: [R] Combine multiple tables into one

2013-05-01 Thread David Winsemius
add2blocks <- function(m1, m2) { res <- cbind(m1, matrix(0, dim(m2)[1], dim(m2)[2]) ) res <- rbind(res, cbind( matrix(0, dim(m1)[1], dim(m1)[2]), m2) ) } new <- add2block(table1, table2) new #--- [,1] [,2] [,3] [,4] row11100 row212

Re: [R] Chron format question h:m not working

2013-05-01 Thread Gabor Grothendieck
On Wed, May 1, 2013 at 12:28 PM, Stephen Sefick wrote: > R 2.12.2 on Scientific Linux 6.4 > > #works > chron(times.="15:00:00", format=c(times="h:m:s")) > > #doesn't work > chron(times.="15:00", format=c(times="h:m")) > > From chron Manual: > The times format can be any permutation of "h", "m", an

Re: [R] Factors and Multinomial Logistic Regression

2013-05-01 Thread peter dalgaard
On May 1, 2013, at 22:40 , Lorenzo Isella wrote: > >> >> (A) The example doesn't run for me. library(ares) is not available on >> current R versions, but even where it is available, it doesn't provide a >> multinom() function? > > > Apologies, ares is not needed at all. Please find the corr

Re: [R] Factors and Multinomial Logistic Regression

2013-05-01 Thread William Dunlap
Look at the output of str(mydata) 'data.frame': 200 obs. of 11 variables: $ id : num 70 121 86 141 172 113 50 11 84 48 ... $ female : Factor w/ 2 levels "male","female": 1 2 1 1 1 1 1 1 1 1 ... $ race : Factor w/ 4 levels "hispanic","asian",..: 4 4 4 4 4 4 3 1 4 3 ... $

Re: [R] Tiff plot Resolution issues

2013-05-01 Thread Robert Baer
On 5/1/2013 2:49 PM, Frank Harrell wrote: > Why do you need TIFF? I've never seen a science journal that claims they > want TIFF figure submissions who are really serious about that. This is a > very wasteful format. Most journals want PDF. > Frank > There are likely many, but a quick Google is

Re: [R] Multiple Paired T test from large Data Set with multiple pairs

2013-05-01 Thread arun
Hi, Assuming that your dataset is similar to the one below: set.seed(25) dat1<- data.frame(Algae.Mass=sample(40:50,10,replace=TRUE),Seagrass.Mass=sample(30:70,10,replace=TRUE),Terrestrial.Mass=sample(80:100,10,replace=TRUE),Other.Mass=sample(40:60,10,replace=TRUE),Site.X.Treatment=rep(c("ALA1A","A

Re: [R] Could not find function boss.set

2013-05-01 Thread David Winsemius
On May 1, 2013, at 1:41 PM, David Winsemius wrote: > > On May 1, 2013, at 12:31 PM, Pramod Anugu wrote: > >> We are using boss package function in R and getting the below error message. >> Please advice >> >> Error: could not find function "boss.set" > > Try searching the R-FAQ for "could not

Re: [R] Selecting several columns/rows of a dataframe?

2013-05-01 Thread Joel Prokopchuk
Thanks everyone. I had looked in the documentation (just in the wrong places,apparently) and googled, but I couldn't find this. 2013/5/1 Rui Barradas : > Hello, > > Try > > corpus.df[, c("mph", "mgl", "eng")] > > > Hope this helps, > > Rui Barradas > > Em 01-05-2013 21:04, Joel Prokopchuk escreveu

Re: [R] Selecting several columns/rows of a dataframe?

2013-05-01 Thread qinstat
try tb[c('name1','name3'), c('col1','col5')] Hong Qin Sent from my iPad On May 1, 2013, at 4:04 PM, Joel Prokopchuk wrote: > Sorry, the use of rows/columns I found so far was rather > contradictive, both refering to what can be gotten via subset() > instead of what I'm looking for. > Is there

Re: [R] Selecting several columns/rows of a dataframe?

2013-05-01 Thread Bert Gunter
Unless I have misinterpreted, your query indicates that you have made no attempt to learn how R works. Try reading (relevant sections of) "An Introduction to R" or other online R tutorials. ?"[" provides a terse but complete answer to your question, I believe. -- Bert On Wed, May 1, 2013 at 1:0

Re: [R] Could not find function boss.set

2013-05-01 Thread David Winsemius
On May 1, 2013, at 12:31 PM, Pramod Anugu wrote: > We are using boss package function in R and getting the below error message. > Please advice > > Error: could not find function "boss.set" Try searching the R-FAQ for "could not find function". -- David Winsemius Alameda, CA, USA __

Re: [R] Selecting several columns/rows of a dataframe?

2013-05-01 Thread Sarah Goslee
Hi Joel, I have no idea what you actually want, since there's no context in your email, but you should probably see: ?"[" for information on how to subset a data frame by rows and/or columns using either numerical indices or names (if appropriate for the object). Sarah On Wed, May 1, 2013 at 4:0

Re: [R] Tiff plot Resolution issues

2013-05-01 Thread Frank Harrell
Why do you need TIFF? I've never seen a science journal that claims they want TIFF figure submissions who are really serious about that. This is a very wasteful format. Most journals want PDF. Frank Aldo wrote > I am trying to create a high resolution tiff. It is not working. > > I am on Windo

Re: [R] Combine multiple tables into one

2013-05-01 Thread arun
Hi, May be this helps: dat1<- as.data.frame(table1)  dat2<- as.data.frame(table2) names(dat2)<-c("V3","V4") library(plyr) res<-join(dat1,dat2,type="full")  res[is.na(res)]<- 0  res #  V1 V2 V3 V4 #1  1  1  0  0 #2  1  2  0  0 #3  0  0  0  1 #4  0  0  0  4  combinedtable<-as.matrix(res)  colnames(

[R] Could not find function boss.set

2013-05-01 Thread Pramod Anugu
We are using boss package function in R and getting the below error message. Please advice Error: could not find function "boss.set" [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/list

Re: [R] Selecting several columns/rows of a dataframe?

2013-05-01 Thread Rui Barradas
Hello, Try corpus.df[, c("mph", "mgl", "eng")] Hope this helps, Rui Barradas Em 01-05-2013 21:04, Joel Prokopchuk escreveu: Sorry, the use of rows/columns I found so far was rather contradictive, both refering to what can be gotten via subset() instead of what I'm looking for. Is there a wa

Re: [R] Hello

2013-05-01 Thread Rui Barradas
Hello, To compute the difference between two date/time objects use the minus operator. See ?difftime ?`-.POSIXt` Hope this helps, Rui Barradas Em 01-05-2013 16:58, Eric Mintah escreveu: Dear sir/madam, I used as.Date,strptime, POXIct, and POXIlt functions to work o

[R] Hello

2013-05-01 Thread Eric Mintah
Dear sir/madam,   I used as.Date,strptime, POXIct, and POXIlt functions to work on my data in R. Please, I would like to know the function to find the difference between the dates and times in two different columns  and make a new column for that. Thank you [[alterna

Re: [R] help understanding hierarchical clustering

2013-05-01 Thread epi
Hi David, thank yuou so much for helping me! Il giorno 01/mag/2013, alle ore 10:16, David Carlson ha scritto: > You need to clarify what you are trying to achieve and fix some errors in > your code. First, thanks for giving us reproducible data. > i tried to fix the errors and uploaded a ne

[R] Selecting several columns/rows of a dataframe?

2013-05-01 Thread Joel Prokopchuk
Sorry, the use of rows/columns I found so far was rather contradictive, both refering to what can be gotten via subset() instead of what I'm looking for. Is there a way to get multiple colums/rows? Something like corpus.df${mph,mgl,eng} Thanks in advance for any answers. -- Joel Prokopchuk ___

Re: [R] R Function to extract columnNames

2013-05-01 Thread arun
Hi ST, You could try this: library(plyr) set.seed(25) mydf<- data.frame(subid=rep(1:5,each=3),Col=sample(c(0:5,NA),15,replace=TRUE)) retsample <- function(df, Column,size) { set.seed(1234) mysel <- ddply(df, .(subid),function(x) summarize(x,missing=sum(is.na(x[[Column]])|x[[Column]]==0))) myids<-

[R] Tiff plot Resolution issues

2013-05-01 Thread Michael Clawson
I am trying to create a high resolution tiff. It is not working. I am on Windows XP 32-bit R 3.0.0 Code input: tiff(file="test.tiff",width=6.83,height=6.83,units="in", res=1200) Return Message: Error in tiff(file = "test.tiff", width = 6.83, height = 6.83, units = "in", : unable to start tif

Re: [R] still about biplot for principal componens analysis

2013-05-01 Thread capricy gao
Hi, Jim, Thank you very much for your email.   Could you please explain more about the modification about how to adding this "pch=1,cex=0.2" to the following command line? biplot(pca2,xlabs=rep(".",19000)) The R document seems to only take text input, whereas "pch=1,cex=0.2" are actually graph

Re: [R] Adding Column to Data Frames Using a Loop

2013-05-01 Thread arun
Hi, You could use: library(plyr) for(i in letters[24:26]) assign(i,mutate(get(i),V4=V2+V3))  x  # V1 V2 V3 V4 #1  1  2  3  5 #2  1  2  3  5 #3  1  2  2  4 #4  1  2  2  4 #5  1  1  1  2  y #  V1 V2 V3 V4 #1  1  2  3  5 #2  1  2  3  5 #3  1  2  2  4 #4  1  2  2  4 #5  1  1  1  2 A.K. >Dear R Help

[R] Size of a refClass instance

2013-05-01 Thread David Kulp
I'm using refClass for a complex multi-directional tree structure with possibly 100,000s of nodes. The refClass design is very impressive and I'd love to use it, but I've found that the size of refClass instances are very large and creation time is slow. For example, below is a RefClass and no

Re: [R] Chron format question h:m not working

2013-05-01 Thread David Winsemius
On May 1, 2013, at 10:55 AM, Stephen Sefick wrote: > Thanks for the quick replies. I have this working with a similar > suggestion to what arun suggests. I am just interested in why the option > to use just h:m isn't supported. > > #re: Jeff > chron(dates.="2009/05/01", times.="15:00:00", form

Re: [R] Chron format question h:m not working

2013-05-01 Thread Stephen Sefick
Sorry everybody. Permutation not selection is the key thing here. My fault. What date time formats are suggested? kindest regards, Stephen On 05/01/2013 01:21 PM, Enrico Schumann wrote: On Wed, 01 May 2013, stephen sefick writes: Thanks for the quick replies. I have this working with a

Re: [R] Chron format question h:m not working

2013-05-01 Thread Enrico Schumann
On Wed, 01 May 2013, stephen sefick writes: > Thanks for the quick replies. I have this working with a similar > suggestion to what arun suggests. I am just interested in why the option > to use just h:m isn't supported. > > #re: Jeff > chron(dates.="2009/05/01", times.="15:00:00", format=c(dat

Re: [R] Chron format question h:m not working

2013-05-01 Thread William Dunlap
This behavior is a property of the chron package, not R. The help file does say the format should include a permutation of h, m, and s, not a selection of them. Look at the code chron and you will see several places where is it assumed that the formats and time strings have exactly three parts.

Re: [R] Chron format question h:m not working

2013-05-01 Thread arun
HI Stephen, I am using R 3.0.0.   The responses in an old thread (http://r.789695.n4.nabble.com/times-td3016621.html), suggests  some solutions, but not the one you are looking for. A.K.  sessionInfo() R version 3.0.0 (2013-04-03) Platform: x86_64-unknown-linux-gnu (64-bit) locale:  [1] LC_

Re: [R] rpy2 postgres qgis problem

2013-05-01 Thread R. Michael Weylandt
On Wed, May 1, 2013 at 3:05 PM, Enzo Cocca wrote: > Hello every body, > I am using rpy2_2.0.8 with postgres and Qgis. > The code that I wrote is the following: > > def on_calcola_pressed (self): > # bottone per calcoli statistici > import rpy2 > imp

Re: [R] Adding Column to Data Frames Using a Loop

2013-05-01 Thread William Dunlap
> I am trying to do calculations on multiple data frames and do not want to > create a list of them to go through each one. I know that lists have many > wonderful advantages, but I believe the better thing is to work df by df > for my particular situation. Can you give some details about why y

[R] rpy2 postgres qgis problem

2013-05-01 Thread Enzo Cocca
Hello every body, I am using rpy2_2.0.8 with postgres and Qgis. The code that I wrote is the following: def on_calcola_pressed (self): # bottone per calcoli statistici import rpy2 import rpy2.robjects as robjects import rpy2.robjects

Re: [R] Chron format question h:m not working

2013-05-01 Thread stephen sefick
Thanks for the quick replies. I have this working with a similar suggestion to what arun suggests. I am just interested in why the option to use just h:m isn't supported. #re: Jeff chron(dates.="2009/05/01", times.="15:00:00", format=c(dates=c("y/m/d"), times="h:m:s")) chron(dates.="2009/05/01",

Re: [R] Chron format question h:m not working

2013-05-01 Thread arun
HI, One possible way would be to use paste() chron(times.=paste0("15:00",":00"),format=c(times="h:m:s")) #[1] 15:00:00 #or you could use library(lubridate) hm("15:00") #[1] "15H 0M 0S" A.K. - Original Message - From: Stephen Sefick To: "r-help@r-project.org" Cc: Sent: Wednesday, M

Re: [R] Chron format question h:m not working

2013-05-01 Thread Jeff Newmiller
A less-than-ancient version of R? The documentation does not say the dates. argument is optional. --- Jeff NewmillerThe . . Go Live... DCN:Basics: ##.#. ##.#. Live Go..

[R] Adding Column to Data Frames Using a Loop

2013-05-01 Thread Sparks, John James
Dear R Helpers, I am trying to do calculations on multiple data frames and do not want to create a list of them to go through each one. I know that lists have many wonderful advantages, but I believe the better thing is to work df by df for my particular situation. For background, I have already

[R] Likelihood ratio test for comparing non-nested cox models

2013-05-01 Thread Hans-Ulrich Klein
Dear All, I fitted two non-nested proportional hazards models using the coxph() function from package survival. Now, I would like to apply a model selection test like, e.g., the likelihood ratio test proposed by Vuong. I found an implementation of Vuong's test in the package 'pscl', but that

[R] Chron format question h:m not working

2013-05-01 Thread Stephen Sefick
R 2.12.2 on Scientific Linux 6.4 #works chron(times.="15:00:00", format=c(times="h:m:s")) #doesn't work chron(times.="15:00", format=c(times="h:m")) From chron Manual: The times format can be any permutation of "h", "m", and "s" separated by any one non-special character. The default is "h:m:s

Re: [R] functional data object

2013-05-01 Thread John Kane
If you are asking R-help readers to do your thesis work the answer is probably no. If you are asking for specific advice on how to carry out some R operations we need moer information and some idea of what you have already done in R : http://stackoverflow.com/questions/5963269/how-to-make-a-grea

Re: [R] help understanding hierarchical clustering

2013-05-01 Thread David Carlson
You need to clarify what you are trying to achieve and fix some errors in your code. First, thanks for giving us reproducible data. Once you have read the file, you seem to be attempting to remove cases with missing values, but you check for missing values of "count" twice and you never check "de

[R] Sum objects in a column between an interval defined by conditions on another column

2013-05-01 Thread Adriana Pitea
This comes as an application to this question: http://stackoverflow.com/questions/5896648/sum-object-in-a-column-between-an-interval-defined-by-another-column/5897695#comment23166107_5897695 What I would like to know is how to adjust the answer if I want to sum the values in B, for ((A[i+1]-A[i]==

Re: [R] selecting rows based on multiple criteria

2013-05-01 Thread Enrico R. Crema
Cool! Thanks! Enrico On 1 May 2013, at 14:09, arun wrote: > match(interaction(choice),interaction(coord)) [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read th

Re: [R] selecting rows based on multiple criteria

2013-05-01 Thread arun
You could also use: which(apply(coord,1,paste,collapse="")%in%apply(choice,1,paste,collapse="")) #[1]  2 11 12 #or which(sapply(seq_len(nrow(coord)),function(i) any(duplicated(rbind(coord[i,],choice) #[1]  2 11 12 #or  coord$Newcol1<- TRUE  choice$Newcol2<- TRUE  which(!is.na(merge(coord,ch

Re: [R] selecting rows based on multiple criteria

2013-05-01 Thread arun
 match(interaction(choice),interaction(coord)) #[1]  2 11 12 A.K. - Original Message - From: Enrico R. Crema To: r-help@r-project.org Cc: Sent: Wednesday, May 1, 2013 7:54 AM Subject: [R] selecting rows based on multiple criteria Dear List, I am struggling with the following problem

[R] How to standardize the generalized hyperbolic distribution?

2013-05-01 Thread Hans Karl
Hi, I want to fit a standardized generalized hyperbolic distribution to my data. I am aware, that I can do this with the dsgh command of the fBasics package along with the optim command. My problem is, that I also want to have a derivation of it. So I need the theory behind it, i.e. I need the

[R] Standardized Generalized Hyperbolic Distribution

2013-05-01 Thread Peter Buribon
Hi, I want to fit standardized generalized hyperbolic distribution to my data. I am aware, that I can do this with the dsgh command of the fBasics package along with the optim command. My problem is, that I also want to have a derivation of it. So I need the theory behind it, i.e. I need the for

Re: [R] grep help (character ommission)

2013-05-01 Thread arun
HI, You could also do: vec1<- c("Intensity","Intensity L", "Intensity H", "Intensity Rep1") identical(setdiff(seq_along(vec1),grep("H|L",vec1)),as.integer(c(1,4))) #[1] TRUE A.K. - Original Message - From: Johannes Graumann To: r-h...@stat.math.ethz.ch Cc: Sent: Wednesday, May 1, 2013

[R] selecting rows based on multiple criteria

2013-05-01 Thread Enrico R. Crema
Dear List, I am struggling with the following problem. Suppose I have the following data.frame: coord<-expand.grid(x=1:10,y=1:10) and I want to extract the row numbers of those matching the criteria defined by the following data.frame: choice<-data.frame(x=c(2,1,2),y=c(1,2,2)) the result s

Re: [R] task percentage completion

2013-05-01 Thread R. Michael Weylandt
On Wed, May 1, 2013 at 12:19 PM, Fabio Berzaghi wrote: > so in other words there is no easy way of doing this? That's not what I said. It's easy to make a progress bar if you use plyr:e.g., ddply(baseball, .(id), mutate, career_year = year - min(year) + 1, .progress = "time") Our cautions were

Re: [R] grep help (character ommission)

2013-05-01 Thread Rui Barradas
Hello, The following pattern seems to do it. grep("^Intensity$|^Intensity\\s[^HL]", c("Intensity","Intensity L", "Intensity H", "Intensity Rep1")) Hope this helps, Rui Barradas Em 01-05-2013 09:37, Johannes Graumann escreveu: Hello, Banging my head against a wall here ... can anyone li

Re: [R] grep help (character ommission)

2013-05-01 Thread jim holtman
try this: > identical( + grep( + "^Intensity *[HL]", + c("Intensity","Intensity L", "Intensity H", "Intensity Rep1"), + invert = TRUE), + as.integer(c(1,4))) [1] TRUE > On Wed, May 1, 2013 at 4:37 AM, Johannes Graumann wrote: > Hello, > > Banging my head against a wall here ...

Re: [R] task percentage completion

2013-05-01 Thread Fabio Berzaghi
so in other words there is no easy way of doing this? I don't want to spend too much time figure out how this progress bar works. I am not clear if the code should run in the main R or where. On 4/30/2013 13:11, R. Michael Weylandt wrote: On Tue, Apr 30, 2013 at 10:40 AM, Fabio Berzaghi wrote:

Re: [R] still about biplot for principal componens analysis

2013-05-01 Thread Jim Lemon
On 05/01/2013 02:46 AM, capricy gao wrote: I noticed that the points on the biplot are not exactly the same as the predicted values. Could any body give me a hint about why? Hi capricy, If you mean the points that would result from the suggestion I sent yesterday, it is probably because usi

[R] Thornthwaite Method in R

2013-05-01 Thread Anup khanal
Hi,Has anybody worked with thornthwaite method to calculate the daily evapotranspiration ? I have used the following code to calculate monthly evaporation but what I need is daily evapotranspiration. Epot <- thornthwaite(Tave, lat, na.rm = FALSE) # Evaluates evapotranspiration for each month. D

[R] grep help (character ommission)

2013-05-01 Thread Johannes Graumann
Hello, Banging my head against a wall here ... can anyone light the way to a pattern modification that would make the following TRUE? identical( grep( "^Intensity\\s[^HL]", c("Intensity","Intensity L", "Intensity H", "Intensity Rep1")), as.integer(c(1,4))) Thank you for your time.

Re: [R] significantly different from one (not zero) using lm

2013-05-01 Thread Achim Zeileis
On Wed, 1 May 2013, Elaine Kuo wrote: Hello, I am work with a linear regression model: y=ax+b with the function of lm. y= observed migration distance of butterflies x= predicted migration distance of butterflies Usually the result will show if the linear term a is significantly different

Re: [R] Trouble with methods() after loading gdata package.

2013-05-01 Thread Achim Zeileis
On Tue, 30 Apr 2013, Paul Johnson wrote: Greetings to r-help land. I've run into some program crashes and I've traced them back to methods() behavior after the package gdata is loaded. I provide now a minimal re-producible example. This seems bugish to me. How about you? dat <- data.frame(