Re: [R] Simulating from a special type of bivariate exponential distribution

2013-06-15 Thread INDRANIL GHOSH
Hi, I have the following problem in simulating samples from a bivariate exponential distribution with the following construction: Start with three independent exponential random variables say W1,W2 and W3 with intensity parameters lambda 1, lambda 2 and lambda 3 respectively. Now I construct a bi

[R] R for Chrome OS

2013-06-15 Thread Kevin Chavers
Hello, I have heard that Chrome OS is Linux based, so I am wondering if there is anyway to use R on a Google Chromebook using one of your Linux packages. If not, do you plan on making a version of R that is compatible with chromebooks or cloud based? [[alternative HTML version deleted]]

[R] Matrix Mulitplication: A*B*C*D...?

2013-06-15 Thread G Vishwanath
Is there a R package or function that will multiple an arbitrary number of matrices supplied to it, preferably optimizing the sequence R_function(matA, matB, matC,  matD,)    return matA %*%  matB %*%  matC %matD %    and optimizing wether it is better to do A(BC) or (AB)C ? Thanks, Shi

Re: [R] extract all numbers from a string

2013-06-15 Thread Duncan Mackay
Nick try as.numeric( strsplit(gsub("[[:alpha:][:punct:][:space:]]{2,}",",",tmpstr),",")[[1]][-1] ) see ?regexpr for information HTH Duncan Duncan Mackay Department of Agronomy and Soil Science University of New England Armidale NSW 2351 Email: home: mac...@northnet.com.au At 15:06 16/06

Re: [R] extract all numbers from a string

2013-06-15 Thread arun
HI, One way would be: library(stringr) tmpstr = "The first number is: 32.  Another one is: 32.1. Here's a number in scientific format, 0.3523e10, and another, 0.3523e-10, and a negative, -313.1" pattern<- "(\\d)+|(\\d+\\.\\d+)|(-\\d+\\.\\d+)|(\\d+.\\d+e\\d+)|(\\d+\\.\\d+e-\\d+)" str_extract_all

[R] extract all numbers from a string

2013-06-15 Thread Nick Matzke
Hi all, I have been beating my head against this problem for a bit, but I can't figure it out. I have a series of strings of variable length, and each will have one or more numbers, of varying format. E.g., I might have: tmpstr = "The first number is: 32. Another one is: 32.1. Here's a

Re: [R] quick Help needed

