Re: [R] Cairo package error: "unable to load..."

2014-07-23 Thread Prof Brian Ripley
I presume this about the CRAN binary packages for R and Cairo (from CRAN, not BioC), in which case you should have asked on R-sig-mac. But the likely answer is that you forgot to install X11 via XQuartz. See the 'R Installation and Administration Manual', and if you need more help, use R-sig-m

[R] A question about call()

2014-07-23 Thread super
The question is as below: Exercises 1.The following two calls look the same, but are actually different: (a <- call("mean", 1:10)) #> mean(1:10) (b <- call("mean", quote(1:10))) #> mean(1:10) identical(a, b) #> [1] FALSE What¡¯s the difference? Which one should you prefer? So, how i can figure ou

[R] Problems with Installing RMySQL Package (Windows, R: 3.1.0 (64 bit), using RStudio)

2014-07-23 Thread Ashutosh Nanda
Hi all, I'm trying to install the RMySQL package; I'm working on a Windows 64-bit machine with version 3.1.0 installed in R. I've tried two different methods of installing this software: through RStudio and through good old Command Prompt. Additionally, I have Cygwin installed and have gotten this

[R] A question about call()

2014-07-23 Thread super
The question is as below: Exercises 1.The following two calls look the same, but are actually different: (a <- call("mean", 1:10)) #> mean(1:10) (b <- call("mean", quote(1:10))) #> mean(1:10) identical(a, b) #> [1] FALSE What¡¯s the difference? Which one should you prefer? So, how i can figure ou

[R] Cairo package error: "unable to load..."

2014-07-23 Thread Leonardo Gama
Hi! I've just installed R on my OS X 10.9 and was trying to make arrayQualityMetrics package work. I've installed it via the biocLite Bioconductor script, and everything was apparently fine. But when I tried to load the package, I've got an issue with the Cairo package... Then I tried to load onl

[R] Fast function for each row of a data.table

2014-07-23 Thread Aurélien Philippot
Dear R experts, I have the following data.table: dt<- data.table(A=rep(1:5), B=c(20:24), C=rep(30:34), target.name=c("A","B", "C","B","A"), target.column=c(1,2,3,2,1), target.value=rep(NA,5)) Columns A, B and C are the variables of interest. For each row, I want to get the value of the variable

Re: [R] corresponding replicated el of one matrix in another matrix or vector

2014-07-23 Thread arun
Try: rbind(v2,unname(setNames(v1[,1],v1[,2])[v2]))    [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14] v2 "a"  "a"  "a"  "a"  "a"  "c"  "c"  "c"  "c"  "c"   "c"   "c"   "c"   "c"     "1"  "1"  "1"  "1"  "1"  "3"  "3"  "3"  "3"  "3"   "3"   "3"   "3"   "3"     [,15] [,16]

Re: [R] filter one entry, in dependence of date

2014-07-23 Thread arun
Hi, If `dat` is the dataset: dat[!(dat$ID==2 & as.numeric(gsub("-.*","",dat$Month))<5),]   ID   Month Value 1  1 03-2014 1 2  1 04-2014    10 3  1 05-2014    50 6  2 05-2014 4 7  2 06-2014 2 A.K. hello together, i have a short question, maybe you can help me. I have a data.frame li

Re: [R] Importing random subsets of a data file

2014-07-23 Thread James White
Here's a stack overflow question addressing the same issue. http://stackoverflow.com/a/22261345 Hopefully it will help. Thanks > Date: Wed, 23 Jul 2014 12:33:11 -0300 > From: khurram.na...@gmail.com > To: r-help@r-project.org > Subject: [R] Importing random subsets of a data file > > Hi R folks,

Re: [R] Expressing a multinomial GLM as a series of binomial GLMs

2014-07-23 Thread John Fox
Dear Christoph, I don't see how what you suggest can work in a mixed-effects model. In the case you originally raised, of independent observations, you should be able to recover the coefficients for the multinomial logit model by fitting the logits that I suggested in my earlier email, but not

Re: [R] corresponding replicated el of one matrix in another matrix or vector

2014-07-23 Thread Uwe Ligges
On 23.07.2014 22:15, carol white wrote: How to keep the same order of elements as v2 for the new matrix? Oh, come on, read the help files for the functions I provided! t(merge(data.frame(V2=v2), as.data.frame(v1), sort = FALSE)) Best, Uwe Ligges v3 [,1] [,2] [,3] [,4] [,5] [,6]

Re: [R] corresponding replicated el of one matrix in another matrix or vector

