[R] stiff delay differential equations

2012-12-05 Thread Suzen, Mehmet
Hello List, Can you recommend me if odeSolve can handle stiff delay differential equations with discontinuities? Or any other package? Best, -m __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] list to matrix?

2012-12-05 Thread R. Michael Weylandt
On Wed, Dec 5, 2012 at 12:02 AM, arun wrote: > Hi, > > > p <- lapply(1:1e6, function(i)c(i, log2(i))) > > system.time(z1 <- t(sapply(p,function(x)x))) > # user system elapsed > # 2.568 0.048 2.619 > system.time(z1 <- do.call(rbind,p)) > # user system elapsed > # 4.000 0.052 4.06

Re: [R] How do I get internal nodes of dendograms produced by R?

2012-12-05 Thread Milan Bouchet-Valat
Le mardi 04 décembre 2012 à 16:17 -0500, sagnik ray choudhury a écrit : > I am using R for hierarchical clustering of a number of documents. > > I have a distance matrix on which I have applied hclust method. When I plot > the result of hclust method, I can see the dendogram plotted. What I need >

[R] Global variable in the C code used to create R extension

2012-12-05 Thread Vineeth Mohan
Hi , I am writing a function in C and i wish to call it from R. Thanks to this tutorial , this is easily possible - http://www.nceas.ucsb.edu/scicomp/usecases/CreateRPackageWithC Now , i have a server written in R which listens on a port for requests and process the requests. Now what i need is

[R] Problem in summary of var results

2012-12-05 Thread Akhil dua
Hello I am running var on dataset data1 is the name of my dataset cn.chf us.chf 2005-07-01 -1.18656633 -1.18656633 2005-07-04 -0.48835920 -0.48835920 2005-07-05 -0.01534272 -0.01534272 2005-07-06 0.08825279 0.08825279 2005-07-07 0.34223563 0.34223563 2005-07-08 -0.0577622

[R] request

2012-12-05 Thread Rubel Das
Dear Dr. bernhard cc. r-help Thank you very much for deverlopping rneos package. I read the document of rneos. however, due to my inability, i could not figure-out how to connect with neos server from R environment. let me explain the steps, i took. my laptop is using wireless of my laboratory. t

[R] Réponse automatique

2012-12-05 Thread j . boutet
Bonjour, Je serais en congés jusqu'au Jeudi 6 Décembre. Pour des raisons d'urgence, vous pourrez me contacter par téléphone au 06 46 34 81 03. Cordialement, -- Jérôme Boutet Conservatoire d'espaces naturels de Picardie 1, place Ginkgo - village Oasis 80 044 AMIEN

[R] Trim

2012-12-05 Thread Vasilchenko Aleksander
Hello, I have a dataframe 1 2006-11 NaN 2 2006-12 NaN 3 2006-10 0.1577647 4 2006-11 NaN 5 2006-12 NaN 6 2007-01 NaN 7 2007-02 NaN 8 2007-03 0.2956429 9 2007-01 NaN 10 2007-02 NaN I need to trim first and last NaN rows Result - 1 2006-10 0.1577647 2 2

[R] how to assign factor level into each value

2012-12-05 Thread Tammy Ma
HI, All I met the following problem. I dont know how to handle it. Country Price 1 CN 44.25 2 CN 21.07 3 CN 92.70 4 CN 47.41 5 CN

Re: [R] how to assign factor level into each value

2012-12-05 Thread Jorge I Velez
Hi Tammy, Check ?cut and its examples. HTH, Jorge.- On Wed, Dec 5, 2012 at 11:26 PM, Tammy Ma <> wrote: > > HI, All > > I met the following problem. I dont know how to handle it. > > Country Price > 1 CN 44.25 > 2 CN

[R] alternative to leaps command

2012-12-05 Thread eliza botto
Dear UseRs, I wanted to know that i have been using "leaps" for the proper models selection for my work. I read so many articles from internet which categorically outlined that "leaps" command for model selection should never be used as its not efficient. Moreover, as a matter of fact, i pers

Re: [R] Trim

