[R] Removing the rows from dataset

2012-04-24 Thread santoshdvn
Hi, I have data set where i have col1,col2,col3,col4 i want to write a condition where the rows has to removed from the dataset for col1>10 Please help, Thanks Santosh -- View this message in context: http://r.789695.n4.nabble.com/Removing-the-rows-from-dataset-tp4585710p4585710.html Sent fro

[R] How to reduce plot size on linux?

2012-04-24 Thread Manish Gupta
Hi, I am working on linux and i need to reduce plot size (bar plot) so that i can easily use in sweave. How can i implement it? Regards -- View this message in context: http://r.789695.n4.nabble.com/How-to-reduce-plot-size-on-linux-tp4585371p4585371.html Sent from the R help mailing list archi

Re: [R] "Conditional" average

2012-04-24 Thread Christopher W. Ryan
Kebrab67-- It's difficult to answer in the absence of a small bit of representative data, and more information about it. How is age76 recorded, as numerical years or in categories (age ranges?) And what are years (you didn't mention them as a variable in your data.) That being said, perhaps

[R] Combining local data frame with external data

2012-04-24 Thread omezquita
Hi, I have a list of IDs on a data frame and I want to extract information for those IDs from an external database. I did a workaround using the "IN" clause in SQL but when the number of IDs is big this method doesn't work. In other words, I want to create a join between a local and a external

[R] Using apply() with a function involving ode()

2012-04-24 Thread Adam Zeilinger
Hello, I am trying to get the output from the numerical simulation of a system of ordinary differential equations for a range of values for three parameters. I am using the ode() function (deSolve package) to run the numerical simulation and apply() to run the simulation function for each se

[R] trouble installing SparseM

2012-04-24 Thread Erin Hodgess
Dear R People: I am attempting to install SparseM on R 2.15.0 on a Linux 11.10 system. Here is the output > install.packages("SparseM",depen=TRUE) Installing package(s) into ‘/home/erin/R/x86_64-pc-linux-gnu-library/2.15’ (as ‘lib’ is unspecified) --- Please select a CRAN mirror for use in this s

Re: [R] Basic matrix manipulation problem

2012-04-24 Thread Petr Savicky
On Tue, Apr 24, 2012 at 01:36:25PM -0700, Hans Thompson wrote: > Hello, this forum was very helpful yesterday with a simple question I had on > working with tables. What function will I need to use to do the following. > > Move matrix a: > >AB C D > x1234 > y

[R] FW: [BioC] Overlay Gene Expression on SNP (copy number) data

2012-04-24 Thread Ekta Jain
Dear All, Thank you kindly for such detailed replies. I was looking to overlay data using algorithms so that i am able to tell which genes are differentially expressed due to changes in copy number. I did a pubmed search and found only 7 literature pieces all of which use in-house algorithms. I

Re: [R] Accessing a list

2012-04-24 Thread Jim Silverton
Hi, I have the following problem- I want to access a list whose elements are imp1, imp2, imp3 etc I tried theusing the paste comand in a for loop see the last for loop below. But I keep calling it df but df = imp1 (for the first run). Any ideas on how I can access the elements of the list? Isaac

Re: [R] Rprofile.site on Windows

2012-04-24 Thread Duncan Murdoch
On 12-04-24 10:43 PM, Duncan Murdoch wrote: On 12-04-24 4:13 PM, Trevor Miles wrote: Hi All I am struggling to get R to read the Rprofile.site file from the R_HOME/etc folder. I know it isn't working because I change the prompt in the Rprofile.site file. In addition, when I run "source('R_HO

Re: [R] Rprofile.site on Windows

2012-04-24 Thread Duncan Murdoch
On 12-04-24 4:13 PM, Trevor Miles wrote: Hi All I am struggling to get R to read the Rprofile.site file from the R_HOME/etc folder. I know it isn't working because I change the prompt in the Rprofile.site file. In addition, when I run "source('R_HOME'/etc/Rprofile.site") from the prompt, the

Re: [R] automating a script to read a file

2012-04-24 Thread ilai
On Tue, Apr 24, 2012 at 6:00 PM, Steve Friedman wrote: > The original post does contain the function plot.spdf and some sample data. That's great. And who's responsibility is it to make sure we have context for THIS post ? This is a mailing list, not a forum and MY mail client doesn't keep track

Re: [R] "Conditional" average

2012-04-24 Thread R. Michael Weylandt
In base R, you probably want either ave() or tapply() (depending on how you want your results formatted) for a quick and dirty solution. aggregate() will get you there and allow more powerful transformations with a little more work. All of these have examples in the help pages that should get you s

Re: [R] How to test if a slope is different than 1?

