Re: [R] Using cbind to combine data frames and preserve header/names

2012-11-16 Thread Rainer Schuermann
Not sure where the problem is? Since you did not provide sample data, I took the iris data set and converted it to your structure: x <- cbind( iris[5], iris[1:3] ) head( x ) Species Sepal.Length Sepal.Width Petal.Length 1 setosa 5.1 3.5 1.4 2 setosa 4.9

[R] help with a programme

2012-11-16 Thread Haris Rhrlp
Dear R users, I have a problem i want to check some patrices and check them if they are identical when from the one i change the order of the rows (the first row goes third etc) or/and change the order of the columns or/and if i change the signs of the one or more columns  isomorphic <- funct

[R] Using cbind to combine data frames and preserve header/names

2012-11-16 Thread Brian Feeny
I have a dataframe that has a header like so: class value1 value2 value3 class is a factor the actual values in the columns value1, value2 and value3 are 0-255, I wish to binarize these using biclust. I can do this like so: binarize(dataframe[,-1]) this will return a dataframe, but then I

[R] survfit & number of variables != number of variable names

2012-11-16 Thread Georges Dupret
This works ok: > cox = coxph(surv ~ bucket*(today + accor + both) + activity, data = data) > fit = survfit(cox, newdata=data[1:100,]) but using strata leads to problems: > cox.s = coxph(surv ~ bucket*(today + accor + both) + strata(activity), > data = data) > fit.s = survfit(cox.s, newdata=data

Re: [R] how to create dispersion graphic

2012-11-16 Thread David Winsemius
On Nov 16, 2012, at 6:38 PM, Tania Patiño wrote: Hello, somebody can explain how to create dispersion graphic, because i need to put this dispersion graphics inside a matrix. The data is the next one: 2 test (mechanics and vector) open book. 3 test (algebra, analysis y statistics) closed

[R] how to create dispersion graphic

2012-11-16 Thread Tania Patiño
Hello, somebody can explain how to create dispersion graphic, because i need to put this dispersion graphics inside a matrix. The data is the next one: 2 test (mechanics and vector) open book. 3 test (algebra, analysis y statistics) closed book. Also could you explain which is the use of sco

[R] how to create a tree in R

2012-11-16 Thread Tania Patiño
Hello all, could you explain to me how to create a tree in R, and if you can explain every line of code that will be great. Which are the libraries that are needed and where I can find more examples. Thank you! Tania [[alternative HTML version deleted]]

Re: [R] Calculateing means

2012-11-16 Thread arun
Hi, If the replicated columns are adjacent to each other in the order as shown in the example, you could also try: set.seed(25) mat1<-matrix(sample(1:200,2280,replace=TRUE),ncol=570) dat1<-data.frame(Indx=1:4,mat1) #Here, I assume equal replications as mentioned in the post fun1<-function(dat,

Re: [R] Question about contour3d and writeWebGL: rgl and misc3d package

2012-11-16 Thread Duncan Murdoch
On 12-11-16 7:09 PM, John Muschelli wrote: The contour its just half a brain and the vertices are not surfaces and are filled in Sounds like a bug in the browser. When I try it in Firefox 16.0.2 it doesn't display properly; the error log (found via Tools | Web developer | Error console has s

Re: [R] Question about contour3d and writeWebGL: rgl and misc3d package

2012-11-16 Thread Duncan Murdoch
On 12-11-16 5:59 PM, John Muschelli wrote: I saw that in rgl:::writeWebGL that "Polygons will only be rendered as filled; there is no support in WebGL for wireframe or point rendering.". I found that you can easily use contour3d to make reproducible contour web figures, such as (taken from conto

Re: [R] simple linear regression with proportion data

2012-11-16 Thread SH
Very useful comment and helpful website! Many thanks to you!!! SH On Fri, Nov 16, 2012 at 5:16 PM, Ben Bolker wrote: > SH gmail.com> writes: > >> >> Dear list: >> >> Can I use simple linear regression when I have proportion data for >> both dependent and independent variables? Or, should I us

[R] tol in prcomp

2012-11-16 Thread nmend
Hi there, I was wondering if anyone could explain how you should set tol in the prcomp function. Using help(prcomp) explains it as "a value indicating the magnitude below which components should be omitted. (Components are omitted if their standard deviations are less than or equal to tol times

Re: [R] Calculateing means

2012-11-16 Thread arun
HI, May be this helps: dat1<-read.table(text=" Indx    x1    x2  x3  x4    x5  x6  x7  x8  x9  1  25  30  15  8  12  9  18  21  89  2  52  35  42  74  65  20  28  32  12  3  12  35  33 

[R] Question about contour3d and writeWebGL: rgl and misc3d package

2012-11-16 Thread John Muschelli
I saw that in rgl:::writeWebGL that "Polygons will only be rendered as filled; there is no support in WebGL for wireframe or point rendering.". I found that you can easily use contour3d to make reproducible contour web figures, such as (taken from contour3d help) library(AnalyzeFMRI) a <- f.

Re: [R] Calculateing means

2012-11-16 Thread ilai
On Fri, Nov 16, 2012 at 2:42 PM, Khan, Sohail wrote: > Thanks. But aggregate will work on rows or columns. I need to calculate > mean for subsets of rows in a matrix > I.E. > > Indx x1 x2 x3 x4 x5 x6 x7 x8 x9 > 1 25 30 15 8 12

Re: [R] Stepwise regression scope: all interacting terms (.^2)

2012-11-16 Thread Steve Lianoglou
Hi Mark, To put some context to David's response below, you can search the list archives for times when people ask about stepwise regression. You can get started here: http://search.gmane.org/search.php?group=gmane.comp.lang.r.general&query=stepwise+penalized The long and short of it is that you

Re: [R] about lm

2012-11-16 Thread Sonia Amin
ok I am sorry 2012/11/16 Hasan Diwan > Ms Amin, > > On 16 November 2012 14:06, Sonia Amin wrote: > >> I have attached the file ven.csv > > > Attachments don't come through on the mailing list. Please enclose the > first few lines in your message. -- H > -- > Sent from my mobile device > Envoyai

Re: [R] simple linear regression with proportion data

2012-11-16 Thread Ben Bolker
SH gmail.com> writes: > > Dear list: > > Can I use simple linear regression when I have proportion data for > both dependent and independent variables? Or, should I use beta > regression analysis? Or any suggestion? > The distribution of the independent variable is irrelevant (in some cir

Re: [R] dixon test

2012-11-16 Thread laut
I would like to extend Dixon's values beyond 30. I've read over Rorabacher article but didn't understand the equations well enough to convert them to Excel and then "drag" the cells out extending the n. Rorabacher,_1991.pdf Dea

Re: [R] about lm

2012-11-16 Thread Sonia Amin
Here the rest of the message: changing the storage mode of an object 'factor' is not allowed More: Message opinion: In model.response (mf, "numeric"): using type = "numeric" with a factor response type will be ignored I have attached the file ven.csv 2012/11/16 Rui Barradas > Hello, > > The

Re: [R] about lm

2012-11-16 Thread Rui Barradas
Hello, The error message is not at all clear. Have you copied and pasted it? Can you post a data example? Using ?dput, for instance. dput(head(mat, 30)) # paste the output of this in a post Rui Barradas Em 16-11-2012 21:44, Sonia Amin escreveu: Rui and Berend thank you for your help before p

[R] about lm

2012-11-16 Thread Sonia Amin
Rui and Berend thank you for your help before posting this mail, I change the name of my data and it becomes "mat" and I tried with this line: lm (ve~ su, data = mat) I got this message: Lm.fit error in (x, y, offset = offset = singular.ok singular.ok ...) [[alternative HTML version del

Re: [R] Calculateing means

2012-11-16 Thread Khan, Sohail
Thanks. But aggregate will work on rows or columns. I need to calculate mean for subsets of rows in a matrix I.E. Indx x1 x2 x3 x4 x5 x6 x7 x8 x9 1 25 30 15 8 12 9 18 21 89 2 52 35 42

Re: [R] Multiple Vector with matrix in R

2012-11-16 Thread David Winsemius
On Nov 16, 2012, at 8:34 AM, frespider wrote: > Hi > > Can someone show me an easy way to multiple a weighted vector with an > matrix? > > example below > mat1<-matrix(sample(1:100,80,replace=TRUE),ncol=8) > w <- 1/1:10 > > I want the first element in w to be multiplied by the first row of mat

Re: [R] Calculateing means

2012-11-16 Thread John Kane
?aggregate will do it. x <- data.frame( height= c(50, 174, 145, 200, 210, 140, 175), age_group=c(1,2,2,1,1,2,1), ville= c(1,2,3,1,2,3,1)) aggregate(x$height,list(x$age_group, x$ville), mean) or have a look at the plyr or datatable packages. John Kane Kingston ON Canada

[R] simple linear regression with proportion data

2012-11-16 Thread SH
Dear list: Can I use simple linear regression when I have proportion data for both dependent and independent variables? Or, should I use beta regression analysis? Or any suggestion? Thanks! SH __ R-help@r-project.org mailing list https://stat.ethz.c

[R] Calculateing means

2012-11-16 Thread Khan, Sohail
Dear List, I have a data matrix with 570 columns containing 95 (samples) with 6 replicates each. How can I calculate the mean of the replicates for 95 samples? Thank you. The information contained in this electronic e-mail transmission and any attachments are intended only for the use of the

Re: [R] Multiple Vector with matrix in R

2012-11-16 Thread arun
HI, set.seed(15) mat1<-matrix(sample(1:100,800,replace=TRUE),nrow=8000) w <- 1/1:8000 system.time(diag(w)%*%mat1) #   user  system elapsed # 54.235   0.444  54.792 system.time(sweep(mat1,MARGIN=1,w,`*`) ) #   user  system elapsed #  0.220   0.044   0.265 system.time(t(sapply(seq_alon

Re: [R] polycor package

2012-11-16 Thread John Fox
Dear Laura, As I explained to you when you wrote to me directly, you're not having trouble with the polycor package, since you have AFAICS successfully computed polychoric correlation among your variables. The error is produced when you call sem(), apparently in the lavaan package (though you d

Re: [R] How to do an infinite sum in R

2012-11-16 Thread David Winsemius
On Nov 16, 2012, at 9:30 AM, Simon Bolivar wrote: > I'm having trouble to do an infinite sum in R > > I want to do the infinite sum of 1/(1+n) > > how would I do this in R? You could try submitting this job: sum(1/(1+1:(2^31-1) ) ) # 2^31-1 being the highest integer in R at the moment After

Re: [R] Stepwise regression scope: all interacting terms (.^2)

2012-11-16 Thread David Winsemius
On Nov 16, 2012, at 12:16 PM, Mark Ebbert wrote: > I haven't heard anything on this question. Is there something fundamentally > wrong with my question? Any feedback is appreciated. > Perhaps failure to read this sig at the bottom of every posted message to rhelp? "PLEASE do read the posting

Re: [R] How to do an infinite sum in R

2012-11-16 Thread Don McKenzie
Do you (OP) mean the partial sum of an infinite series? As your question stands you don't need R. On 16-Nov-12, at 12:39 PM, Rolf Turner wrote: On 17/11/12 08:35, Albyn Jones wrote: Perhaps it would help to think before you compute. Fortune nomination! cheers, Rolf Turner

Re: [R] simple question on loop

2012-11-16 Thread Suzen, Mehmet
Use mapply instead On Fri, Nov 16, 2012 at 5:01 PM, billycorg wrote: > Hi R Users. > > I have a simple question on a loop. > > The following loop works fine: > > r_t=list() > for(i in 1:500) > { > r_t[[i]]=h_t_half[[i]]%*%matrix(*z_t_m*[i,]) > } > > But indeed I need also that *z_t_m* varies. Let

[R] strange results

2012-11-16 Thread Haris Rhrlp
Dear R users, i want to check matrices if they are identical when i change the rows or the columns or the signs of the one or more columns isomorphic <- function (m1, m2) {         combs.c <- combn(ncol(m1), 2)     nc <- ncol(combs.c)     ind.c <- vector("logical", nc)     for (i in 1:nc) {    

Re: [R] How to do an infinite sum in R

2012-11-16 Thread Rolf Turner
On 17/11/12 08:35, Albyn Jones wrote: Perhaps it would help to think before you compute. Fortune nomination! cheers, Rolf Turner albyn On Fri, Nov 16, 2012 at 09:30:32AM -0800, Simon Bolivar wrote: I'm having trouble to do an infinite sum in R I want to do the infinite sum of

Re: [R] Stepwise regression scope: all interacting terms (.^2)

2012-11-16 Thread Mark Ebbert
I haven't heard anything on this question. Is there something fundamentally wrong with my question? Any feedback is appreciated. Mark On Nov 15, 2012, at 8:13 AM, Mark T. W. Ebbert wrote: > Dear Gurus, > > Thank you in advance for your assistance. I'm trying to understand scope > better when p

Re: [R] Boxplot in R

2012-11-16 Thread Rolf Turner
On 17/11/12 09:04, Elli wrote: How to calculate the boxplots R? This question arises because we are building manually boxplots, we consulted various literature sources for calculations of the boxplot but our results differ from those generated by R, especially when calculating the whiskers. What

Re: [R] Boxplot in R

2012-11-16 Thread Marc Schwartz
On Nov 16, 2012, at 2:04 PM, Elli wrote: > How to calculate the boxplots R? This question arises because we are building > manually boxplots, we consulted various literature sources for calculations > of the boxplot but our results differ from those generated by R, especially > when calculating t

Re: [R] pairing data using combn with criteria

2012-11-16 Thread David Winsemius
On Nov 16, 2012, at 6:58 AM, bjmjarrett wrote: > Dear All, > > I have a dataframe made up of individual beetles consisting of individual > number, family number, mother's family number, father's family number, and > sex of the beetle. I would like to pair up the individuals for breeding. I > w

Re: [R] How to do an infinite sum in R

2012-11-16 Thread Jeff Newmiller
You would need an infinite amount of time and an infinite amount of numerical precision, all to arrive at the conclusion that the answer is infinite. Or you could take a short cut: ans <- Inf --- Jeff Newmiller

[R] Interpretation of davies.test() in segmented package

2012-11-16 Thread Greg Cohn
My data: I have raw data points that form a logit style curve as if they were a time series. Which is to say they form 3 distinct lines with 3 distinct slopes in backwards z pattern. A certain class of my data looks essentially flat to the eye with marginal oscillation. What is important to me is

[R] Boxplot in R

2012-11-16 Thread Elli
How to calculate the boxplots R? This question arises because we are building manually boxplots, we consulted various literature sources for calculations of the boxplot but our results differ from those generated by R, especially when calculating the whiskers. What is the procedure used by R to per

Re: [R] about lm

2012-11-16 Thread Bert Gunter
I quote Rolf Turner: "Learn something about R; don't just hammer and hope. Read the introductory manuals and scan the FAQ." The answer is that your data are in "data," but until you make a greater effort to learn R, I'm not sure this will be helpful to you. Cheers, Bert On Fri, Nov 16, 2012 a

Re: [R] about lm

2012-11-16 Thread Berend Hasselman
On 16-11-2012, at 20:42, Sonia Amin wrote: > Dear friends, > I have a csv file entitled ven.csv located in C:\\, this file contains only > two columns:"ve" and "su" I have written the following lines: > data=read.csv("c:\\ven.csv",header=TRUE,sep=";"); > > lm(ve~ su) > I have obtained the follow

Re: [R] Error in Sweave but not underlying script

2012-11-16 Thread Duncan Murdoch
On 16/11/2012 2:26 PM, Bush, Daniel P. DPI wrote: I'm trying to use Sweave to create a dynamic report of a variety of financial data checks. I have an .R code file to pull the data from a database, manipulate and filter it, and create individual data frames for each test. My Sweave .RNW docume

Re: [R] Multiple Vector with matrix in R

2012-11-16 Thread Rui Barradas
Hello, Try the following. t(sapply(seq_along(w), function(i) mat1[i,]*w[i])) Hope this helps, Rui Barradas Em 16-11-2012 16:34, frespider escreveu: Hi Can someone show me an easy way to multiple a weighted vector with an matrix? example below mat1<-matrix(sample(1:100,80,replace=TRUE),ncol=

Re: [R] about lm

2012-11-16 Thread Rui Barradas
Hello, 1. Don't call your dataset 'data', it's the name of an R function. 2. Imagine it's called 'dat'. Then you must use the lm() argument data = dat. Like this: lm(ve~ su, data = dat) Hope this helps, Rui Barradas Em 16-11-2012 19:42, Sonia Amin escreveu: Dear friends, I have a csv file

Re: [R] How to do an infinite sum in R

2012-11-16 Thread Albyn Jones
Perhaps it would help to think before you compute. albyn On Fri, Nov 16, 2012 at 09:30:32AM -0800, Simon Bolivar wrote: > I'm having trouble to do an infinite sum in R > > I want to do the infinite sum of 1/(1+n) > > how would I do this in R? > > Thank You > > > > -- > View this message in

[R] Error in Sweave but not underlying script

2012-11-16 Thread Bush, Daniel P. DPI
I'm trying to use Sweave to create a dynamic report of a variety of financial data checks. I have an .R code file to pull the data from a database, manipulate and filter it, and create individual data frames for each test. My Sweave .RNW document then calls that file with source() to generate th

[R] about lm

2012-11-16 Thread Sonia Amin
Dear friends, I have a csv file entitled ven.csv located in C:\\, this file contains only two columns:"ve" and "su" I have written the following lines: data=read.csv("c:\\ven.csv",header=TRUE,sep=";"); lm(ve~ su) I have obtained the following message: Error in eval(expr, envir, enclos) : object

Re: [R] fitting

2012-11-16 Thread Marc Girondot
Le 16/11/12 11:49, Meli Massimiliano a écrit : Hello All, i would fit my data with a function like this : y = a0 + a1 * exp(-x/a2) + a3 * exp(-x/a4) + a5 * exp(-x/a6) + a7 * exp(-x/a8) + a9 * exp(-x/a10) plus i have to impose that a1 + a3 + a5 + a7 + a9 = 1 a1 , a3 , a5 , a7 , a9 >= 0 The

[R] how to specify random effects on intercepts for mlogit?

2012-11-16 Thread Aaron(Jialun) Li
Hi, I search online and find rpar argument to specify random effect for independent variables. Is there a way to specify that for intercepts too? Thanks, Aaron Management, PhD Stanford University [[alternative HTML version deleted]] __ R-help

Re: [R] GUI Development reg

2012-11-16 Thread jverzaniNWBKZ
You can use the `gWidgets` package to do this kind of thing easily enough: require(gWidgets) my_vec <- character(0) items <- state.name ## some values handler <- function(h,...) my_vec <<- svalue(h$obj) w <- gwindow() g <- ggroup(cont=w, horizontal=FALSE) ## one way to select one or more from m

Re: [R] Multiple Vector with matrix in R

2012-11-16 Thread frespider
Hi No i didn't get error it executed too fast, I had question about the Sum squares in the weighted least square if u can help me I would I appreciated Thanks Date: Fri, 16 Nov 2012 09:46:59 -0800 From: ml-node+s789695n4649775...@n4.nabble.com To: frespi...@hotmail.com Subject: Re: Multiple

Re: [R] Multiple Vector with matrix in R

2012-11-16 Thread frespider
Hi A.K Here is the error I get when I use %*% > dim(X) [1] 71142 219 > length(Weights) [1] 71142 > Wx<-diag(Weights)%*%X Error in array(0, c(n, p)) : 'dim' specifies too large an array That is why I asked for different and faster method -- View this message in context: http://r.789695.n4.na

Re: [R] Can't get R to recognize Java for rJava installation

2012-11-16 Thread gparab
Also, remember when you use it to connect to a DB: Teradata or Orcale or MySQLmake sure you have JRE running and relevant DB jars are loaded in class path. .jclassPath() => to check class paths .jinit() => to run JRE -- View this message in context: http://r.789695.n4.nabble.com/Can-t-get-

[R] simple question on loop

2012-11-16 Thread billycorg
Hi R Users. I have a simple question on a loop. The following loop works fine: r_t=list() for(i in 1:500) { r_t[[i]]=h_t_half[[i]]%*%matrix(*z_t_m*[i,]) } But indeed I need also that *z_t_m* varies. Let us suppose that *z_t_m* has 1000 replicates, I have written the following loop that (natural

[R] Sum Column in data.frame for Excel-Export

2012-11-16 Thread Mat
Hello together, I have a data.frame, which I would like to export to excel. This works without problems. My problem is, that i can't sum one of the colums. If i try this, i get the sum of this column. > sum_PT_PROG<-sum(data_export_final_sort$PT_PROG,na.rm=TRUE) > sum_PT_PROG [1] 130 But how can

[R] How to do an infinite sum in R

2012-11-16 Thread Simon Bolivar
I'm having trouble to do an infinite sum in R I want to do the infinite sum of 1/(1+n) how would I do this in R? Thank You -- View this message in context: http://r.789695.n4.nabble.com/How-to-do-an-infinite-sum-in-R-tp4649770.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] How to retrieve data from a matrix

2012-11-16 Thread arun
HI, Try this: dat1<-read.csv("matrixGinger.csv",sep="\t") res<-apply(dat1,1,function(x) names(x)[x<0.0165]) res1<-t(sapply(res,`[`,seq(max(sapply(res,length) res2<-data.frame(id=rownames(res1),res1) dat2<-read.csv("Gingerdat.csv",sep="\t")  res3<-merge(dat2,res2,by="id",sort=FALSE))  res3[1:5,1

[R] pairing data using combn with criteria

2012-11-16 Thread bjmjarrett
Dear All, I have a dataframe made up of individual beetles consisting of individual number, family number, mother's family number, father's family number, and sex of the beetle. I would like to pair up the individuals for breeding. I would, however, like to avoid breeding beetles of the same sex

[R] polycor package

2012-11-16 Thread Laura Maria Schwirz
I am currently working with R's polycor package and I have encountered a problem. I tried to follow the steps as outlined in the sem.pdf file where a CFA model is run using polychoric correlations. Every time I run the command sem(model, data, N=.), I get the following warning message: Warning mess

Re: [R] Build without warning RSvgDevice

2012-11-16 Thread Matthieu Decorde
Thanks for the quick reply. Sorry the attached file was not sent. But you were right, it was a BOM, now the package compiles without warning :-) Matthieu Decorde On 16/11/2012 13:32, Duncan Murdoch wrote: On 12-11-16 5:14 AM, Matthieu Decorde wrote: Hi, I'm trying to build a modified versi

Re: [R] Creating dates to plot

2012-11-16 Thread arun
HI, How about this? library(zoo)  Period<-c("201206","201207","201208")  as.yearmon(Period,format="%Y%m") #[1] "Jun 2012" "Jul 2012" "Aug 2012" A.K. - Original Message - From: PtitBleu To: r-help@r-project.org Cc: Sent: Friday, November 16, 2012 2:56 AM Subject: Re: [R] Creating dates

[R] Multiple Vector with matrix in R

2012-11-16 Thread frespider
Hi Can someone show me an easy way to multiple a weighted vector with an matrix? example below mat1<-matrix(sample(1:100,80,replace=TRUE),ncol=8) w <- 1/1:10 I want the first element in w to be multiplied by the first row of mat1 and 2nd element in w to be multiplied with the 2nd row and so on.

Re: [R] System problem: Sys.time() returns GMT, says NZDT

2012-11-16 Thread Uwe Ligges
On 12.11.2012 22:35, Worik R wrote: When I say: Sys.time() [1] "2012-11-12 21:30:14 NZDT" But that is not what my clock on the wall and my system say. Cannot show you my clock but... worik@lemy:/tmp$ date Tue Nov 13 10:32:20 NZDT 2012 Sys.time() is returning GMT Confusing: Above yo

Re: [R] Deleting rows with special character

2012-11-16 Thread Marc Schwartz
On Nov 16, 2012, at 8:26 AM, Sarah Goslee wrote: > Hi Peter, > > On Fri, Nov 16, 2012 at 9:04 AM, Peter Kupfer wrote: >> Dear all, >> maybe a simple problem but I found no solution for my problem. >> I have a matrix Y with 23 000 rows and 220 colums. The entries are "A", "B" >> or "C". > > A

Re: [R] GUI Development reg

2012-11-16 Thread Ista Zahn
Hi Vijayan, I just discovered http://www.rstudio.com/shiny/ which I think would make it pretty easy to do this. Best, Ista On Thu, Nov 15, 2012 at 1:31 AM, Vijayan Padmanabhan wrote: > Dear R Group > > I have a character vector from which I want to select a few elements and > create a new chara

Re: [R] Can you have a by variable in Lag function as in SAS

2012-11-16 Thread ramoss
Thank you again all responders. Dan your solution was both easy & miraculous. -- View this message in context: http://r.789695.n4.nabble.com/Can-you-have-a-by-variable-in-Lag-function-as-in-SAS-tp4649647p4649773.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] lubridate concatenation issue

2012-11-16 Thread arun
HI, Thanks for the information. d1<-ymd_hms("2011123105") Sys.setenv(TZ="UTC") e2<-c(d1)  e2 #[1] "2011-12-31 05:00:00 UTC"  Sys.setenv(TZ="EST")  e1<-c(d1)  attr(e1,"tzone")<-"UTC"  e1 #[1] "2011-12-31 05:00:00 UTC" #Looks similar, attr(e1,"tzone") #[1] "UTC"  attr(e2,"tzone") #NULL ?c.POSIX

Re: [R] create function to solve derivative

2012-11-16 Thread Peter Ehlers
On 2012-11-16 01:30, Berend Hasselman wrote: On 16-11-2012, at 09:43, e-letter wrote: On 16/11/2012, Rolf Turner wrote: Your question makes little sense. Functions have derivatives --- at least some of them do. Data sets do not have derivatives. The functions D(), deriv() etc. work on sp

Re: [R] lubridate concatenation issue

2012-11-16 Thread Peter Ehlers
On 2012-11-16 04:39, arun wrote: HI, Sys.setenv(TZ="GMT") c(d) #[1] "2011-12-31 GMT" #or Sys.setenv(TZ="UTC") c(d) #[1] "2011-12-31 UTC" Hope it helps. A.K. Yes, but c(d) will still not have a 'tzone' attribute. So the OP is okay as long as his further operations do not depend on the pre

Re: [R] Import excel file

2012-11-16 Thread Rui Barradas
Hello, I believe it is, but see package XLConnect. The vignette is very helpfull, with lots of examples. Hope this helps, Rui Barradas Em 16-11-2012 15:27, Hervy Cyril escreveu: Hello, Is it possible to import an Excel 2000 file (32-bit version) into R 2.15.1 64-bit version? Thanks. Best

Re: [R] polynomial svms and in-sample error

2012-11-16 Thread Jessica Streicher
Actually i think i found the problem, its something about the probability model again as it seems, if you just take the normal predictions everythings good. Man does that probability stuff absolutely not work properly. Any suggestions how to do ROC curves without it? Or am i just generally wrong

Re: [R] Can't see what i did wrong..

2012-11-16 Thread Jessica Streicher
Fixed it by using e1071 instead.. On 15.11.2012, at 17:43, Jessica Streicher wrote: > Guess it has something t do with the values in prob.model. The classifiers > with bad predicitons have positive values and the ones with good predictions > have negative values. > > On 15.11.2012, at 17:18, J

[R] polynomial svms and in-sample error

2012-11-16 Thread Jessica Streicher
Hi again! This might be more of a statistical question, but anyway: If i train several support vector machines with different degrees of polynomials, and as result, get that higher degrees not only have a higher test error, but also a higher in-sample error, why is that? I would assume i shoul

[R] Import excel file

2012-11-16 Thread Hervy Cyril
Hello, Is it possible to import an Excel 2000 file (32-bit version) into R 2.15.1 64-bit version? Thanks. Best regards, Cyril Hervy [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listin

Re: [R] source file on startup question - why does an old version of a function show up? ggplot or R?

2012-11-16 Thread Stephen Sefick
Nothing like posting to the list to figure it out yourself. defined the little sourcing function in .Rprofile as the .First file. Now all is well. Sorry for clutering everyones email boxes. kind regards, Stephen Sefick On Fri 16 Nov 2012 08:52:00 AM CST, Stephen Sefick wrote: All, 1. I w

Re: [R] source file on startup question - why does an old version of a function show up? ggplot or R?

2012-11-16 Thread R. Michael Weylandt
On Fri, Nov 16, 2012 at 2:52 PM, Stephen Sefick wrote: > All, > > 1. I will try and make this clear and concise. Please let me know any > information that would be helpful in figuring out this problem (I don't know > the relevant information to post). I am on linux- see below for session > infor

Re: [R] apply calculations to elements in a vector

2012-11-16 Thread Berend Hasselman
On 16-11-2012, at 15:50, e-letter wrote: > Readers, > > If a vector consists of: > > 10 > 20 > 30 > > how to create a new vector based upon the results of calculations to > the elements, e.g. addition of successive elements, so that a new > vector would be: > > 30 > 50 > > i.e. 10+20, then 2

[R] discrete discriminant analysis

2012-11-16 Thread Catarina Maia
Hello, I am using the mda package and in particular the fda routine to classify in term of gear a set of 20 trips. I preformed a flexible discriminant analysis (FDA) using a set of 151 trips. FDAT1 <- fda(as.factor(gear) ~ . , data =matrizR) A total of 22 predictors were considered. 20 of t

Re: [R] apply calculations to elements in a vector

2012-11-16 Thread Rui Barradas
Hello, Try the following. x <- 1:3*10 idx <- seq_along(x)[-1] rowSums(cbind(x[idx], x[idx-1])) Hope this helps, Rui Barradas Em 16-11-2012 14:50, e-letter escreveu: Readers, If a vector consists of: 10 20 30 how to create a new vector based upon the results of calculations to the elements,

Re: [R] apply calculations to elements in a vector

2012-11-16 Thread D. Rizopoulos
Try this: x <- c(10, 20, 30) head(x, -1) + tail(x, -1) I hope it helps. Best, Dimitris On 11/16/2012 3:50 PM, e-letter wrote: > Readers, > > If a vector consists of: > > 10 > 20 > 30 > > how to create a new vector based upon the results of calculations to > the elements, e.g. addition of suc

[R] source file on startup question - why does an old version of a function show up? ggplot or R?

2012-11-16 Thread Stephen Sefick
All, 1. I will try and make this clear and concise. Please let me know any information that would be helpful in figuring out this problem (I don't know the relevant information to post). I am on linux- see below for session information. 2. Problem: working directory: home an old version o

[R] apply calculations to elements in a vector

2012-11-16 Thread e-letter
Readers, If a vector consists of: 10 20 30 how to create a new vector based upon the results of calculations to the elements, e.g. addition of successive elements, so that a new vector would be: 30 50 i.e. 10+20, then 20+30, etc.? __ R-help@r-projec

Re: [R] Deleting rows with special character

2012-11-16 Thread arun
HI, Not sure how your dataset looks like: If it is like this: set.seed(18) mat1<-matrix(sample(LETTERS[1:3],54,replace=TRUE),ncol=3)  mat1[apply(mat1,1,function(x) all(x=="A")),] #[1] "A" "A" "A" which(apply(mat1,1,function(x) all(x=="A")) ) #[1] 16 A.K. - Original Message - From: P

Re: [R] Deleting rows with special character

2012-11-16 Thread John Kane
thanks John Kane Kingston ON Canada > -Original Message- > From: peter.kup...@me.com > Sent: Fri, 16 Nov 2012 15:32:23 +0100 > To: sarah.gos...@gmail.com > Subject: Re: [R] Deleting rows with special character > > Hey Sara, > first: Thanks for the fast reply! I checked the apply functio

Re: [R] Deleting rows with special character

2012-11-16 Thread John Kane
http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example John Kane Kingston ON Canada > -Original Message- > From: peter.kup...@me.com > Sent: Fri, 16 Nov 2012 15:04:31 +0100 > To: r-help@r-project.org > Subject: [R] Deleting rows with special character >

Re: [R] Deleting rows with special character

2012-11-16 Thread Peter Kupfer
Hey Sara, first: Thanks for the fast reply! I checked the apply function and I found my error. For sure: I forgot to send an sample data. After sending the mail I recognized it. Sorry about this! Once again: Thanks for the fast reply and your help. Best Peter Am 16.11.2012 um 15:26 schrieb S

Re: [R] Deleting rows with special character

2012-11-16 Thread Sarah Goslee
Hi Peter, On Fri, Nov 16, 2012 at 9:04 AM, Peter Kupfer wrote: > Dear all, > maybe a simple problem but I found no solution for my problem. > I have a matrix Y with 23 000 rows and 220 colums. The entries are "A", "B" > or "C". A reproducible example with sample data is helpful. > I want to ex

[R] Deleting rows with special character

2012-11-16 Thread Peter Kupfer
Dear all, maybe a simple problem but I found no solution for my problem. I have a matrix Y with 23 000 rows and 220 colums. The entries are "A", "B" or "C". I want to extract all rows (as a matrix ) of the matrix Y where all entries of a row are (for example) "A". Is there any solution? I tried t

Re: [R] How to get the result of eval()

2012-11-16 Thread Rui Barradas
Hello, Try the following. attr(eval(dx2x), "gradient") Hope this helps, Rui Barradas Em 16-11-2012 11:02, Marc Girondot escreveu: I just discover the deriv function but I have a minor problem at the end when using its result: For example: dx2x <- deriv(~ A*x^2, "x") ; dx2x # it works fine:

Re: [R] predict.zeroinfl not found / excessive footers in your posts

2012-11-16 Thread Michael Friendly
On 11/9/2012 7:06 AM, Jose Iparraguirre wrote: Wrap Up & Run 10k next March to raise vital funds for Age UK Six exciting new 10k races are taking place throughout the country and we want you to join in the fun! Whether you're a runner or not, these are events are for everyone ~ from walking gro

Re: [R] confidence intervals with glmmPQL

2012-11-16 Thread Ben Bolker
Sally_roman umassd.edu> writes: > Hi - I am using R version 2.13.0. I have run several GLMMs using > the glmmPQL function to model the proportion of fish caught in one > net to the total caught in both nets by length. I started with a > polynomial regression full model with three length terms:

Re: [R] survreg & gompertz

2012-11-16 Thread Terry Therneau
The short answer is "sort of". Medium is that survreg implements the model framework found in Kalbfeisch and Prentice, The statistical analysis of failure time data, chapter, chapter 2.2. The ime variable T has f(time) ~ X' beta + sigma * W where W is an error term from some distribution an

Re: [R] lubridate concatenation issue

2012-11-16 Thread arun
HI, Sys.setenv(TZ="GMT")  c(d) #[1] "2011-12-31 GMT" #or Sys.setenv(TZ="UTC")  c(d) #[1] "2011-12-31 UTC" Hope it helps. A.K. - Original Message - From: Andre Zege To: "r-help@r-project.org" Cc: Sent: Thursday, November 15, 2012 9:36 PM Subject: [R] lubridate concatenation issue

Re: [R] survreg & gompertz

2012-11-16 Thread Matthias Ziehm
On 15/11/12 21:22, David Winsemius wrote: On Nov 15, 2012, at 5:38 AM, Matthias Ziehm wrote: Hi all, Sorry if this has been answered already, but I couldn't find it in the archives or general internet. A Markmail/Rhelp search on: gompertz survreg ...brings this link to a reply by Terry T

Re: [R] Build without warning RSvgDevice

2012-11-16 Thread Duncan Murdoch
On 12-11-16 5:14 AM, Matthieu Decorde wrote: Hi, I'm trying to build a modified version of the package RSvgDevice, without warnings. I'm having troubles with the description file. Here's the logs : * checking Rd files ... WARNING prepare_Rd: RSvgDevice.Rd:1: All text must be in a section But t

Re: [R] Can you have a by variable in Lag function as in SAS

2012-11-16 Thread Agnieszka Matoga
Hi Ramoss, There are a few solutions to this - probably the best solution involves proper handling of time series/date objects. But, for "an" answer try: # Build a data frame ... set.seed(123) someTimes <- sapply(1:5, function(i) sort(round(runif(6, 0, 24 myDf <- data.frame(Day = rep(1:5, ea

[R] fitting

2012-11-16 Thread Meli Massimiliano
Hello All, i would fit my data with a function like this : y = a0 + a1 * exp(-x/a2) + a3 * exp(-x/a4) + a5 * exp(-x/a6) + a7 * exp(-x/a8) + a9 * exp(-x/a10) plus i have to impose that a1 + a3 + a5 + a7 + a9 = 1 a1 , a3 , a5 , a7 , a9 >= 0 i try with nls, but i do not know how to impose the

  1   2   >