2012-12-05 Thread Rui Barradas
Hello, Try the following. dat <- structure(list(V1 = structure(c(2L, 3L, 1L, 2L, 3L, 4L, 5L, 6L, 4L, 5L), .Label = c("2006-10", "2006-11", "2006-12", "2007-01", "2007-02", "2007-03"), class = "factor"), V2 = c(NaN, NaN, 0.1577647, NaN, NaN, NaN, NaN, 0.2956429, NaN, NaN)), .Names = c("V1", "V2"

[R] What is "print print print" ?

2012-12-05 Thread Vladimir eremeev
Hi all. What is "print print print"? I don't see output of the print command in for loop and have found this link: http://stackoverflow.com/questions/1816200/chisq-test-doesnt-print-results-when-in-a-loop It describes a problem, similar to mine. My problem. I want to execute print command in fo

[R] catching errors in RNetCDF

2012-12-05 Thread Jannis
Dear R community, I quite frequently run into errors while using the RNetCDF package which do not seem to be recognised as normal R errors and, hence, do not stop the execution of the code making it hard to debug the code. Consider, for example: library(RNetCDF) con <- create.nc('test.nc')

Re: [R] Trim

2012-12-05 Thread arun
Hi, May be this helps: dat1<-read.table(text=" 1 2006-11  NaN 2 2006-12  NaN 3 2006-10 0.1577647 4 2006-11  NaN 5 2006-12  NaN 6 2007-01  NaN 7 2007-02  NaN 8 2007-03 0.2956429 9 2007-01  NaN 10 2007-02  NaN ",sep="",header=FALSE,stringsAsFactors=FALSE) res<-dat1[seq

[R] Makehelpneeded:No rule to make target `w'. Stop

2012-12-05 Thread Revathi Ramanadham
Hello, I am Trying to Build a project, Makefile written so that outer make file calls the inner Makefiles to Build, I am invoking the Makefile as gmake depend at the perent directory of project (Makefile here digs in and executes inner Makefiles to build the project) .DEFAULT: @for su

Re: [R] Trim

2012-12-05 Thread arun
Hi, I guess with only one rev() should also work:  idx<-cumsum(!is.na(dat$V2))*rev(cumsum(!is.na(dat$V2)))!=0  dat[idx,] #   V1    V2 #3 2006-10 0.1577647 #4 2006-11   NaN #5 2006-12   NaN #6 2007-01   NaN #7 2007-02   NaN #8 2007-03 0.2956429 A.K. - Original Message

Re: [R] Trim

2012-12-05 Thread Berend Hasselman
On 05-12-2012, at 11:46, Vasilchenko Aleksander wrote: > Hello, > I have a dataframe > > 1 2006-11 NaN > 2 2006-12 NaN > 3 2006-10 0.1577647 > 4 2006-11 NaN > 5 2006-12 NaN > 6 2007-01 NaN > 7 2007-02 NaN > 8 2007-03 0.2956429 > 9 2007-01 NaN > 10 2007-0

[R] [R-pkgs] glm2 version 1.1

2012-12-05 Thread Ian Marschner
glm2 (1.1) is now available on CRAN. glm2 fits generalized linear models using the same model specification as glm, but with a modified fitting method that is more stable for models that may fail to converge using glm (see: R Journal 3/2, 2011, pp.12-15). The previous version of glm2 had to be ar

[R] [R-pkgs] AQ-R 0.2 // realtime messaging.

2012-12-05 Thread Ulrich Staudinger
Hi there, I am glad to announce AQ-R 0.2 has been successfully built and is available via install.packages("aqr", repos="http://R-Forge.R-project.org";). The most important new feature is real-time messaging from within R. AQ-R 0.2 enables you to send and receive byte[] messages within R thr

Re: [R] alternative to leaps command

2012-12-05 Thread Bert Gunter
One correction, one comment, one suggestion: On Wed, Dec 5, 2012 at 4:44 AM, eliza botto wrote: > > Dear UseRs, > > I wanted to know that i have been using "leaps" for the proper models > selection for my work. I read so many articles from internet which > categorically outlined that "leaps" com

[R] MBA with FP Growth

2012-12-05 Thread Libardo López Guzmán
Somebody knows about a MBA (Market Basket Analysis) implementation using FP-Growth and Arules in R?. I'm no programmer, instead I am a user of this application and given the computational cost of the APRIORI algorithm, this does not work well with big Datasets like what you find in the real world.

Re: [R] Help for a function

2012-12-05 Thread Rui Barradas
Hello, Also, t1 and min(xt) do not vary inside the loop so if it enters the loop it never exits. And res1[j] <-(a*h) res2 <-sum( res1[j]) is equivalent to res2 <- a*h so the inner-most loop is not needed at all. Hope this helps, Rui Barradas Em 05-12-2012 04:20, Jim Lemon escr

Re: [R] Help for a function

2012-12-05 Thread teko maurice
Thanks you all   Maurice TEKO   Biostatisticien,Doctorant. Université de Liège Département des Sciences et Gestion de l'environnement 185 avenue de Longwy 6700 Arlon (Belgique) Mail :teko_maur...@yahoo.fr :anoumou.tekoahate...@ulg.ac.be  http://www.ulg.ac.be   ___

Re: [R] Help for a function

2012-12-05 Thread teko maurice
Rui , I discover all this when running and rerunning my function one and thousand times and per line. Now it's perfect, and work so well. Thanks. À : Rui Barradas ; Jim Lemon Cc : "r-help@r-project.org" Envoyé le : Mercredi 5 décembre 2012 16h45 Objet : R

[R] Reminder: useR! 2013 call for tutorials

2012-12-05 Thread Virgilio Gómez-Rubio
Dear all, This is a reminder that the deadline for submitting a tutorial proposal for the useR! 2013 conference is December 15, 2012. See details below. Best wishes, Virgilio --- We are pleased to announce that the R user conference useR! 2013 is scheduled for July 10-12, 2013, and will

[R] Incidence Matrix of Experimental Design Using R language Program

2012-12-05 Thread Zaheer Abbas
Hi I am working on educational assignment to produce an *Incidence matrix *from a *BIB design *using R language software. I found a web page *http://wiki.math.yorku.ca/index.php/R:_Incidence_matrix * about the problem. But it produces Data matrix instead of Incidence matrix. can you please help me

[R] How can I unsubscrie to this R forum¿?

2012-12-05 Thread Sébastien Morant
Hi, even though the help and the community was a greta plus and a very welcome experience, I wanted to know I can I exit it? thanks for you support. BR [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.c

[R] Using multcomp::glht() with Anova object

2012-12-05 Thread Stephen Politzer-Ahles
Hello everyone, I've conducted a Type III repeated-measures ANOVA using Anova() from the car package, based on the suggestions at http://blog.gribblelab.org/2009/03/09/repeated-measures-anova-using-r/(option 3) and http://languagescience.umd.edu/wiki/EEG#ERP_ANOVA_in_R. My ANOVA has two factors: C

Re: [R] How can I unsubscrie to this R forum¿?

2012-12-05 Thread Jeff Newmiller
Follow the link in the footer of any message from the list to the web page that lets you modify your list subscription. --- Jeff NewmillerThe . . Go Live... DCN:Basics: ##.#.

Re: [R] reformatting some data

2012-12-05 Thread David Winsemius
On Dec 4, 2012, at 1:44 PM, arun wrote: Hi, You can also do this: dat1<-structure(list(group = c(4L, 3L, 4L, 4L, 4L, 2L), X3.Hydroxybutyrate = c(4e-04, 5e-04, 4e-04, 6e-04, 5e-04, 7e-04), X3.Hydroxyisovalerate = c(3e-04, 3e-04, 3e-04, 3e-04, 3e-04, 4e-04), ADP = c(5e-04, 6e-04, 6e-04, 5e

Re: [R] Using multcomp::glht() with Anova object

2012-12-05 Thread John Fox
Dear Steve, Usually the best place to look for information about functions in the car package, along with the help files for the package, is the book with which the package is associated. In this case, there's an on-line appendix to the book on multivariate linear models which describes how to

Re: [R] Using multcomp::glht() with Anova object

2012-12-05 Thread Stephen Politzer-Ahles
Thank you John, I'll take a look at that! Best, Steve On Wed, Dec 5, 2012 at 11:39 AM, John Fox wrote: > > Dear Steve, > > Usually the best place to look for information about functions in the car > package, along with the help files for the package, is the book with which > the package is asso

Re: [R] Import multiple data frames and combine them using "cbind"

2012-12-05 Thread David Winsemius
On Dec 4, 2012, at 8:56 PM, Gyanendra Pokharel wrote: Thanks Dennis, Your code also produces same as Jim's but I am not looking that one, I need to use "cbind" so that finally I will get the data frame of size 200X320 (i,e, 200 X(16X20)). Thanks Here we are a day later and your question

Re: [R] What is "print print print" ?

2012-12-05 Thread David Winsemius
On Dec 5, 2012, at 5:03 AM, Vladimir eremeev wrote: Hi all. What is "print print print"? I don't see output of the print command in for loop and have found this link: http://stackoverflow.com/questions/1816200/chisq-test-doesnt-print-results-when-in-a-loop It describes a problem, similar

[R] data manipulation between vector and matrix

2012-12-05 Thread C W
Dear list, I was curious how to subtract a vector from matrix? Say, I have mat <- matrix(1:40, nrow=20, ncol=2) x <-c(1,2) I want, x-mat[1,] and x-mat[2,], and so on... Basically, subtract column elements of x against column elements in mat. But x-mat won't do it. Thanks, Mike [[al

Re: [R] How can I unsubscrie to this R forum¿?

2012-12-05 Thread David Winsemius
On Dec 5, 2012, at 8:33 AM, Sébastien Morant wrote: Hi, even though the help and the community was a greta plus and a very welcome experience, I wanted to know I can I exit it? thanks for you support. The same place you signed up ... and the link is at the bottom of every posting to Rhe

Re: [R] Import multiple data frames and combine them using "cbind"

2012-12-05 Thread Gyanendra Pokharel
I am sorry David, I don't mean to give the answer of the impossible questions. Just you can say impossible. If there is no way to do what I explained, that's fine, we do have other alternatives what I wrote in the beginning. Thank you so much. On Wed, Dec 5, 2012 at 1:12 PM, David Winsemius wro

Re: [R] data manipulation between vector and matrix

2012-12-05 Thread C W
The only solution I found was x-t(mu) Is there a better way? Mike On Wed, Dec 5, 2012 at 1:30 PM, C W wrote: > Dear list, > I was curious how to subtract a vector from matrix? > > Say, I have > > mat <- matrix(1:40, nrow=20, ncol=2) > > x <-c(1,2) > > I want, > > x-mat[1,] and x-mat[2,], and so

Re: [R] data manipulation between vector and matrix

2012-12-05 Thread Sarah Goslee
Hi, On Wed, Dec 5, 2012 at 1:30 PM, C W wrote: > Dear list, > I was curious how to subtract a vector from matrix? > > Say, I have > > mat <- matrix(1:40, nrow=20, ncol=2) > > x <-c(1,2) Thanks for the actual reproducible example. > I want, > > x-mat[1,] and x-mat[2,], and so on... Basically, su

Re: [R] Import multiple data frames and combine them using "cbind"

2012-12-05 Thread David Winsemius
On Dec 5, 2012, at 10:36 AM, Gyanendra Pokharel wrote: > I am sorry David, I don't mean to give the answer of the impossible > questions. Just you can say impossible. If there is no way to do > what I explained, that's fine, we do have other alternatives what I > wrote in the beginning. >

Re: [R] data manipulation between vector and matrix

2012-12-05 Thread C W
Thanks, Sarah. First time heard about sweep(), it worked just the way I wanted. Mike On Wed, Dec 5, 2012 at 1:42 PM, Sarah Goslee wrote: > Hi, > > On Wed, Dec 5, 2012 at 1:30 PM, C W wrote: > > Dear list, > > I was curious how to subtract a vector from matrix? > > > > Say, I have > > > > mat <

Re: [R] Import multiple data frames and combine them using "cbind"

2012-12-05 Thread Berend Hasselman
On 05-12-2012, at 03:37, Gyanendra Pokharel wrote: > Hi group, > > I imported 16 data frames using the function "list.files" > > temp <- list.files(path="...") > myfiles = lapply(temp, read.table,sep = "") > > Now I have 16 data set imported in R window. > > I want to combine them by

Re: [R] Import multiple data frames and combine them using "cbind"

2012-12-05 Thread Gyanendra Pokharel
Thanks Berend, your Idea is great, that,s what I was looking. Thanks again On Wed, Dec 5, 2012 at 2:06 PM, Berend Hasselman wrote: > do.call(cbind,lapply(mydf, function(df) df[,1:2])) [[alternative HTML version deleted]] __ R-help@r-project.

Re: [R] fitting a gamma frailty model (coxph)

2012-12-05 Thread Terry Therneau
I looked at your data: > table(x, cluster) 1 2 3 4 5 6 0 0 48 0 48 48 0 1 48 0 48 0 0 48 Your covariate "x" is perfectly predicted by the cluster variable. If you fit a fixed effects model: coxph(Surv(time, event) ~ factor(cluster) +x) then the "x" variable is declared redu

[R] loading & using Ryacas

2012-12-05 Thread Alicia Ellis
I'm having trouble loading Ryacas. I've downloaded and extracted Ryacas 0.2-9 (also tried Ryacas ) and yacas 1.0.63, have the latest version of R and have tried the following (this works for installing other packages): install.packages("Ryacas") library(Ryacas) install.packages("yacas") library(y

[R] Changing data frame column headings

2012-12-05 Thread Rich Shepard
I have a reshaped data frame with value column headings concatenated from two column headings in the melted data frame. I want to change all 56 headings in a single command, but 'names' allows me to change only one at a time. In Hadley's 2007 article on reshape in the Journal of Statistical Soft

Re: [R] Changing data frame column headings

2012-12-05 Thread R. Michael Weylandt
x <- data.frame(a = 1:5, b = rnorm(5)) names(x) <- LETTERS[2:1] print(x) seems to work. Can you be more explicit about your problem? Michael On Wed, Dec 5, 2012 at 6:51 PM, Rich Shepard wrote: > I have a reshaped data frame with value column headings concatenated from > two column headings

[R] In factor analysis in the psych package, how can I work out which factors the columns in $scores relate to? How do I know what each of the scores is scoring?

2012-12-05 Thread Brent Caldwell
Hi I have used fa() to perform a factor analysis of a psychological battery which is thought to have 11 factors. I can identify which factors the loadings relate to easily enough because I can see which items are loading onto each of the columns in the $loading output. However, how can I ident

Re: [R] loading & using Ryacas

2012-12-05 Thread David Winsemius
On Dec 5, 2012, at 10:21 AM, Alicia Ellis wrote: I'm having trouble loading Ryacas. I've downloaded and extracted Ryacas 0.2-9 (also tried Ryacas ) and yacas 1.0.63, have the latest version of R and have tried the following (this works for installing other packages): install.packages("R

Re: [R] Changing data frame column headings

2012-12-05 Thread arun
Hi, I am not sure why ?rename() is not working.  a <- list(a = 1, b = 2, c = 3)      rename(a, c(b = "a", c = "b", a="c")) A.K. - Original Message - From: Rich Shepard To: r-help@r-project.org Cc: Sent: Wednesday, December 5, 2012 1:51 PM Subject: [R] Changing data frame column headi

[R] duplicated() with long vectors

2012-12-05 Thread Stephen Politzer-Ahles
Hello, duplicated() does not seem to work for a long vector. For example, if you download the data from https://docs.google.com/open?id=0B6-m45Jvl3ZmNmpaSlJWMXo5bmc (a vector with about 12,000 numbers) and then run the following code which does duplicated() over the whole vector but just shows the

Re: [R] duplicated() with long vectors

2012-12-05 Thread Sarah Goslee
Hi, duplicated() doesn't just look at consecutive values, but anywhere in the object. Since your 12320-element vector has only 48 separate values, and all of them occur before the last 30 elements, so duplicated() returns TRUE. You might be looking for something involving rle(). What are you tryi

Re: [R] data manipulation between vector and matrix

2012-12-05 Thread C W
thanks, I knew about apply, but did not you you can put plus signs with quotes. That's a cool tricky, Mike On Wed, Dec 5, 2012 at 4:05 PM, arun wrote: > HI, > In addition to ?sweep(), you can use > > apply(-mat,1,`+`,x) > > #or > library(plyr) > aaply(-mat,1,"+",x) > > > A.K. > > > > > > >

Re: [R] how to assign factor level into each value

2012-12-05 Thread jim holtman
?cut > x <- read.table(text = " Country Price + 1 CN 44.25 + 2 CN 21.07 + 3 CN 92.70 + 4 CN 47.41 + 5 CN111.67 + 6 CN

Re: [R] Changing data frame column headings

2012-12-05 Thread Rich Shepard
On Wed, 5 Dec 2012, R. Michael Weylandt wrote: Can you be more explicit about your problem? Michael, Data frame contains water chemistry data; site, date, parameter, value. The column names after dcast() are, for example, alk_quant, ph_quant, tds_quant. I wanted to remove the '_quant' from

Re: [R] Changing data frame column headings

2012-12-05 Thread Rich Shepard
On Wed, 5 Dec 2012, arun wrote: I am not sure why ?rename() is not working.  a <- list(a = 1, b = 2, c = 3)      rename(a, c(b = "a", c = "b", a="c")) I have the reshape2 library loaded and ?rename did not find the help page. Are the parentheses required in the command? Thanks, Rich _

Re: [R] In factor analysis in the psych package, how can I work out which factors the columns in $scores relate to? How do I know what each of the scores is scoring?

2012-12-05 Thread David L Carlson
Without seeing what options you have specified in your call to fa(), it is not possible to answer the question. There are detailed discussions in ?fa and ?factor.scores in the psych package, but for the final word you should probably contact the package maintainer: Package: psych Version: 1.2.8 D

Re: [R] data manipulation between vector and matrix

2012-12-05 Thread arun
HI, In addition to ?sweep(), you can use apply(-mat,1,`+`,x) #or library(plyr) aaply(-mat,1,"+",x) A.K. - Original Message - From: C W To: Sarah Goslee Cc: r-help Sent: Wednesday, December 5, 2012 1:51 PM Subject: Re: [R] data manipulation between vector and matrix Thanks, S

Re: [R] Changing data frame column headings

2012-12-05 Thread R. Michael Weylandt
On Wed, Dec 5, 2012 at 9:23 PM, Rich Shepard wrote: > On Wed, 5 Dec 2012, R. Michael Weylandt wrote: > >> Can you be more explicit about your problem? > > > Michael, > > Data frame contains water chemistry data; site, date, parameter, value. > The column names after dcast() are, for example, alk

Re: [R] data manipulation between vector and matrix

2012-12-05 Thread C W
Thanks for the benchmark. I actually wanted to go with the winner, except the x-t(mat) output is very different than the others. Mike On Wed, Dec 5, 2012 at 4:40 PM, arun wrote: > Hi, > > By comparing the different methods: > set.seed(5) > mat1<-matrix(sample(1:1e6,1e6,replace=TRUE),ncol=1

Re: [R] Changing data frame column headings

2012-12-05 Thread David L Carlson
If you check, the help files, you will find rename in reshape and plyr, but not reshape2. But you have never shown us the command you used with names() and what didn't work: > a <- data.frame(alk_quant=rnorm(5, 5), ph_quant= rnorm(5, 5), + tds_quant=rnorm(5, 5)) > a alk_quant ph_quant tds_q

Re: [R] Changing data frame column headings

2012-12-05 Thread Rich Shepard
On Wed, 5 Dec 2012, arun wrote: You can get ?rename() by either loading library(reshape) or library(plyr). A.K. I wondered about that, but assumed that reshape functions would also be found in reshape2. I now know that's not the case. :-) Much appreciated, Rich __

Re: [R] stiff delay differential equations

2012-12-05 Thread Ben Bolker
Suzen, Mehmet gmail.com> writes: > > Hello List, > > Can you recommend me if odeSolve can handle stiff delay differential equations > with discontinuities? Or any other package? > Best, > -m > > I don't know, but I think you're probably best off trying it out for yourself and seeing how i

Re: [R] duplicated() with long vectors

2012-12-05 Thread Stephen Politzer-Ahles
Hi Sarah, Thanks a lot for your explanation. I was mistakenly under the impression that duplicated() only looked at immediately preceding element, not all preceding elements. What I was trying to do was get a vector saying, for each item, whether that item is the same as the preceding item. Now t

Re: [R] duplicated() with long vectors

2012-12-05 Thread Sarah Goslee
> What I was trying to do was get a vector saying, for each item, > whether that item is the same as the preceding item. Now that I think > of it, I could do this easily by copying the vector, shifting it over > one (by removing the first element and adding something to the end), > and then just co

Re: [R] Changing data frame column headings

2012-12-05 Thread Rich Shepard
On Wed, 5 Dec 2012, David L Carlson wrote: names(a) <- gsub("_quant", "", names(a)) a David, I did not pick that up from the names() help page. Thanks for the insight. Rich __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listin

Re: [R] error reading xlsm file with read.xls

2012-12-05 Thread David Winsemius
On Dec 4, 2012, at 10:05 AM, Sebastian Kruk wrote: > Dear all, > > I cannot reading a .xlsm file using read.xls. > That doesn't surprise me. It's a macro format. Why should R be reading Excel macros? > I executed: > > read.xls("resultados.xlsm", > colNames = TRUE, > sheet = 1, > type = "da

Re: [R] duplicated() with long vectors

2012-12-05 Thread Prof Brian Ripley
On 05/12/2012 21:08, Sarah Goslee wrote: Hi, duplicated() doesn't just look at consecutive values, but anywhere in the object. Since your 12320-element vector has only 48 separate values, and all of them occur before the last 30 elements, so duplicated() returns TRUE. You might be looking for s

Re: [R] How to reset R settings to original state other than remove .Rdata and .Rhistory

2012-12-05 Thread Greg Snow
Read the ?Startup page, it documents the files that are read on startup and how to skip them, it may suggest another way to start a fresh session without deleting files to see if that works for you, it also gives other files or sources that you may investigate to find the differences in the 2 machi

Re: [R] duplicated() with long vectors

2012-12-05 Thread Stephen Politzer-Ahles
Sorry, that's my mistake, I should not have said 'long vector'; mine is just a normal vector. I'm not actually using a development version. Best, Steve On Wed, Dec 5, 2012 at 4:22 PM, Prof Brian Ripley wrote: > > > And BTW, 'long vector' is a technical term in R: not 12,000, but more than 2 > bi

Re: [R] stiff delay differential equations

2012-12-05 Thread Thomas Petzoldt
On 12/5/2012 9:15 AM, Suzen, Mehmet wrote: Hello List, Can you recommend me if odeSolve can handle stiff delay differential equations with discontinuities? Or any other package? Best, -m Package deSolve (the successor of odesolve) can candle: - stiff differential equations: yes (solvers: lso

Re: [R] What is "print print print" ?

2012-12-05 Thread Jim Lemon
On 12/06/2012 12:03 AM, Vladimir eremeev wrote: Hi all. What is "print print print"? I don't see output of the print command in for loop and have found this link: http://stackoverflow.com/questions/1816200/chisq-test-doesnt-print-results-when-in-a-loop It describes a problem, similar to mine.

Re: [R] error reading xlsm file with read.xls

2012-12-05 Thread David Winsemius
On Dec 5, 2012, at 2:19 PM, David Winsemius wrote: > > On Dec 4, 2012, at 10:05 AM, Sebastian Kruk wrote: > >> Dear all, >> >> I cannot reading a .xlsm file using read.xls. >> > > That doesn't surprise me. It's a macro format. Why should R be reading Excel > macros? > > >> I executed: >>

Re: [R] In factor analysis in the psych package, how can I work out which factors the columns in $scores relate to? How do I know what each of the scores is scoring?

2012-12-05 Thread Brent Caldwell
Dear Prof Carlson Thank you very much. As far as I can tell, factor.scores requires an object from class grm, itm, rason, or tpm; which I think are part of the irt package with which I am unfamiliar. I had used the psych package to do the following factor analysis: fa.11factors.rawdata <- fa(WIS

Re: [R] In factor analysis in the psych package, how can I work out which factors the columns in $scores relate to? How do I know what each of the scores is scoring?

2012-12-05 Thread David L Carlson
I think you are safe in assuming that the first factor is used to compute the first factor score column. The factor.scores() procedure is used by fa() to compute the factor scores so it provides details regarding how they are computed beyond the information in the fa() help page. As I understand

Re: [R] catching errors in RNetCDF

2012-12-05 Thread Pascal Oettli
Hi, When I try your example, I simply get an error: > library(RNetCDF) > con <- create.nc('test.nc') > test <- try(var.get.nc(con, 'dummy')) Error : NetCDF: Variable not found Regards, Pascal Le 05/12/2012 22:08, Jannis a écrit : Dear R community, I quite frequently run into errors while u

[R] Assignment of values with different indexes

2012-12-05 Thread Brian Feeny
I would like to take the values of observations and map them to a new index. I am not sure how to accomplish this. The result would look like so: x[1,2,3,4,5,6,7,8,9,10] becomes y[2,4,6,8,10,12,14,16,18,20] The "newindex" would not necessarily be this sequence, but a sequence I have stored i

Re: [R] Assignment of values with different indexes

2012-12-05 Thread Pascal Oettli
Hello, I am sorry, but I sincerely don't understand what you are trying to do. Regards, Pascal Le 06/12/2012 11:47, Brian Feeny a écrit : I would like to take the values of observations and map them to a new index. I am not sure how to accomplish this. The result would look like so: x[1,2

Re: [R] Assignment of values with different indexes

2012-12-05 Thread David Winsemius
On Dec 5, 2012, at 6:47 PM, Brian Feeny wrote: I would like to take the values of observations and map them to a new index. I am not sure how to accomplish this. The result would look like so: x[1,2,3,4,5,6,7,8,9,10] becomes y[2,4,6,8,10,12,14,16,18,20] This suggests to me that you a

Re: [R] Line numbers with errors and warnings?

2012-12-05 Thread Worik R
If you `source("test.R", keep.source=FALSE)`, you will see that the > line number is not reported. > > Not always. I have code that uses sapply to call another function and all I get back is the line of the sapply. Useful but in the 21st century I do think I could get more aid from the runtime an

Re: [R] Line numbers with errors and warnings?

2012-12-05 Thread Steve Lianoglou
Hi, On Thu, Dec 6, 2012 at 12:01 AM, Worik R wrote: > > >> If you `source("test.R", keep.source=FALSE)`, you will see that the >> line number is not reported. >> > > Not always. > > I have code that uses sapply to call another function and all I get back is > the line of the sapply. The function

Re: [R] Assignment of values with different indexes

2012-12-05 Thread Brian Feeny
No, because it does not assign the indexes of myindex. If its not possible, which I am assuming its not, thats OK. I thought that if I had say 10 observations, sequentially ordered (or any order, it doesn't matter), and I wanted to assign them specific indexes, and not have NA's, that it was

Re: [R] Line numbers with errors and warnings?

2012-12-05 Thread Worik R
Bert R is compiled. Compile and go cycle is quick, but it is compiled. Not to a machine executable but to an object the R runtinme can interperet. Steve It is all a bit hard. I can make progress the old fashioned way with debug messages and conditional execution and dozens of other techniques

Re: [R] Changing data frame column headings

2012-12-05 Thread arun
Hi Rich, You can get ?rename() by either loading library(reshape) or library(plyr). A.K. - Original Message - From: Rich Shepard To: R help Cc: Sent: Wednesday, December 5, 2012 4:24 PM Subject: Re: [R] Changing data frame column headings On Wed, 5 Dec 2012, arun wrote: > I am not

Re: [R] data manipulation between vector and matrix

2012-12-05 Thread arun
Hi, By comparing the different methods: set.seed(5)  mat1<-matrix(sample(1:1e6,1e6,replace=TRUE),ncol=1)  set.seed(25)  x<-sample(1:1e6,1,replace=TRUE)  system.time(z1<-sweep(-mat1,2,x,"+")) #   user  system elapsed  # 0.076   0.000   0.069  system.time(z2<-apply(-mat1,1,`+`,x))  #  user

Re: [R] request

2012-12-05 Thread Rubel Das
Dear Dr. Bernhard Thank you very much for quick reply. One good news is that i can connect with Neos server. I appreciate your suggestion to change 'protocols' to 'proxy'. after assigning proxy, i can connect with my desired website. Thankyou very much With best regards Rubel On Thu, Dec 6, 2012

[R] bootstrap based confidence band

2012-12-05 Thread Rebecca
I'm trying to find a bootstrap based confidence band for a linear model. I have created a data set with X and Y X=runif(n,-1.25,1.25) e=rnorm(n,0,1) Y=exp(3*X)+5*sin((30*X)/(2*pi))+2*e fit=lm(Y~X) summary(fit)   I define a bootstrap function named PairedBootstrap which is not listed here. Than I t

Re: [R] Changing data frame column headings

2012-12-05 Thread arun
Hi, This could be done using ?gsub() set.seed(5) dat1<-data.frame(alk_quant=sample(1:15,6,replace=TRUE),ph_quant=sample(5:9,6,replace=TRUE),tds_quant=sample(10:20,6,replace=TRUE))  names(dat1)<-gsub("(.*)\\_.*","\\1",names(dat1))  head(dat1,2) #  alk ph tds #1   4  7  13 #2  11  9  16 A.K.

Re: [R] data manipulation between vector and matrix

2012-12-05 Thread arun
HI, The option z5 takes care of it. z5<-t(x-t(mat)) #still faster than ?sweep()  dim(z5) [1] 20  2  identical(sweep(-mat,2,x,"+"),z5) #[1] TRUE A.K. From: C W To: arun Sent: Wednesday, December 5, 2012 5:09 PM Subject: Re: [R] data manipulation between vec

Re: [R] Assignment of values with different indexes

2012-12-05 Thread arun
Hi, Would it be okay to use:  y<-na.omit(y[myindex]<-x) y # [1] -1.36025132 -0.57529211  1.18132359  0.41038489  1.83108252 -0.03563686  #[7]  1.25267314  1.08311857  1.56973422 -0.30752939 A.K. - Original Message - From: Brian Feeny To: "r-help@r-project.org help" Cc: Sent: Wednes

[R] gamcheck doubts

2012-12-05 Thread Tania Mendo Aguilar
Dear All, I am fitting scallop count data to negative binomial GAMs. I have two significant parameters that explain 43%of the deviance. The adjusted r square is 0.25. The gam.check function gives me the figure attached. In the graph of linear predictor vs. residuals there seems to be more negat

Re: [R] nlme starting values are not the correct length

2012-12-05 Thread PIKAL Petr
Hi see inline > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Lara Reichmann > Sent: Wednesday, December 05, 2012 1:53 AM > To: r-h...@lists.r-project.org > Subject: [R] nlme starting values are not the correct length > > De

Re: [R] What is "print print print" ?

2012-12-05 Thread Vladimir eremeev
Yes, now I see. It's ridiculous that I haven't noticed this elementary error, which I know of for over 10 years. :) Now my problem, it's another question. Here is the code and data, as requested. Sample data, I've copied a part of text file: Charge Strobe [1] Charge FC [2] Charge SG

[R] Incorrect DST time changes in DateTimeClasses

2012-12-05 Thread Andrew Digby
Can anyone please shed any light on why R DateTimeClasses give weird times for when daylight saving time information changes, and which aren't consistent with the OS? Example: Expected result: in New Zealand DST stopped (NZDT -> NZST) at 03:00 NZDT on 2010-04-04, as confirmed by the O