2013-06-15 Thread arun
Hi, It is better to ?dput() the dummy dataset. I made up some data for female==0 dat1<- read.table(text="  pbnr    dat  dep  dys  sop  ago  mis age female messpunkt2 messpunkt1 tage eintrittsjahr 1 10023 1994-02-21 0.75 1.00 0.50 0.50 0.75  35  1   8817 8817    0  1994 2 10023

Re: [R] Optimization of a function using optim

2013-06-15 Thread Rolf Turner
The r-help list should institute a prize for "Most Obtuse Question of the Month". This one should be a shoe-in for the June 2013 prize. cheers, Rolf Turner On 16/06/13 12:08, Graham McDannel wrote: I am attempting to optimize a function I have developed using optim. I am gettin

Re: [R] Plotting two y-axis vs non-numeric x-axis

2013-06-15 Thread Jim Lemon
On 06/16/2013 04:14 AM, Birdada Simret wrote: Thank you. @David: The example is exactly this: time <- seq(0,72,6) music <- c(0.05,0.18,0.25,0.31,0.32,0.34,0.35, 0.36,0.37,0.38,0.39,0.40,0.41) actor <- c(0,1000,2000,3000,4000,5000,6000,7000,8000,9000,1,11000,12000) par(mar=c(5, 4, 4, 4) + 0.1)

Re: [R] Optimization of a function using optim

2013-06-15 Thread Jeff Newmiller
Not unless you read the Posting Guide, stop posting in HTML mail format, and provide a reproducible example. --- Jeff NewmillerThe . . Go Live... DCN:Basics: ##.#. ##.#.

[R] Optimization of a function using optim

2013-06-15 Thread Graham McDannel
I am attempting to optimize a function I have developed using optim. I am getting the below error message: Error in n < 1: 'n' is missing Could some one provide some additional clarity regarding this message and what it entails, as well as, how to rectify this issue. Thanks [[alternati

Re: [R] How can make loop more faster?

2013-06-15 Thread David Winsemius
On Jun 15, 2013, at 2:38 PM, Fabrice Tourre wrote: > Dear expert, > > How can I make follow codematrix function more faster? > > top20.dat <- top20.dat[,7:length(top20.dat[1,])] > top40.dat <- > read.table("top40snps.ped",header=F,sep="\t",stringsAsFactors=F) Did you attach a file with a non-'

Re: [R] quick Help needed

2013-06-15 Thread Bhupendrasinh Thakre
table(scltotal$female,scltotal$dys) Best Regards, Bhupendrasinh Thakre Sent from my iPad On Jun 15, 2013, at 3:58 PM, Sophie Homeyer wrote: > Hi, > i am new to this forum and not sure how it works, > I am trying to do deskriptive descripe my data in terms of gender: > > head(scltotal) > >

[R] How can make loop more faster?

2013-06-15 Thread Fabrice Tourre
Dear expert, How can I make follow codematrix function more faster? top20.dat <- top20.dat[,7:length(top20.dat[1,])] top40.dat <- read.table("top40snps.ped",header=F,sep="\t",stringsAsFactors=F) row.names(top40.dat) <- top40.dat[,1] top40.dat <- top40.dat[,7:length(top40.dat[1,])] codematrix <- f

[R] quick Help needed

2013-06-15 Thread Sophie Homeyer
Hi, i am new to this forum and not sure how it works, I am trying to do deskriptive descripe my data in terms of gender: head(scltotal) pbnrdat dep dys sop ago mis age female messpunkt2 messpunkt1 tage eintrittsjahr 1 10023 1994-02-21 0.75 1.00 0.50 0.50 0.75 35 1 881

Re: [R] Downloading CSV file - RCurl help

2013-06-15 Thread David Winsemius
On Jun 15, 2013, at 11:41 AM, jcrosbie wrote: > There are some CSV file from the link below. > > I'm having trouble installing the package. Is this the package I have to use > or is there another one I need to use? If so how do I get this one loaded. > > > > https://www.enmax.com/Power/Ener

[R] Downloading CSV file - RCurl help

2013-06-15 Thread jcrosbie
There are some CSV file from the link below. I'm having trouble installing the package. Is this the package I have to use or is there another one I need to use? If so how do I get this one loaded. https://www.enmax.com/Power/Energy+Retailers/Settlement+Reports/Profile+settlement+report.htm

Re: [R] Plotting two y-axis vs non-numeric x-axis

2013-06-15 Thread David Winsemius
On Jun 15, 2013, at 11:14 AM, Birdada Simret wrote: > Thank you. > @David: The example is exactly this: > time <- seq(0,72,6) > music <- c(0.05,0.18,0.25,0.31,0.32,0.34,0.35, > 0.36,0.37,0.38,0.39,0.40,0.41) > actor <- c(0,1000,2000,3000,4000,5000,6000,7000,8000,9000,1,11000,12000) > par(mar=

Re: [R] Plotting two y-axis vs non-numeric x-axis

2013-06-15 Thread Birdada Simret
Thank you. @David: The example is exactly this: time <- seq(0,72,6) music <- c(0.05,0.18,0.25,0.31,0.32,0.34,0.35, 0.36,0.37,0.38,0.39,0.40,0.41) actor <- c(0,1000,2000,3000,4000,5000,6000,7000,8000,9000,1,11000,12000) par(mar=c(5, 4, 4, 4) + 0.1) plot(time, music, pch=16, axes=F, ylim=c(0,1),

[R] [igraph] Counting edges for each vertex

2013-06-15 Thread Mulone
Hi all, I'm analysing an e-mail network. I loaded the following information in a directed igraph: *Vertex* types: person, e-mail V(g)[ type == "person" ] V(g)[ type == "email" ] *Edge* types: sends, receives E(g)[ type == "send" ] E(g)[ type == "receive" ] So for example: John --send--> email1

Re: [R] Calculate days with R

2013-06-15 Thread arun
Hi, May be this helps: dat1<- read.table(text=" pbnr    dat  dep  dys  sop  ago  mis age female 1 10023 1994-02-21 0.75 1.00 0.50 0.50 0.75  35  1 2 10023 1994-05-25 0.75 1.00 0.50 0.50 0.75  35  1 3 10028 1994-02-01 2.00 1.75 3.00 0.50 1.50  42  1 4 10028 1999-01-15 1.25 0.75 2.25

Re: [R] Windows R_LIBS_USER confusion under R-3.0.1

2013-06-15 Thread Uwe Ligges
On 12.06.2013 16:35, Paul Johnson wrote: I would appreciate ideas about MS Windows install issues. I'm at our stats summer camp and have been looking at a lot of Windows R installs and there are some wrinkles about R_LIBS_USER. On a clean Win7 or Win8 system, with R-3.0.1, we see the user libr

Re: [R] transform summary table list to summary table (for .csv output)

2013-06-15 Thread arun
Hi, You could try this: #In one of the list element SampleSummary$ConcLow #   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's # 0.4200  0.6100  0.7300  0.7373  0.8150  1.6600   1 #additional entry for NA.  You may need to check the data and remove the missing value.  Here, I removed t

Re: [R] Plotting two y-axis vs non-numeric x-axis

2013-06-15 Thread arun
Hi, You could use ?twoord.plot() from library(plotrix): library(plotrix) dat2<- data.frame(month,music,actor) dat2$month<- factor(month,labels=c(month.abb,"Pag")) dat2New<-dat2[order(dat2$month),]  with(dat2New,twoord.plot(month,music,actor,     lylim=c(0,1),rylim=c(0,13000)

Re: [R] A strange issue with GSub

2013-06-15 Thread David Winsemius
On Jun 15, 2013, at 7:46 AM, Ali Arslan Kazmi wrote: > Greetings, > > Apologies if this turns out to be a very silly question, but because I am the > only person learning/using R at my workplace, I have no choice but to ask > folks here. > I have been using Gsub to change some expressions in

Re: [R] Plotting two y-axis vs non-numeric x-axis

2013-06-15 Thread David Winsemius
On Jun 15, 2013, at 5:18 AM, Birdada Simret wrote: > Hi dear all, the following code is correct. but I want to use non-numeric > x-axis, for example > if I replace time <- seq(0,72,6) by > month <- > c("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","Pag") > > Ofcourse

[R] A strange issue with GSub

2013-06-15 Thread Ali Arslan Kazmi
Greetings, Apologies if this turns out to be a very silly question, but because I am the only person learning/using R at my workplace, I have no choice but to ask folks here. I have been using Gsub to change some expressions in my Corpus object. After applying the gsub function, say newCorpus<

Re: [R] Widows 8

2013-06-15 Thread Wensui Liu
confirmed. On Sat, Jun 15, 2013 at 10:50 AM, Chet Seligman wrote: > Can anyone confirm that R runs on Widows 8? > > Thanks, > Chet Seligman > > [[alternative HTML version deleted]] > > __ > R-help@r-project.org mailing list > https://stat.ethz.

Re: [R] Widows 8

2013-06-15 Thread Jeff Newmiller
On Sat, 15 Jun 2013, Chet Seligman wrote: Can anyone confirm that R runs on Widows 8? You can : http://lmgtfy.com/?q=site%3Astat.ethz.ch+%22windows+8%22 Thanks, Chet Seligman [[alternative HTML version deleted]] Please read the Posting Guide, and asi it requests post in plain te

Re: [R] Widows 8

2013-06-15 Thread John Kane
Seems unlikely but it runs on Windows 8 John Kane Kingston ON Canada > -Original Message- > From: chet.selig...@gmail.com > Sent: Sat, 15 Jun 2013 07:50:45 -0700 > To: r-help@r-project.org > Subject: [R] Widows 8 > > Can anyone confirm that R runs on Widows 8? > > Thanks, > Chet Seligm

[R] Widows 8

2013-06-15 Thread Chet Seligman
Can anyone confirm that R runs on Widows 8? Thanks, Chet Seligman [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/p

Re: [R] GGally installation problems

2013-06-15 Thread Uwe Ligges
On 12.06.2013 15:08, Tim Smith wrote: Hi, I was trying to install the GGally package, but was getting errors. Here is what I get: install.packages("GGally") Installing package(s) into ‘/Users/ts2w/Library/R/2.15/library’ (as ‘lib’ is unspecified) Warning in install.packages :  pa

[R] Plotting two y-axis vs non-numeric x-axis

2013-06-15 Thread Birdada Simret
Hi dear all, the following code is correct. but I want to use non-numeric x-axis, for example if I replace time <- seq(0,72,6) by month <- c("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","Pag") Ofcourse I use factor(month) instead of time; but I didn't get similar plo

Re: [R] Trouble sorting the matrix

2013-06-15 Thread Rui Barradas
Hello, Yes, you can do it like you say. Or you can unsort first and multiply later. mat5.1 <- sapply(seq_len(ncol(ord)), function(i) mat4[order(ord[,i]), i]) multip<-mat4*2 mat5.2 <- sapply(seq_len(ncol(ord)), function(i) multip[order(ord[,i]), i]) identical(mat5.1*2, mat5.2) #TRUE Also, it

Re: [R] Trouble sorting the matrix

2013-06-15 Thread Rui Barradas
Hello, If I understand it correctly, the following should sort all columns of matrix3 and then unsort the sorted matrix. ord <- apply(matrix3, 2, order) # sort matrix3 mat4 <- sapply(seq_len(ncol(ord)), function(i) matrix3[ord[,i], i]) mat4 # unsort mat4 mat5 <- sapply(seq_len(ncol(ord)), f

Re: [R] R session freezes when I try to save a new script

2013-06-15 Thread Duncan Murdoch
On 13-06-14 10:52 AM, anferg...@aol.com wrote: All: Recently my R session freezes when I try to open a file or save a new script after I have run existing scripts. The session freezes so that I can no longer click on any windows within the R session -- including other scripts that are open o

Re: [R] "Error: cannot allocate vector of size 1.9 Gb" when loading xtable help

2013-06-15 Thread Duncan Murdoch
On 13-06-14 7:02 PM, Dan Keshet wrote: I am using xtable version 1.7-1 built for R 3.0.1 on: R version 3.0.1 (2013-05-16) Platform: i686-pc-linux-gnu (32-bit) Sometimes, not every time, when I load xtable or attempt to load the help, I get an error such as this "Error: cannot allocate vector of

Re: [R] Trouble sorting the matrix

2013-06-15 Thread andrija djurovic
Hi. Here is an example of sorting matrix columns: > mat <- matrix(10:1, ncol=2, byrow=TRUE) > mat [,1] [,2] [1,] 109 [2,]87 [3,]65 [4,]43 [5,]21 > apply(mat, 2, function(x) x[order(x)]) [,1] [,2] [1,]21 [2,]43 [3,]65 [4,]8

[R] Trouble sorting the matrix

2013-06-15 Thread Ola Cabaj
I would like to sort matrix3, so that every column in output matrix is sorted. Also I have to "unsort" it later on. matrix1<-matrix(rnorm(100,354,78),ncol=10) matrix2<-matrix(rnorm(100,225,102),ncol=10) matrix3<-cbind(matrix1,matrix2) nrCol<-length(matrix3[1,]) class1<-1:10 for(i in 1:nrCol) {

[R] passing of arguments to R CMD BATCH in bash script that is submitted to torque (Linux platform)

2013-06-15 Thread Franckx Laurent
Dear all I want to call R repeatedly in batch mode from a bash script that is then submitted to torque. My calls to R depend on optional arguments. When I introduce these arguments as literals, the calls work fine, for instance: R CMD BATCH --no-save "--args PERIOD='08' YEAR='2008' SC='BAU' "

[R] Reading shape files in R

2013-06-15 Thread jickngea alexand
Hi everyone,    I am new with spatial data analysis in R and I'm not able to read a shape because of this error message but the shapefile is in my work directory.  Here are my commands; ogrListLayers("border.shp"), border=readOGR("border.shp","border"). What does it mean?. An

[R] Multi-Level classification

2013-06-15 Thread Deb Midya
Hi,   Thanks in advance.   I am using R-3.0.1 on Windows XP.   May I request you to assist me for the following please.   I have a data set where each instance has two or more levels. As for example, level 1 (binary): 0, 1; level 2 (binary): 0, 1 and so on. These levels are target variables. The