2012-04-24 Thread Rolf Turner
On 25/04/12 02:17, Mark Na wrote: > Hi Greg. Thanks for your reply. Do you know if there is a way to use the > confint function to get a p-value on this test? In general it is at least *roughly* true that one rejects H_0: theta = theta_0 vs. H_a: theta != theta_0 at significance level alpha if and

Re: [R] load only one object from a .RData file

2012-04-24 Thread Shi, Tao
Thank you, Michael and Henrik.  I'll try what you suggested. > > From: Henrik Bengtsson >To: "Shi, Tao" >Cc: "r-help@r-project.org" >Sent: Tuesday, April 24, 2012 12:37 PM >Subject: Re: [R] load only one object from a .RData file > >You could do: > >library

[R] assign() and paste() for data.frame() in nested for loops

2012-04-24 Thread jssdenton
Hi folks, I am trying to recurse through several subfolders in a directory. Each folder has many entries that I want to display summary values for. I have been expanding data frames using code with the structure name <- rbind(name, newvals) to produce a data frame with n rows equal to the number o

[R] Rprofile.site on Windows

2012-04-24 Thread Trevor Miles
Hi All I am struggling to get R to read the Rprofile.site file from the R_HOME/etc folder. I know it isn't working because I change the prompt in the Rprofile.site file. In addition, when I run "source('R_HOME'/etc/Rprofile.site") from the prompt, the prompt gets changed and other environment

Re: [R] Assignment problems

2012-04-24 Thread Rui Barradas
Hello again, Try changing the lines where you create 'EMUmix3' and 'EMUmix4' by the following. EMUmix3 <- Reduce(`&`, lapply(countries, function(x,y){country1 %in% euro2 & !country2 %in% euro2})) # euro2 are also the EMUcountries, BUT in 2001 Greece became a EMU member. So in the interval (1999

Re: [R] Assignment problems

2012-04-24 Thread phillip03
Thank you David! That was EXACTLY what I needed. I have one last question: I want to create a mix of EMU and nonEMU country pairs. I have tried with: EMUmix1<-Reduce(`&`, lapply(countries,function(x,y){country1 %in% euro & country2 %in% noneuro})) # Where euro are the EMU countries and none

Re: [R] Use quotes on a FOR LOOP R

2012-04-24 Thread Mercier Eloi
for (n in LIST2) print(as.character(n)) [1] "Michael" [1] "Dana" [1] "Rob" Eloi On 12-04-24 12:22 PM, R. Michael Weylandt wrote: Don't you just want LIST<- as.data.frame(LIST, stringsAsFactors = FALSE) # Avoid making factors for(n in LIST) print(n) But I can't understand why you want to do i

[R] Basic matrix manipulation problem

2012-04-24 Thread Hans Thompson
Hello, this forum was very helpful yesterday with a simple question I had on working with tables. What function will I need to use to do the following. Move matrix a: AB C D x1234 y5678 to the mean of B&C and C&D: BC CD x 2.5 3.5 y

Re: [R] Use quotes on a FOR LOOP R

2012-04-24 Thread michaelyb
Mercier - That is it! Thank you vey much! -- View this message in context: http://r.789695.n4.nabble.com/Use-quotes-on-a-FOR-LOOP-R-tp4584438p4584627.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list htt

[R] "Conditional" average

2012-04-24 Thread kebrab67
Hello, I have a set of data including age, wage and education level each called age76, wage76 and grade76 I want to know how i can calculate the average wage of people age 15 to 65 (each year separetly) , only for those who have an education level of 10 12 and 16... -- View this message in contex

Re: [R] Simple matrix transformation question

2012-04-24 Thread Henry
Jeff, Thanks we are looking at that (reshape2 and dcast) now. -Henry -- View this message in context: http://r.789695.n4.nabble.com/Simple-matrix-transformation-question-tp4585044p4585247.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] Simple matrix transformation question

2012-04-24 Thread Henry
Jeff, Thanks we are looking at that (reshape2 and dcast) now. -Henry -- View this message in context: http://r.789695.n4.nabble.com/Simple-matrix-transformation-question-tp4585044p4585246.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] returning functions inside lapply

2012-04-24 Thread Duncan Murdoch
On 12-04-24 7:34 PM, Ali Tofigh wrote: Many thanks to both Duncan and Bert for clarifying this. Having looked carefully at what you both wrote, my conclusion is the following: in this code below f<- function(x) {function() {x}} b<- lapply(1:3, f) lapply does not actually call f with the values

Re: [R] automating a script to read a file

