Re: [R] Creating dates to plot

2012-11-16 Thread PIKAL Petr
Hi x$dat - as.Date(paste(x$Period,0,1, sep=), format=%Y%m%d) shall do it. Petr -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of eric Sent: Friday, November 16, 2012 12:46 AM To: r-help@r-project.org Subject: [R] Creating

Re: [R] strip.custom() with more than one conditioning variable

2012-11-16 Thread Patrick Connolly
On Thu, 15-Nov-2012 at 07:29PM -0700, ilai wrote: | dotplot(variety ~ yield | year+ site, barley, | strip = function(...,which.given,factor.levels) { | if(which.given==2){ | strip.default(which.given,factor.levels=substr(levels(barley$site), 1, | 1),style=4,...) | } | else{ |

Re: [R] Function for extracting Lambda Sets

2012-11-16 Thread Suzen, Mehmet
Hi Nick, Have you tried this: http://www.bioconductor.org/packages/release/bioc/html/RBGL.html There is a function there called 'lambdaSets' Best, Mehmet On Thu, Nov 15, 2012 at 10:45 AM, Nick Duncan nickd...@gmail.com wrote: Dear All, I would like to extract Lambda Sets from a binary

Re: [R] Dealing with factors ???

2012-11-16 Thread PIKAL Petr
Hi Please include context. Your numbers are not numbers. They are strings in csv file e.g. 1,200,300 and are converted to factors during reading. First do not convert them to factors by stringsAsfactors=FALSE option in read.table. If you are sure that all commas are thousands separators (in

Re: [R] create function to solve derivative

2012-11-16 Thread e-letter
On 16/11/2012, Rolf Turner rolf.tur...@xtra.co.nz 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 specified analytic expressions for functions --- data sets do not

[R] function customization

2012-11-16 Thread maxbre
Given my reproducible example: new.ex-structure(list(TEC = c(0.21, 0.077, 0.06, 0.033, 0.014, 0.007, 0.21, 0.077, 0.01, 0.033, 0.05, 0.014), LR = c(FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE ), group = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L,

Re: [R] Creating dates to plot

2012-11-16 Thread PtitBleu
Hello Eric, strptime(201206,format=%Y%m) gives NA (I don't know why but I'm a newbie). The only solution I found is to add 01 as a day to have a complete date (Year Month Day): x$Period-as.Date(paste(x$Period,01,sep=),format=%Y%m%d) Then you get a Date format you can use to plot graph. I think

Re: [R] Function for extracting Lambda Sets

2012-11-16 Thread Nick Duncan
Marvelous! That is exactly what I have been looking for. Many thanks, Nick On 16 November 2012 08:33, Suzen, Mehmet msu...@gmail.com wrote: Hi Nick, Have you tried this: http://www.bioconductor.org/packages/release/bioc/html/RBGL.html There is a function there called 'lambdaSets' Best,

Re: [R] create function to solve derivative

2012-11-16 Thread Berend Hasselman
On 16-11-2012, at 09:43, e-letter wrote: On 16/11/2012, Rolf Turner rolf.tur...@xtra.co.nz 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 specified analytic

Re: [R] Extracting list names within a looped function

2012-11-16 Thread Gaj Stan (BIGCAT)
This question has been solved off-list. Please find the solution below: a - list(var1=c(100:1), var2=c(1:100), var3=rnorm(100)) foo - function(x) { print(names(x)) print(==) x - x[[1]] print(x) } for(i in 1:length(a)) { foo(a[i]) } The main trick here was to send a[i] into the

Re: [R] merge dataframes with condition

2012-11-16 Thread Geophagus
Hi @ all, thanks for the solutions! Now I can go on. Greetz GeoPhagUS -- View this message in context: http://r.789695.n4.nabble.com/merge-dataframes-with-condition-tp4649605p4649712.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] merge dataframes with condition

2012-11-16 Thread Geophagus
Refering the discussed issue: As a result I have dataframe like the following. animal-c(bear,lion,monkey,fish,zebra) S-c(10,20,40,5,12) N-c(5,8,15,26,1) Z-c(24,12,8,7,2) R-c(21,14,2,5,3) Q-c(13,9,9,16,1) df1-data.frame(animal,S,N,Z,R,Q) Now, I want to plot it as a stacked barchart so that it

[R] How to create as.numeric.xxx

2012-11-16 Thread Marc Girondot
I would like to create a function to convert data based on a class using as.numeric Similarly, using a plot, I do: plot.essai - function(x, ...) {return(x*2)} d - 10 class(d) - essai plot(d) It works: [1] 20 attr(,class) [1] essai Now same with as.numeric: as.numeric.essai - function(x,

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

2012-11-16 Thread Marc Girondot
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: # expression({ # .value - A * x^2 # .grad - array(0, c(length(.value), 1L), list(NULL, c(x))) # .grad[, x] - A * (2 * x) # attr(.value,

Re: [R] How to create as.numeric.xxx

2012-11-16 Thread Rui Barradas
Hello, Actually, it's working as expected. 'numeric' is a class and the function as.numeric() is doing what it should: as.numeric.essai - function(x, ...) {return(x*2)} d2 - as.numeric(d) class(d2) [1] numeric Maybe you want an as.essai function. as.essai - function(x, ...) {x -

Re: [R] How to create as.numeric.xxx

2012-11-16 Thread Prof Brian Ripley
On 16/11/2012 10:01, Marc Girondot wrote: I would like to create a function to convert data based on a class using as.numeric Similarly, using a plot, I do: plot.essai - function(x, ...) {return(x*2)} d - 10 class(d) - essai plot(d) It works: [1] 20 attr(,class) [1] essai Now same with

[R] How to retrieve data from a matrix

2012-11-16 Thread ginger
I have a data set (data.txt) containing information on affection status (1=affected; 0=not affected) for some subjects identified by an ID. Then I have a sort of correlation matrix of the same subjects (matrix.txt). For each affected subject in the data set I have to retrieve the IDs of unaffected

[R] rq summary plot: specify ylim for each coefficient

2012-11-16 Thread Gravier
Hi all, I am running 4 series of quantile regressions with tau=10:90/100, each series corresponding to a different year. I would like to restrict ylim for each coefficient to be the same across years in order to help comparing coeff across years. Therefore, I need to specify ylim for each coef.

Re: [R] cluster analysis in R

2012-11-16 Thread Hennig, Christian
Dear Katherine, function flexmixedruns in package fpc may do what you want; it fits mixtures with continuous and categorical variables, can use the BIC for giving you the number of mixture components and also gives you posterior probabilities for cases to belong to components. Note that

Re: [R] no y-axis

2012-11-16 Thread Geophagus
thank you! -- View this message in context: http://r.789695.n4.nabble.com/no-drawn-y-axis-but-values-tp4649298p4649718.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

[R] Build without warning RSvgDevice

2012-11-16 Thread Matthieu Decorde
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 the RSvgDevice.Rd file seems OKto me, what

[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

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, each

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

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

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 az...@yahoo.com To: r-help@r-project.org r-help@r-project.org Cc: Sent: Thursday, November 15, 2012 9:36 PM Subject: [R]

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 and

Re: [R] confidence intervals with glmmPQL

2012-11-16 Thread Ben Bolker
Sally_roman sroman at 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

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

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: #

[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 the

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 peter.kup...@me.com 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

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

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 Dear

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 function and I

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: Peter

[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] 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

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 successive

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,

[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

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 sas0...@auburn.edu 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

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 20+30, etc.?

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

[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

[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

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,

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

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] 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 presence

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 rolf.tur...@xtra.co.nz wrote: Your question makes little sense. Functions have derivatives --- at least some of them do. Data sets do not have derivatives. The functions D(),

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.POSIXct() Using ‘c’ on

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] 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 v.padmanab...@itc.in wrote: Dear R Group I have a character vector from which I want to select a few elements and

Re: [R] Deleting rows with special character

2012-11-16 Thread Marc Schwartz
On Nov 16, 2012, at 8:26 AM, Sarah Goslee sarah.gos...@gmail.com wrote: Hi Peter, On Fri, Nov 16, 2012 at 9:04 AM, Peter Kupfer peter.kup...@me.com 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

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 you

[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] 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 ptit_b...@yahoo.fr To: r-help@r-project.org Cc: Sent: Friday, November 16, 2012 2:56 AM Subject: Re: [R] Creating

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

[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

[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

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)[x0.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:5] #  id

[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.

[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 i

[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

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:

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:

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:

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 many

[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]] __

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

[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 've'

[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

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 context:

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] 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

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

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 following message:

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 at

[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

[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

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

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 would,

Re: [R] Boxplot in R

2012-11-16 Thread Marc Schwartz
On Nov 16, 2012, at 2:04 PM, Elli ellilti_...@hotmail.com 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

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] 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

[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) {         m

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 candi...@gmail.com 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*

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] 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 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 I

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

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

[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

[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

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

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 mat1 and 2nd

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

[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

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

  1   2   >