2014-07-23 Thread carol white
How to keep the same order of elements as v2 for the new matrix? > v3 [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14] [1,] "a"  "a"  "a"  "a"  "a"  "c"  "c"  "c"  "c"  "c"   "c"   "c"   "c"   "c"  [2,] "1"  "1"  "1"  "1"  "1"  "3"  "3"  "3"  "3"  "3"   "3"   "3"  

Re: [R] corresponding replicated el of one matrix in another matrix or vector

2014-07-23 Thread Uwe Ligges
On 23.07.2014 21:16, carol white wrote: Hi, I have a matrix of unique elements (strings) like v1 and a vector which contains replicated values of the 2nd column of the first matrix. v1 = cbind(c("1","2","3"),c("a","b","c")) v2 = c(rep("a",5), rep("c",10), rep("b",3)) How can I add a column

Re: [R] Expressing a multinomial GLM as a series of binomial GLMs

2014-07-23 Thread Christoph Scherber
Dear John and R-helpers, Thanks for your replies that were both very helpful. The reason I was asking is that I´m searching for an easier way to incorporate *random effects* in a multinomial model. I was hoping that *combinations of binomial glmmPQL or lmer calls* might be able to do the job

[R] corresponding replicated el of one matrix in another matrix or vector

2014-07-23 Thread carol white
Hi, I have a matrix of unique elements (strings) like v1 and a vector which contains replicated values of the 2nd column of the first matrix. v1 = cbind(c("1","2","3"),c("a","b","c")) v2 = c(rep("a",5), rep("c",10), rep("b",3)) How can I add a column to v2 that contains the values of the first

Re: [R] Importing random subsets of a data file

2014-07-23 Thread Khurram Nadeem
It is great to see so many nice resources available. Thanks for the suggestions and directing me to useful solutions. Using the 'awk' code within R seems very promising for my problem. Also, I am looking into reading the random samples from SQLite database as indicated by Greg. As my algorithm runs

Re: [R] Importing random subsets of a data file

2014-07-23 Thread Greg Snow
For speed your best choice is probably to load your data into a database, then pull your samples from the database. A simple database is SQLite and there are R packages that work directly with that database. Can the later samples contain some of the same rows as previous samples? Or once a row i

Re: [R] Application design.

2014-07-23 Thread Joe W. Byers
On 07/21/2014 09:24 PM, John McKown wrote: I'm designing an R based application for my boss. It's not much, but it might save him some time. What it will be doing is reading data from an MS-SQL database and creating a number of graphs. At present, he must log into one server to run a vendor appli

Re: [R] Importing random subsets of a data file

2014-07-23 Thread David Winsemius
I think an external program like awk (or gawk) would be better. You can call it with the R system() function if needed. http://stackoverflow.com/questions/7514896/select-random-3000-lines-from-a-file-with-awk-codes You might want to sample once and then break into sequential subsets rather than

Re: [R] shading cells in a latex table by value

2014-07-23 Thread Michael Friendly
Thanks, Duncan That's quite lovely, and makes me appreciate the tables package even more, so I'll have to study your details. The more general version of this idea is that rendering values in a latex table with visual attributes (background color, font color, font family, font shape, font weight)

Re: [R] Importing random subsets of a data file

2014-07-23 Thread Sarah Goslee
Hi, You can use scan() with the nlines and skip arguments to read in a single line from anywhere in a file. Sarah On Wed, Jul 23, 2014 at 11:33 AM, Khurram Nadeem wrote: > Hi R folks, > > Here is my problem. > > *1.* I have a large data file (say, in .csv or .txt format) containing 1 > million

[R] Importing random subsets of a data file

2014-07-23 Thread Khurram Nadeem
Hi R folks, Here is my problem. *1.* I have a large data file (say, in .csv or .txt format) containing 1 million rows and 500 variables (columns). *2.* My statistical algorithm does not require the entire dataset but just a small random sample from the original 1 million rows. *3. *This algorit

Re: [R] shading cells in a latex table by value

2014-07-23 Thread Duncan Murdoch
On 23/07/2014, 9:31 AM, Michael Friendly wrote: > I want to create latex tables of values where the cell background is > shaded according to the > table value. For example: > > set.seed(1) # reproducibility > mat <- matrix(3 * rnorm(12), 3, 4) > rownames(mat) <- letters[1:3] > colnames(mat) <- L

Re: [R] Dx accuracy measures from raw data

2014-07-23 Thread Sarah Goslee
Hi, I'm pretty sure you posted this exact question already. Usually if you don't get any replies, it means your question is badly-formed. Posting the same thing won't help any. Posting a revised version might. Your example data is not really helpful to someone trying to suggest R code, since it's

[R] Dx accuracy measures from raw data