2012-04-24 Thread ilai
On Tue, Apr 24, 2012 at 2:09 PM, wrote: > library(latticeExtra) >> doubleYScale(hist("mydata", breaks=20, prob=T,  xlim=c(-100, 2000), > plot.spdf(x), use.style=FALSE) > > This does not work as doubleYScale expects histogram and densityplot,  and > I'd like to use the plot.spdf routine in its pl

Re: [R] Simple matrix transformation question

2012-04-24 Thread Jeff Newmiller
library(reshape2) ?dcast --- Jeff NewmillerThe . . Go Live... DCN:Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing

Re: [R] returning functions inside lapply

2012-04-24 Thread Ali Tofigh
Many thanks to both Duncan and Bert for clarifying this. Having looked carefully at what you both wrote, my conclusion is the following: in this code below f <- function(x) {function() {x}} b <- lapply(1:3, f) lapply does not actually call f with the values 1, 2, and 3. Instead, it calls f three

Re: [R] Errors Updating Libraries (2.15) [RESOLVED]

2012-04-24 Thread Rich Shepard
On Tue, 24 Apr 2012, Duncan Murdoch wrote: So what do you mean by "same issues"? Do they all complain about reshape2, or not? Duncan, They all mention reshape2 because that's saved from the first R session today. But, they show the same errors as did reshape2 for each individual package.

Re: [R] Errors Updating Libraries (2.15)

2012-04-24 Thread Peter Langfelder
On Tue, Apr 24, 2012 at 3:05 PM, Rich Shepard wrote: > On Tue, 24 Apr 2012, Rich Shepard wrote: > >>  I'll rebuild R-2.15 and start over. Will post results after doing that. > > >  New build, new repository, same results. > >  Quite the new experience with R, but one I need to quickly put behind m

Re: [R] Errors Updating Libraries (2.15)

2012-04-24 Thread Duncan Murdoch
On 12-04-24 6:46 PM, Rich Shepard wrote: On Tue, 24 Apr 2012, Duncan Murdoch wrote: As far as I've seen, all your error messages have been about problems installing reshape2, you haven't had trouble with other packages. Same issues with ISwR, RPostgreSQL, deSolve and other packages. So

Re: [R] Simple matrix transformation question

2012-04-24 Thread Henry
I didn't say how I would read it in... I assume just read in using read.table but I didn't try that. So I guess that is another part of the question. -- View this message in context: http://r.789695.n4.nabble.com/Simple-matrix-transformation-question-tp4585044p4585112.html Sent from the R help ma

Re: [R] Errors Updating Libraries (2.15)

2012-04-24 Thread Rich Shepard
On Tue, 24 Apr 2012, Duncan Murdoch wrote: As far as I've seen, all your error messages have been about problems installing reshape2, you haven't had trouble with other packages. Same issues with ISwR, RPostgreSQL, deSolve and other packages. So you really want to look closely at reshape2.

Re: [R] Bhat package and plkhci function

2012-04-24 Thread R. Michael Weylandt
It seems to have been moved to the CRAN archives but you can find old versions here: http://cran.r-project.org/src/contrib/Archive/Bhat/ They might not work well with newer versions of R however. Michael On Tue, Apr 24, 2012 at 4:45 PM, Liao, Hongsheng wrote: > Where can I download Bhat package

Re: [R] Errors Updating Libraries (2.15)

2012-04-24 Thread Duncan Murdoch
On 12-04-24 6:05 PM, Rich Shepard wrote: On Tue, 24 Apr 2012, Rich Shepard wrote: I'll rebuild R-2.15 and start over. Will post results after doing that. New build, new repository, same results. Quite the new experience with R, but one I need to quickly put behind me. Can some

Re: [R] returning functions inside lapply

2012-04-24 Thread Duncan Murdoch
On 12-04-24 5:13 PM, Ali Tofigh wrote: On Tue, Apr 24, 2012 at 16:57, Duncan Murdoch wrote: I thought that lapply calls f three times and returns a list with whatever f returned. Is this not so? That is so. In each case, f creates a function that looks in its enclosing environment for the va

[R] Simple matrix transformation question

2012-04-24 Thread Henry
I know this is likely very simple. I want to change a matrix that was given to me not sorted by timestamp to sorted by timestamp. It was sorted by CRAH_Name. There are 264k records initially. The CRAH names start at 11 and go to 98 but there are a number of missing values (CRAH_Name), total ap

Re: [R] Errors Updating Libraries (2.15)

2012-04-24 Thread Rich Shepard
On Tue, 24 Apr 2012, Rich Shepard wrote: I'll rebuild R-2.15 and start over. Will post results after doing that. New build, new repository, same results. Quite the new experience with R, but one I need to quickly put behind me. Can someone suggest a test procedure to isolate the reaso

Re: [R] returning functions inside lapply

2012-04-24 Thread Ali Tofigh
On Tue, Apr 24, 2012 at 16:57, Duncan Murdoch wrote: >> I thought that >> lapply calls f three times and returns a list with whatever f >> returned. Is this not so? > > That is so.  In each case, f creates a function that looks in its enclosing > environment for the variable x to be returned. > >

Re: [R] Remove top/right border from lattice plots

2012-04-24 Thread ilai
You need to do a little more work to add the components you want "back in". I think you want something like: xyplot( Sepal.Length ~ Petal.Length, auto.key=T, data=iris, par.settings = list(axis.line = list(col = 0)),scales=list(col=1,tck=c(1,0)), panel=function(...){ lims <- current.panel.lim

Re: [R] returning functions inside lapply

2012-04-24 Thread Duncan Murdoch
On 12-04-24 4:22 PM, Ali Tofigh wrote: This has been asked before, but I just cannot figure out why lapply should behave this way given that R uses lazy evalution. Even after reading (or at least trying to read) parts of the R language definition. f<- function(x) {function() {x}} a<- list(f(1),

[R] Bhat package and plkhci function

2012-04-24 Thread Liao, Hongsheng
Where can I download Bhat package? I need to use plkhci function in this package, which estimates confidence interval using likelihood ratio. Thanks. Hongsheng (Hank) Liao, PhD. Lab Manager Center for Quantitative Fisheries Ecology Old Dominion University 757-683-4571 [[alternative

Re: [R] Errors Updating Libraries (2.15)

2012-04-24 Thread R. Michael Weylandt
Perhaps change mirror as well. Michael On Apr 24, 2012, at 4:29 PM, Rich Shepard wrote: > On Tue, 24 Apr 2012, R. Michael Weylandt wrote: > >> system.time(install.packages(c("plyr","reshape2","stringr"), type = >> "source")) > > Strange. Same results: > > Error in library(reshape2) : ther

Re: [R] Errors Updating Libraries (2.15)

2012-04-24 Thread Rich Shepard
On Tue, 24 Apr 2012, R. Michael Weylandt wrote: system.time(install.packages(c("plyr","reshape2","stringr"), type = "source")) Strange. Same results: Error in library(reshape2) : there is no package called ‘reshape2’ Execution halted Error in library(reshape2) : there is no package called ‘

Re: [R] Errors Updating Libraries (2.15)

2012-04-24 Thread Rich Shepard
On Tue, 24 Apr 2012, R. Michael Weylandt wrote: For the ones you named, you should be able to install them from source pretty easily: system.time(install.packages(c("plyr","reshape2","stringr"), type = "source")) Michael, Thanks. Since I have all the GNU build tools installed, and build mo

[R] returning functions inside lapply

2012-04-24 Thread Ali Tofigh
This has been asked before, but I just cannot figure out why lapply should behave this way given that R uses lazy evalution. Even after reading (or at least trying to read) parts of the R language definition. > f <- function(x) {function() {x}} > a <- list(f(1), f(2), f(3)) > a[[1]]() # as expecte

Re: [R] automating a script to read a file

2012-04-24 Thread Steve_Friedman
Petr, R- Users The scheme you provided yesterday worked very well. I am now trying to add more information to the graph(s) to make them more informative for my purposes. Essentially, I am trying to use a double Y axis graphic that will include the skew normal curves that I wrote about yesterday

Re: [R] Errors Updating Libraries (2.15)

2012-04-24 Thread R. Michael Weylandt
For the ones you named, you should be able to install them from source pretty easily: system.time(install.packages(c("plyr","reshape2","stringr"), type = "source")) takes me about 20 seconds. plyr does have some compiled code though so you might need tools. The other two are all interpreted code

Re: [R] load only one object from a .RData file

2012-04-24 Thread Henrik Bengtsson
You could do: library("R.utils"); value <- loadToEnv("MyFile.RData")[["nameOfObject"]]; It still load all of the data, but it is not kept; only the object you grab. /Henrik On Tue, Apr 24, 2012 at 11:30 AM, Shi, Tao wrote: > Hi list, > > > Is there a way to load one specific object from a .RDa

Re: [R] How do i read the source code of "biplot"?

2012-04-24 Thread R. Michael Weylandt
Please... read the help and use the function properly. E.g., library(Matrix) # Since you haven't said what package you're using show # Is a standard generic showMethods("show") # Lots of methods available getMethod("show", "dsyMatrix") # Get a specific method for that generic # Turns o

Re: [R] load only one object from a .RData file

2012-04-24 Thread R. Michael Weylandt
I don't think so -- you want to use saveRDS and readRDS if you want to do that. However, if you are given someone else's .RData and need to avoid a name collision, this might work. loadOneName <- function(objName, file, envir = parent.frame(), assign.on.exit = TRUE) { tempEnv <- new.env()

Re: [R] How do i read the source code of "biplot"?

2012-04-24 Thread Michael
It doesnot give any source code... I want to reduce the number of the red arrows...to 1 or 2 ... i.e. I want to see the major and the 2nd major axis direction of the PCA ellipsoidal > getMethod("biplot") Method Definition (Class "derivedDefaultMethod"): function (x, ...) UseMethod("biplot")

Re: [R] Scatter plot / LOESS, or LOWESS for more than one parameter

2012-04-24 Thread David Doyle
Hi Greg, Sloved my own problem. I had some missing data "NA" in the datasets. So I manually entered the ylim=range(4,6) and it worked!!! Thanks!! David On Tue, Apr 24, 2012 at 1:55 PM, David Doyle wrote: > Hi Greg, > > Thanks, > > I got the 1st example to work using the following code: > > >

Re: [R] Use quotes on a FOR LOOP R

2012-04-24 Thread R. Michael Weylandt
Don't you just want LIST <- as.data.frame(LIST, stringsAsFactors = FALSE) # Avoid making factors for(n in LIST) print(n) But I can't understand why you want to do it this way I'll presume this makes more sense in your application. On Tue, Apr 24, 2012 at 2:29 PM, michaelyb wrote: > Hello A

[R] Use of optim to fit two curves at the same time ?

2012-04-24 Thread Arnaud Mosnier
Dear list, Here is a small example code that use optim and optimize in order to fit two functions. Is it possible to fit two functions (like those two for example) at the same time using optim ... or another function in R ? Thanks Arnaud #

Re: [R] Errors Updating Libraries (2.15)

2012-04-24 Thread Rich Shepard
On Tue, 24 Apr 2012, Rich Shepard wrote: Actually, it's because OSU's Open Source Lab CRAN repository has almost no packages for 2.15. I'm now searching for a repository that has what I need. This is apparently not the case because there are no more listings in the 14.x directories than in

Re: [R] Compiling RMySQL on Win7 64bits RS-DBI.c:1:0: sorry, unimplemented: 64-bit mode not compiled in

2012-04-24 Thread Ben Rhelp
Thank you very much Uwe for pointing me in the right direction. The solution is to specify the path as: D:\BenSave\Rtools\bin;D:\BenSave\Rtools\gcc-4.6.3\bin;D:\BenSave\Rtools\MinGW\bin;D:\BenSave\R\R-2.15.0\bin; the reason is in Rtools\MinGW\bin there is a gcc.exe which does not seems to work

[R] load only one object from a .RData file

2012-04-24 Thread Shi, Tao
Hi list, Is there a way to load one specific object from a .RData file which contains multiple data objects?  Thanks, ...Tao __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://ww

[R] Use quotes on a FOR LOOP R

2012-04-24 Thread michaelyb
Hello All! I need some help to get a FOR LOOP to print the interactor with the quotation mark. Let me be more specific: I have the following: cbind("Michael","Dana","Rob")->LIST outcome: [,1] [,2] [,3] [1,] "Michael" "Dana" "Rob" UNFORTUNATELY, I need to do the following: as.data

Re: [R] .rda vs. .RData

2012-04-24 Thread Shi, Tao
Thank you, all! > > From: Barry Rowlingson >To: Jeff Newmiller >Cc: "Shi, Tao" ; Ista Zahn ; >"r-help@r-project.org" >Sent: Tuesday, April 24, 2012 12:36 AM >Subject: Re: [R] .rda vs. .RData > >On Tue, Apr 24, 2012 at 12:51 AM, Jeff Newmiller > wrote: >> M

Re: [R] How do i read the source code of "biplot"?

2012-04-24 Thread R. Michael Weylandt
You have another package using an S4 for biplot -- vanilla R doesn't seem to set that generic... Anyways, the function you need is getMethod() Michael On Tue, Apr 24, 2012 at 2:44 PM, Michael wrote: >> biplot > > standardGeneric for "biplot" defined from package "stats" > > function (x, ...) >

Re: [R] Scatter plot / LOESS, or LOWESS for more than one parameter

2012-04-24 Thread David Doyle
Hi Greg, Thanks, I got the 1st example to work using the following code: data <- read.csv("http://doylesdartden.com/Monthly-pH-example.csv";, sep=",") attach(data) par(mfrow=c(2,1)) scatter.smooth( Year, MC.pH ) scatter.smooth( Year, MV.pH ) This is good but what I'm really looking for is t

Re: [R] Scatter plot / LOESS, or LOWESS for more than one parameter

2012-04-24 Thread David Doyle
Hi Michael, What I run into is that I have a lot of time-series data from groundwater wells but when plot it..it becomes way to busy to see what is going on. For example, here is the code to load and plot my Mammoth Cave rainfall pH data #Load data from web page data <- read.csv("http://doylesda

Re: [R] Scatter plot / LOESS, or LOWESS for more than one parameter

2012-04-24 Thread Greg Snow
Assuming that you want event as the x-axis (horizontal) you can do something like (untested without reproducible data): par(mfrow=c(2,1)) scatter.smooth( event, pH1 ) scatter.smooth( event, pH2 ) or plot( event, pH1, ylim=range(pH1,pH2) , col='blue') points( event, pH2, col='green' ) lines( loes

[R] How do i read the source code of "biplot"?

2012-04-24 Thread Michael
> biplot standardGeneric for "biplot" defined from package "stats" function (x, ...) standardGeneric("biplot") Methods may be defined for arguments: x Use showMethods("biplot") for currently available ones. > > > showMethods("biplot") Function: biplot (package stats) x="ANY" x="charact

Re: [R] Compiling RMySQL on Win7 64bits RS-DBI.c:1:0: sorry, unimplemented: 64-bit mode not compiled in

2012-04-24 Thread Uwe Ligges
On 24.04.2012 20:13, Ben Rhelp wrote: Hi Uwe, I tried removing D:\BenSave\Rtools\MinGW64\bin (and replacing it with D:\BenSave\Rtools\MinGW\bin) but the result is the same. If I try to run "install.packages('RMySQL', type = 'source')" on my R 32bits instance I get the following which seems

Re: [R] Compiling RMySQL on Win7 64bits RS-DBI.c:1:0: sorry, unimplemented: 64-bit mode not compiled in

2012-04-24 Thread Ben Rhelp
Hi Uwe, I tried removing D:\BenSave\Rtools\MinGW64\bin (and replacing it with D:\BenSave\Rtools\MinGW\bin) but the result is the same. If I try to run "install.packages('RMySQL', type = 'source')" on my R 32bits instance I get the following which seems to be due to having a MySQL server 64bits

[R] Remove top/right border from lattice plots

2012-04-24 Thread Jon Zadra
Hi, I've done my best to search for a solution to this, but had no luck. How can I create a lattice plot (I'm using xyplot() ) that does not have a border on the top and right side, but keeps the bottom/left axes? So far all I've found is this, which inserted into the xyplot call removes all

Re: [R] how to cumulate up times

2012-04-24 Thread R. Michael Weylandt
Perhaps the easiest way: library(lubridate) tms <- as.POSIXct("2007-12-05 09:45:00", format = "%Y-%m-%d %H:%M:%S") tms + days(3) Michael On Tue, Apr 24, 2012 at 12:27 PM, Santosh wrote: > Hello .. > > A really simple question for you. for some reason I am not getting it > right.. > > How do I a

Re: [R] searchina a pattern in a string

2012-04-24 Thread Gabor Grothendieck
On Tue, Apr 24, 2012 at 10:52 AM, arunkumar wrote: > I have a long string. i want to sepearate a 10 digit phone no from it. > > eg > > > "my no is 9876543210 is personal no and my official no is 123-456-8907. you > can use any of these" > > i want to seperate the 9876543210 and 123-456-8907 fr

Re: [R] Errors Updating Libraries (2.15)

2012-04-24 Thread Rich Shepard
On Tue, 24 Apr 2012, Jeff Newmiller wrote: Perhaps you are not seeing the contact info for the package maintainer? Actually, it's because OSU's Open Source Lab CRAN repository has almost no packages for 2.15. I'm now searching for a repository that has what I need. Regards, Rich _

Re: [R] Selecting columns whose names contain "mutated" except when they also contain "non" or "un"

2012-04-24 Thread Rui Barradas
Hello, Greg Snow wrote > > Here is a method that uses negative look behind: > >> tmp <- c('mutation','nonmutated','unmutated','verymutated','other') >> grep("(? [1] 1 4 > > it looks for muta that is not immediatly preceeded by un or non (but > it would matc

Re: [R] Compiling RMySQL on Win7 64bits RS-DBI.c:1:0: sorry, unimplemented: 64-bit mode not compiled in

2012-04-24 Thread Uwe Ligges
On 24.04.2012 16:40, Ben Rhelp wrote: Hi, On a Win7 64 bit, I have installed: *R-15.0 and I am running it in 64bits *Rtools215.exe*MySQL 5.5.23 64bits My PATH start with D:\BenSave\Rtools\bin;D:\BenSave\Rtools\MinGW64\bin;D:\BenSave\R\R-2.15.0\bin;D:\BenSave\Rtools\MinGW\bin;D:\BenSave\Rtool

Re: [R] searchina a pattern in a string

2012-04-24 Thread Tal Galili
If it was only numbers with no dashes or up to 2 dashes, you can do it like this: require(stringr) STRING <- "my no is 9876543210 is personal no and my official no is 123-456-8907. you can use any of these" str_extract_all( STRING , "[0-9]+-*[0-9]+-*[0-9]+") (and then clean the numbers...) ---

Re: [R] Errors Updating Libraries (2.15)

2012-04-24 Thread Rich Shepard
On Tue, 24 Apr 2012, Jeff Newmiller wrote: Perhaps you are not seeing the contact info for the package maintainer? Jeff, How does this affect downloading and building packages for the most curent version of R? I get the same errors when trying to install other packages in the ../2.15/ su

Re: [R] how to cumulate up times

2012-04-24 Thread Santosh
Hello .. A really simple question for you. for some reason I am not getting it right.. How do I add time (in specified units) to a column of observed date/time (say a date-time in ISO 8601 format). For example, "2007-12-05T09:45:00" + 3 days "2007-13-05T09:45:00" + 3 hours Thanks so much! Sant

Re: [R] Errors Updating Libraries (2.15)

2012-04-24 Thread Jeff Newmiller
Perhaps you are not seeing the contact info for the package maintainer? ?maintainer --- Jeff NewmillerThe . . Go Live... DCN:Basics: ##.#. ##.#. Live Go...

Re: [R] How to insert filename as column in a file

2012-04-24 Thread Jeff Newmiller
Programatically dealing with large numbers of separately-named objects leads to syntactically complicated code that is hard to read and maintain. Load the data frames into a list so you can access them by numeric or named index, and then getting at the loaded data will be much easier. fnames =

Re: [R] how to cumulate up times

2012-04-24 Thread René Mayer
Thanks Michael, cumsum - yes of course! Regards, René Zitat von "R. Michael Weylandt" : ? cumsum something like library(chron) # Reporting packages you use is always considerate mt <- times(c('00:05:00', '00:15:00', '00:30:00')) # Spaces are legible! times("09:30:00") + cumsum(mt) Michael

Re: [R] Multiple Conditional Statement

2012-04-24 Thread Bert Gunter
"=" != "==" . -- Bert On Tue, Apr 24, 2012 at 8:18 AM, Vincy Pyne wrote: > Dear R helpers, > > I have two separate data frames. In one data frame the transaction data is > stored and the other data frame has exchange rates stored say rate_A and > rate_B where rate_A and rate_B are series of ra

[R] Errors Updating Libraries (2.15)

2012-04-24 Thread Rich Shepard
I just upgraded from 2.14 to 2.15 and have run into an issue upgrading libraries that I've not had in previous version upgrades. For example, trying to install reshape2 for 2.15 throws errors and I don't see what to change to over come the problem: install.packages("reshape2") Installing pack

Re: [R] how to cumulate up times

2012-04-24 Thread R. Michael Weylandt
? cumsum something like library(chron) # Reporting packages you use is always considerate mt <- times(c('00:05:00', '00:15:00', '00:30:00')) # Spaces are legible! times("09:30:00") + cumsum(mt) Michael On Tue, Apr 24, 2012 at 11:35 AM, René Mayer wrote: > Dear List, > given a vecor of times i

[R] how to cumulate up times

2012-04-24 Thread René Mayer
Dear List, given a vecor of times in 5,15 and 30 minutes and a start point in time, lets say 09:30:00, how do I add up those times to the start time getting a cumulative time sequence? mt<-times(c('00:05:00', '00:15:00', '00:30:00')) mt wanted 00:05:00 09:35:00 00:15:00 09:50:00 00:30:00 10

[R] Splitting data into test and train (80:20) kepping attributes similar

2012-04-24 Thread Dwaipayan Dasgupta
Hi, I am trying to do some predictive modeling around attrition and want to split the dataset into test and train (80:20) and keep the ratio of attritees:non attrites same. In my dataset the attrition indicator is coded as 0(for non-attritees) and 1 (for attritees) and I want to keep the ratio o

[R] Multiple Conditional Statement

2012-04-24 Thread Vincy Pyne
Dear R helpers, I have two separate data frames. In one data frame the transaction data is stored and the other data frame has exchange rates stored say rate_A and rate_B where rate_A and rate_B are series of rates. rate_A and rate_B are properly defined and I am reading them through the appr

Re: [R] take data from a file to another according to their correlation coefficient

2012-04-24 Thread Rui Barradas
Hello, Try putting the function call in a lapply, along lst <- lapply(list.files(path, pattern), read.table, header=TRUE, stringsAsFactors=FALSE) You don't stricktly need a list for na.fill, but you do need two data.frames, not filenames. The list is used by the other functions. (It's also a goo

[R] perform multiple regression with loop

2012-04-24 Thread Kristi Glover
Hi everyone, I am writing this to get your help. I have a big data set and I wanted to do multiple regression and repeat this process several timesfor example (data)where y: dependent variables ; number of columns are 5, nrow = 1800y temp, preci, growing season days, max temp, min temp regio

[R] Doubt on benchmarking of R

2012-04-24 Thread Sudip Sinha
Hi, In the standard R benchmarking by Simon Urbanek (http://r.research.att.com/benchmarks/), the trimmed geometric means (2 extremes eliminated) within the averages in one category has been calculated. I am unable to figure the rationale behind this, since this is across different tests (even thou

[R] Compiling RMySQL on Win7 64bits RS-DBI.c:1:0: sorry, unimplemented: 64-bit mode not compiled in

2012-04-24 Thread Ben Rhelp
Hi, On a Win7 64 bit, I have installed: *R-15.0 and I am running it in 64bits *Rtools215.exe*MySQL 5.5.23 64bits My PATH start with D:\BenSave\Rtools\bin;D:\BenSave\Rtools\MinGW64\bin;D:\BenSave\R\R-2.15.0\bin;D:\BenSave\Rtools\MinGW\bin;D:\BenSave\Rtools\gcc-4.6.3\bin; Note that I place MinGW

[R] searchina a pattern in a string

2012-04-24 Thread arunkumar1111
I have a long string. i want to sepearate a 10 digit phone no from it. eg "my no is 9876543210 is personal no and my official no is 123-456-8907. you can use any of these" i want to seperate the 9876543210 and 123-456-8907 from this. therev may be many phone nos in the string. how to do it -

Re: [R] zipfR help

2012-04-24 Thread R. Michael Weylandt
Please reply on list for the archives (and so others who know more about zipfR can help): Your immediate problem is that rlnre produces factors not integers and so there's no way to order them (and hence no idea of being "less" than 6000) -- if you want you can coerce to integer with as.integer()

Re: [R] Packages/functions for competing risk analysis

2012-04-24 Thread Jennifer Sabatier
I have an update for this question. Now that I have figured out how to do this correctly I have a new question. Is there a way to deal with late entries (left truncation) for competing risk analysis in R? For so-called period analyses? I apologize if I haven't provided enough information. I wi

Re: [R] How to insert filename as column in a file

2012-04-24 Thread Shivam
Reposting in hope of a reply. On Tue, Apr 24, 2012 at 1:12 AM, Shivam wrote: > Thanks for the quick response. It works for an individual dataframe, but I > have many dataframes. This is the code so far > > fnames = list.files(path = getwd()) > for (i in 1:length(fnames)){ > assign(paste("file",i

Re: [R] Positioning main title

2012-04-24 Thread Gerrit Eichner
Hello, R, check argument adj of mtext(). Hth -- Gerrit I have a barplot where each row has quite long texts and I have used "par" to make some room in the left: par(mar=c(0, 17, 3, 0), oma=c(0, 0, 0, 0)) barplot2(prueba, main = l, col=colores, horiz=TRUE,las=1, cex.names=.7) My problem is th

[R] In robust PCA methods, how to get variance explained?

2012-04-24 Thread Michael
For example, PcaHubert, how to get the variance explained which are similar to those concepts in traditional PCA? In traditional PCA, you have a bunch of eigenvalue lambdas... and you sort the lambdas from the biggest to the smallest, the lambda_i / (sum of all lambdas) is the variance explaine

[R] Positioning main title

2012-04-24 Thread ramonovelar
Hello, I have a barplot where each row has quite long texts and I have used "par" to make some room in the left: par(mar=c(0, 17, 3, 0), oma=c(0, 0, 0, 0)) barplot2(prueba, main = l, col=colores, horiz=TRUE,las=1, cex.names=.7) My problem is that main text appears justified to the plot. I want to

Re: [R] Number of lines in analysis after removed missings

2012-04-24 Thread Marc Schwartz
I might just also note that what Eiko is doing is essentially forward stepwise selection and would recommend he do some searching on the perils of using stepwise (especially forward) variable selection methods. Might also want to look into multiple imputation approaches relative to dealing with

Re: [R] trouble loading ggplot2 using R

2012-04-24 Thread Hadley Wickham
> I have a similar error, running R in Snow Leopard too > >> library("ggplot2") > Error : .onAttach failed in attachNamespace() for 'ggplot2', details: >  call: stats::runif(1) >  error: .Random.seed no es un vector de números enteros pero es de tipo > 'list' > Error: package/namespace load failed

Re: [R] How to test if a slope is different than 1?

2012-04-24 Thread Mark Na
Hi Greg. Thanks for your reply. Do you know if there is a way to use the confint function to get a p-value on this test? Thanks, Mark On Mon, Apr 23, 2012 at 3:10 PM, Greg Snow <538...@gmail.com> wrote: > One option is to subtract the continuous variable from y before doing > the regression (th

  1   2   >