Re: [R] Collapsing columns to one

2014-03-06 Thread arun
Hi Farnoosh, May be this helps:  within(DataA,Var3 - (Var1|Var2)+0) A.K. On Wednesday, March 5, 2014 6:03 PM, farnoosh sheikhi farnoosh...@yahoo.com wrote: Hi Arun, I have a data like below, I want to collapse var1 and var 2 together. DataA - read.table(text=ID,Var1,Var2 1,1,0 2,0,1    

[R] How to use restricted cubic spline in survfit.cph function in survival package?

2014-03-06 Thread Zhiyuan Sun
Hello, I used PBC data set included in the survival package to fit a cox model. The model included a restricted cubic spline transformation on age. Then I tried using survfit function to predict a survival curve using the first row of the original data. I got an error message. The R code and

[R] R 3.0.3 is released

2014-03-06 Thread Peter Dalgaard
The build system rolled up R-3.0.3.tar.gz (codename Warm Puppy) this morning. The list below details the changes in this release. You can get the source code from http://cran.r-project.org/src/base/R-3/R-3.0.3.tar.gz or wait for it to be mirrored at a CRAN site nearer to you. Binaries for

[R] Social network analysis, retrieve brokered nodes

2014-03-06 Thread Haeussler Thomas
Hi, I am working with R’s sna package to do a brokerage analysis of a social network. Basically, I would like to know whether there is a possibility to retrieve the brokered nodes. I have a dataset of 244 nodes which is subdivided into two communities. For theoretical reasons I’m currently

Re: [R] Survfit Error

2014-03-06 Thread David Winsemius
The help page for the survfit function says it expects a formula as its first argument so try: sleepfit - survfit(Surv(timeb, death)~1, data = sleep) David Sent from my iPhone ... so unable to test. On Mar 6, 2014, at 12:07 PM, Lucy Leigh lucy.le...@newcastle.edu.au wrote: Hi everyone,

[R] Updating R and Bioconductor packages in a different folder.

2014-03-06 Thread Luca Cerone
Dear all, I use R on a server on which I don't have administrative access. I would like to update some of the R and Bioconductor packages I use for my daily analysis, however some of those packages are installed system-wide. I would like to know how I can update those packages installing them in

Re: [R] Building R for better performance

2014-03-06 Thread Simon Zehnder
Jonathan, these results are amazing! But you mentioned before, that MKL is running computations multicore-wise - I think this is the main bottleneck for the gcc. The Intel performance is higher than I expected … and higher than I read from other developers’ experiences. Researchers and

Re: [R] Updating R and Bioconductor packages in a different folder.

2014-03-06 Thread Prof Brian Ripley
On 06/03/2014 09:51, Luca Cerone wrote: Dear all, I use R on a server on which I don't have administrative access. I would like to update some of the R and Bioconductor packages I use for my daily analysis, however some of those packages are installed system-wide. I would like to know how I can

Re: [R] How to use restricted cubic spline in survfit.cph function in survival package?

2014-03-06 Thread Andrews, Chris
Try cph in rms (where rcs is defined). library(rms) fit-cph(Surv(time,status==2)~rcs(age,4)+sex, data=pbc, y=TRUE, x=TRUE) id1-pbc[1,] surv.id1-survfit(fit,newdata=id1) plot(surv.id1) summary(surv.id1) -Original Message- From: Zhiyuan Sun [mailto:sam.d@gmail.com] Sent: Wednesday,

Re: [R] Survfit Error

2014-03-06 Thread Thomas Lumley
On Thu, Mar 6, 2014 at 3:35 AM, David Winsemius dwinsem...@comcast.netwrote: The help page for the survfit function says it expects a formula as its first argument so try: sleepfit - survfit(Surv(timeb, death)~1, data = sleep) David Sent from my iPhone ... so unable to test. This was a

[R] Bootstrapping with Kendall's tau

2014-03-06 Thread David Parkhurst
I want to bootstrap Kendall's tau correlation with data that have many NAs. I tried this example: x - 1:15 y - c(2,4,1,3,5, 7,6, 9,10,8, 14, 13, 11, 15, 12) x[3] - NA; x[11] - NA; x[8] - NA y[2] - NA; y[8] - NA; y[12] - NA cor(x,y,use=complete.obs,method=kendall) library(boot) tmpdf -

[R] Errors Calculating MVN Likelihood of Time Series with AR(1) Errors

2014-03-06 Thread Robert J. Kindman
Hi all, I'm having trouble calculating the likelihood of a time series with AR(1) errors. I am generating my covariance matrix according to page 2 of ( http://cran.r-project.org/doc/contrib/Fox-Companion/appendix-timeseries-regression.pdf), using the library mvtnorm and the multivariate normal

Re: [R] gamm design matrices

2014-03-06 Thread Linus
Hello Jarrod and Simon, i have a similiar issue. I want to use splines with the MCMCglmm-package. I need the packages for various reasons. I try to incorporate the splines via Jarrod´s function, which based on the mgvc-package. I attached my data and codes. For the thin-plate-splines the fixed

[R] 64 bit R for Solaris

2014-03-06 Thread Lau, Pang Kenny
Hi, Is there 64 bit R for intel Solaris? Thank you. Kenny Lau [[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

Re: [R] Non-negative solution to an underdetermined linear system

2014-03-06 Thread Lyubomir Klyambarski
The unknown matrix is like this: x-matrix(c(x11,x12,x13,x21,x22,x23,x31,x32,x33),nrow=3,ncol=3,byrow=TRUE) x      [,1]  [,2]  [,3]  [1,] x11 x12 x13 [2,] x21 x22 x23 [3,] x31 x32 x33 This is my distance matrix. D-matrix(c(1,5,10,5,2,6,10,6,8),nrow=3,ncol=3,byrow=TRUE) D      [,1] [,2] [,3]

Re: [R] 64 bit R for Solaris

2014-03-06 Thread Prof Brian Ripley
On 06/03/2014 16:16, Lau, Pang Kenny wrote: Hi, Is there 64 bit R for intel Solaris? Yes. See the 'R Installation and Administration manual'. Thank you. Kenny Lau -- Brian D. Ripley, rip...@stats.ox.ac.uk Professor of Applied Statistics,

[R] Parsing aspects of a url path in R

2014-03-06 Thread Abraham Mathew
Let's say that I have the following character vector with a series of url strings. I'm interested in extracting some information from each string. url = c(http://www.mdd.com/food/pizza/index.html;, http://www.mdd.com/build-your-own/index.html;, http://www.mdd.com/special-deals.html;,

[R] Interpolation grid with points outside data area- gstat

2014-03-06 Thread Moshood Agba Bakare
Dear All, An interpolation grid of spacing 100m by 100m was created for irregular space spatial data. The plot of the grid and sample data shows some grid points outside the data area. I guess the predicted values of those points outside the data area will not be reliable. How do I modify my R

Re: [R] how to count dates in R

2014-03-06 Thread arun
Hi, If you want to know how many unique dates are in the dataset `dat`: dataset  length(unique(dat$`trade date`)) #[1] 6 To find the frequency of each date: ?table  table(dat$`trade date`) A.K. Hi, some of you knows how to count dates in R ? i want to know how many dates in my data? my

Re: [R] Errors Calculating MVN Likelihood of Time Series with AR(1) Errors

2014-03-06 Thread peter dalgaard
On 06 Mar 2014, at 16:56 , Robert J. Kindman rkind...@college.harvard.edu wrote: Hi all, I'm having trouble calculating the likelihood of a time series with AR(1) errors. I am generating my covariance matrix according to page 2 of (

Re: [R] Errors Calculating MVN Likelihood of Time Series with AR(1) Errors

2014-03-06 Thread Robert J. Kindman
Peter, Thanks very much for the advice. It looks like you're exactly right and the above-cited document may not be exactly right. Instead thishttp://pic.dhe.ibm.com/infocenter/spssstat/v20r0m0/index.jsp?topic=%2Fcom.ibm.spss.statistics.help%2Fcovariance_structures.htm (

[R] Another question about bootstrapping cor

2014-03-06 Thread David Parkhurst
When I use the fix that Arun K. provided to my earlier example, I wonder how to find out where in the 999 bootstrap repetitions the value for the actual data fits. Here is the fixed code: x - 1:15 y - c(2,4,1,3,5, 7,6, 9,10,8, 14, 13, 11, 15, 12) x[3] - NA; x[11] - NA; x[8] - NA y[2] - NA;

[R] Question on 'get'

2014-03-06 Thread Brian Smith
Hi, I was trying to get at some values from 'data' using the get function. Here is my code: class(data) [1] data.frame class(data$gender.factor) [1] factor head(data$gender.factor) [1] Male Female Male Female Male Female Levels: Male Female xx - get(data$gender.factor) Error in

Re: [R] Question on 'get'

2014-03-06 Thread Sarah Goslee
Why do you need to use the get() command? If you want to access a column of a known data frame by name: R fakedata - data.frame(A=1:3, B=letters[8:10], C=runif(3)) R fakedata[A] A 1 1 2 2 3 3 If you're trying to access a data frame by name, then you do need get, but can then subset normally.

Re: [R] Errors Calculating MVN Likelihood of Time Series with AR(1) Errors

2014-03-06 Thread peter dalgaard
On 06 Mar 2014, at 19:16 , peter dalgaard pda...@gmail.com wrote: constant. Adding to that, and MA process with a neighbor correlation on the order of .9 is not possible. To paraphrase, you're doing essentially this: Sorry, dyslectic fingers syndrome: [...] _an_ MA process [...] is not

Re: [R] Another question about bootstrapping cor

2014-03-06 Thread Conklin, Mike (GfK)
Read the help on boot. Specifically in non-parametric bootstrapping the statistic function takes a data (the original data) and an index number that shows which rows are taken in the bootstrap sample. So you need to do the following. x - 1:15 y - c(2,4,1,3,5, 7,6, 9,10,8, 14, 13, 11, 15, 12)

Re: [R] Parsing aspects of a url path in R

2014-03-06 Thread Sarah Goslee
There are many ways to do this. Here's a simple version and a slightly fancier version: url = c(http://www.mdd.com/food/pizza/index.html;, http://www.mdd.com/build-your-own/index.html;, http://www.mdd.com/special-deals.html;, http://www.genius.com/find-a-location.html;,

[R] Time Series Plots: Adding Custom Y-Axis Labels

2014-03-06 Thread Rich Shepard
Working the examples in Introductory Time Series with R (pages 22-23). When I use the plot command (e.g., plot(elect.decom - decompose(elec.ts, type = mult)) the ylab command has no effect. Similarly, if I use xyplot. Is it possible to specify ylab values in time series plots? And what

[R] strange behavior of intToUtf8() and text()

2014-03-06 Thread Carl Witthoft
As posted to Stack Overflow, please try this out: plot(1:10,t='n') text(1,1,c(intToUtf8(c(1,9684))),cex=3) text(2,2,c(intToUtf8(c(9684))),cex=3) text(3,3,c(intToUtf8(c(9679,9684))),cex=3) text(4,4,c(intToUtf8(c(9679))),cex=3) text(5,5,c(intToUtf8(c(9685,9684))),cex=3)

[R] object.size vs. workspace size

2014-03-06 Thread Hui Du
Hi All, I have 2 objects, A and B, where object.size(A) = 5M and object.size(B) = 80M. However, after I save those two objects as workspaces, say, save(A, file = A.Rdata) and save(B, file = B.Rdata) On disk, the size of 'A.Rdata' is 0.22 M but the size of 'B.Rdata' is 560M. Could someone

Re: [R] Parsing aspects of a url path in R

2014-03-06 Thread Ista Zahn
See the parse_url function in the httr package. It does all this and more. On Mar 6, 2014 2:45 PM, Sarah Goslee sarah.gos...@gmail.com wrote: There are many ways to do this. Here's a simple version and a slightly fancier version: url = c(http://www.mdd.com/food/pizza/index.html;,

[R] trying to plot.

2014-03-06 Thread Bill
Hi. I am trying to plot. In the changepoint package documentation it says something about signature. http://cran.r-project.org/web/packages/changepoint/changepoint.pdf print-methods ~~ Methods for Function print in Package 'base' ~~ Description ~~ Methods for function print in Package 'base' ~~

Re: [R] trying to plot.

2014-03-06 Thread David Winsemius
S4 generic functions dispatch on the basis of the classes of their arguments while S3 generics only dispatch on the class of the first argument. If this makes no sense to you then you need to study more in whatever text you are learning R from. Sent from my iPhone On Mar 7, 2014, at 8:38

[R] details of cor function

2014-03-06 Thread David Parkhurst
How can I find out whether the cor function with method=Kendall computes Kendall's tau-a or tau-b. I understand that tau-b deals better with ties, and I'm wanting to look for correlation in two variables that have lots of ties (especially lots of zeroes for one of them). The information

Re: [R] Parsing aspects of a url path in R

2014-03-06 Thread Abraham Mathew
Oh, that's perfect. I can just use one of the apply functions to run that each url and then extract the methods that I need. Thanks! On Thu, Mar 6, 2014 at 11:52 AM, Ben Tupper ben.bigh...@gmail.com wrote: Hi, The XML package has a nice function, parseURI(), that nicely slice and dices

[R] Importance Sampling Monte Carlo method for bivariate integration

2014-03-06 Thread voladoddi
I have the following integral (x^-0.5) ;in x=[0.01,1] To solve this using Importance Sampling MC integration, one needs to select an importance pdf that is approximately the same as the function plot My R code to solve the same is this : #function 1

Re: [R] Parsing aspects of a url path in R

2014-03-06 Thread Ben Tupper
Hi, The XML package has a nice function, parseURI(), that nicely slice and dices the url. library(XML) parseURI('http://www.mdd.com/food/pizza/index.html') Might that help? Cheers, Ben On Mar 6, 2014, at 12:23 PM, Abraham Mathew abmathe...@gmail.com wrote: Let's say that I have the

Re: [R] Parsing aspects of a url path in R

2014-03-06 Thread arun
Try: gsub(.*\\.com,,url) [1] /food/pizza/index.html /build-your-own/index.html [3] /special-deals.html    /find-a-location.html [5] /hello.html     gsub(.*www\\.([[:alpha:]]+\\.com).*,\\1,url) #[1] mdd.com    mdd.com    mdd.com    genius.com google.com A.K. On

Re: [R] Survfit Error

2014-03-06 Thread oxnard
Hi David, Thank you! Lucy From: David Winsemius [via R] [mailto:ml-node+s789695n4686317...@n4.nabble.com] Sent: Thursday, 6 March 2014 8:38 PM To: Lucy Leigh Subject: Re: Survfit Error The help page for the survfit function says it expects a formula as its first argument so try: sleepfit -

[R] Registered, subscribed and still can't post

2014-03-06 Thread Mckinstry, Craig
I just received and email post with an R question. My problem is as described above. Thanks for your help Craig McKinstry Cambia HealthSparq 100 Market Building, 6th Floor 100 SW Market Street Portland, OR 97201 Ph: 503 225-6878 Email:

Re: [R] 2 bugs in R's grDevices, and fixes.

2014-03-06 Thread Hin-Tak Leung
Since R 3.0.3 is just around the corner and the problem is still there, here is a repost from around the new year. Hin-Tak Leung wrote: Just before the holiday, I asked the freetype developers what is the context of these two comments about freetype in the code of R's grDevices: ===

[R] question on more efficient data block-match processing

2014-03-06 Thread Mckinstry, Craig
I have a medical insurance claims datafile divided into blocks by member, with multiple lines per member. I am process these into a one line per member model matrix. Member block sizes vary from 1 to 50+. I am match attributes in claims data to columns in the model matrix and have been

[R] Error importing data from a personal geodatabase

2014-03-06 Thread Halley Brantley
I am trying to import data from a personal geodatabse into R. This code worked previously, but I recently upgraded to Windows 7 and R 3.0.1 and it no longer works. The error message is Cannot open data source. Why am I getting this error? Code and session info below. Thanks for the help. # Set

[R] Error with glmulti

2014-03-06 Thread Alicia Ellis
I am analyzing some data that came from demographic health surveys. The data contain information for individuals within households, that are located within clusters, that are located within survey years, that are located within countries. We are trying to find the best model from a subset of

[R] Error with glmulti

2014-03-06 Thread Alicia Ellis
I am analyzing some data that came from demographic health surveys. The data contain information for individuals within households, that are located within clusters, that are located within survey years, that are located within countries. We are trying to find the best model from a subset of

[R] Emacs/R/SSH But View( ) Doesn't Work

2014-03-06 Thread Allison Sr James L
I successfully run Emacs on a Windows laptop then use Emacs' Tramp to connect to a Linux server using SSH. Emacs in this fashion supports editing .R files resident on the remote machine and running of R in an inferior Emacs shell. The R process runs on the server. Also, I successfully use Putty

[R] More efficient data-block processing -revised

2014-03-06 Thread Mckinstry, Craig
I have a medical insurance claims datafile divided into blocks by member, with multiple lines per member. I am processing these into a one line per member binary model matrix. Member block sizes vary from 1 to 50+. I am matching attributes in claims data to columns in the model matrix and have

Re: [R] Parsing aspects of a url path in R

2014-03-06 Thread arun
Hi, In addition, you could also do: gsub(.*www\\.([[:alnum:]]+\\.[[:alnum:]]+).*,\\1,url) #[1] mdd.com    mdd.com    mdd.com    genius.com google.com  gsub(.*www\\.([[:alnum:]]+\\.[[:alnum:]]+).*,\\1,url2) #[1] mdd.com    mdd.com    mdd.edu    genius.gov google.com

[R] Zero-dose constraint in modeling dose-response curves with gam

2014-03-06 Thread Bleary
I wish to compare several products in terms of their dose-response functions as estimated by smooths via the gam function. Included in the experimental evaluations are zero-dose (blank) measurements. I want to set up the gam estimation so that the fitted smooths for the several products converge

Re: [R] More efficient data-block processing

2014-03-06 Thread arun
HI Craig, Assuming that this is similar to what you tried: dat - read.table(text=member code 1 A 1 C 1 F 2 B 2 E 3 D 3 A 3 B 3 D 4 G 4 A,sep=,header=TRUE,stringsAsFactors=FALSE)  code.list - LETTERS[1:5] n.mbr - 4  mbr.list - 1:4 matrix.mat -

Re: [R] R help

2014-03-06 Thread arun
Hi, If there are multiple max values, you will get only the first value with ?which.max(). Using dataset `a` as an example: a - structure(list(`1` = c(Mal, Mahesh, Tarak, Pawan, Charan, Prabhas, Arjun, Naresh, Nithin, Puri), `2` = 1:10,     `3` = c(Layer, Actor, Actor, Actor, Actor, Actor,   

[R] fitting the lognormal and negative binomial into a gumble copula

2014-03-06 Thread Charles Thuo
# I define a bivariate copula composed of 2 marginals each with 2 parameters gmb-gumbelCopula(4,dim=2) # Idefine the bivariate CDF specifying the already fitted parameters from the log normal and negative binomial

Re: [R] object.size vs. workspace size

2014-03-06 Thread Prof Brian Ripley
On 06/03/2014 23:26, Hui Du wrote: Hi All, I have 2 objects, A and B, where object.size(A) = 5M and object.size(B) = 80M. However, after I save those two objects as workspaces, say, save(A, file = A.Rdata) and save(B, file = B.Rdata) On disk, the size of 'A.Rdata' is 0.22 M but the size of