2014-07-23 Thread Anoop Shah
Hello R users! I am a medic and have been working with R for about 6 months now. I was hoping to pick someone’s brain about a diagnostic accuracy study that has now been completed. I am trying to derive the sensitivity, specificity, NPV and PPV with the corresponding 95% CI from the raw data.

Re: [R] Trying to change a qplot() to a ggplot()+

2014-07-23 Thread John McKown
I got an off-line reply which fixed my problem. And, it is a good thing my cataract surgery is soon, no? turns out that qqplot and ggplot are not the same! . But the font in notepad on Windows is such that I have difficulty in telling the difference. On Wed, Jul 23, 2014 at 8:47 AM, John McKown w

Re: [R] Trying to change a qplot() to a ggplot()+

2014-07-23 Thread ONKELINX, Thierry
It is ggplot (double G), not qqplot (double Q) ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance Kliniekstraat 25 1070 Anderlecht Belgium + 32 2 525 02 51 + 32 54 43 61 85 th

[R] Trying to change a qplot() to a ggplot()+

2014-07-23 Thread John McKown
I'm trying to change a qplot to a ggplot. The reason is because I want two plots of the same data. One a bar char, the other a line graph. What I'm trying: #MSU_graph_m1b <- qplot(Int_Start,LicPrLsys4HMSU,data=cpprdald2_m1,geom="bar",stat="identity",color=System_alias); MSU_graph_m1 <- qqplot(c

Re: [R] Windows R doesn't recognize shortcuts ?

2014-07-23 Thread ce
Indeed DOS command doesn't work neither . cygwin.lnk list itself but not what is in the folder : dir cygwin Volume in drive C is WINDOWS Volume Serial Number is F410-6A8D Directory of C:\Users\me\Desktop File Not Found dir cygwin.lnk Volume in drive C is WINDOWS Volume Serial Number is F4

[R] shading cells in a latex table by value

2014-07-23 Thread Michael Friendly
I want to create latex tables of values where the cell background is shaded according to the table value. For example: set.seed(1) # reproducibility mat <- matrix(3 * rnorm(12), 3, 4) rownames(mat) <- letters[1:3] colnames(mat) <- LETTERS[1:4] > round(mat,1) AB CD a -1.9 4.8 1.

Re: [R] Windows R doesn't recognize shortcuts ?

2014-07-23 Thread Duncan Murdoch
On 23/07/2014 9:08 AM, ce wrote: Hi All, In Windows 7 , R installation: R version 3.1.1 Patched (2014-07-14 r66149) -- "Sock it to Me" Copyright (C) 2014 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 (64-bit) it doesn't recognize shortcuts in path : > list.files

[R] Windows R doesn't recognize shortcuts ?

2014-07-23 Thread ce
Hi All, In Windows 7 , R installation: R version 3.1.1 Patched (2014-07-14 r66149) -- "Sock it to Me" Copyright (C) 2014 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 (64-bit) it doesn't recognize shortcuts in path : > list.files(path = "cygwin") character(0) cyg

Re: [R] R_HOME setting on Linux

2014-07-23 Thread Prof Brian Ripley
I am guessing this is a distribution prepared by someone else, with non-default settings for where things are installed. If you do that, there is no guarantee that you can test the installed R, as the tests do generally assume the standard layout. If you change this test to use file.path(R.ho

[R] R_HOME setting on Linux

2014-07-23 Thread Richard Chandler-Mant
I have an installation of R 3.0.2 on a CentOS 6.3 distribution in /opt/R/3.0.2 In the R start-up script (/opt/R/3.0.2/bin/R) the value of R_HOME is set to /opt/R/3.0.2/lib/R and this is the value returned from the R.home() function within an R session. According to the installation documentatio

[R] Feature Selection and Regression

2014-07-23 Thread npan1990 .
Hello, I would like to perform feature selection in a set of features that are used for regression. Especially, those features correspond to the previous day values (e.g Lag24,Lag25,Lag26...) where lag24 is the value 24 hour before. The target variable y is the value at the current time (Using pas

[R] dx accuracy measures from raw data

2014-07-23 Thread Byron Dom
Here is a partial answer (I think (?)) A common way to display results of this type is as a "receiver operating characteristic." See:  http://en.wikipedia.org/wiki/Receiver_operating_characteristic It's displayed as a parametric curve where the parameter is the threshold value, the x-value (abs

[R] need help for ppval() and xirr() in R

2014-07-23 Thread Sowmya Rudregowda
Hi , My name is sowmya. I am new to R language. I need "ppval()" and "xirr()" matlab function in R. What exactly ppval() in matlab does , i need to that in R language. Even xirr() of matlab ,i need it in R language, with the packages which it needs . Please help. Thanks sowmyaR [[alter