Re: [R] Data separated by spaces, getting data into R using fiel

2009-09-08 Thread Barry Rowlingson
On Tue, Sep 8, 2009 at 7:05 PM, Lauri Nikkinenlauri.nikki...@iki.fi wrote: Well, yeah, Henrique's solutions works fine with this data. Thanks for that, although this is not so generic solutions which I was looking after. As I originally posted, I was looking for solution which uses the

Re: [R] Video Analysis?

2009-09-06 Thread Barry Rowlingson
On Sun, Sep 6, 2009 at 1:07 AM, spencergspencer.gra...@prodsyse.com wrote:     What software exists for digitizing video to quantify the motion of specific features in the image?  I might be willing to use something that's NOT in R, though I'd prefer something in R (or at least with an R

Re: [R] 0 x 0 matrix

2009-09-04 Thread Barry Rowlingson
On Fri, Sep 4, 2009 at 11:25 AM, Markku Karhunenmarkku.karhu...@helsinki.fi wrote: Hi, Does anybody know, what is going on here? diag(sqrt(1))     [,1] [1,]    1 diag(sqrt(0.)) 0 x 0 matrix sqrt(1) [1] 1 sqrt(0.) [1] 0.5773214 Read the help for diag yet? 'diag'

Re: [R] correlation between two 2D point patterns?

2009-08-30 Thread Barry Rowlingson
On Sun, Aug 30, 2009 at 10:46 AM, Bernardo Rangel Turat...@centroin.com.br wrote: On Sun, 2009-08-30 at 07:51 +0100, William Simpson wrote: Suppose I have two sets of (x,y) points like this: x1-runif(n=10) y1-runif(n=10) A-cbind(x1,y1) x2-runif(n=10) y2-runif(n=10) B-cbind(x2,y2) I

Re: [R] Sequence generation

2009-08-29 Thread Barry Rowlingson
On Sat, Aug 29, 2009 at 8:14 PM, njhuang86njhuan...@yahoo.com wrote: Hey guys, I was wondering how to create this sequence: 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3... with the '1, 2, 3' repeated over 10 times. rep(1:3,10) # rep repeats its first argument according to the number in its second

Re: [R] Google's R Style Guide

2009-08-28 Thread Barry Rowlingson
On Fri, Aug 28, 2009 at 3:53 PM, Duncan Murdochmurd...@stats.uwo.ca wrote: On 8/28/2009 10:41 AM, hadley wickham wrote: Perhaps most of you have already seen this?  http://google-styleguide.googlecode.com/svn/trunk/google-r-style.html Comments/Critiques? I made my own version that

Re: [R] Google's R Style Guide

2009-08-28 Thread Barry Rowlingson
On Fri, Aug 28, 2009 at 5:11 PM, hadley wickhamh.wick...@gmail.com wrote: In my view, that's the purpose of indenting - you see scope from indenting. *cough* python *cough* Barry __ R-help@r-project.org mailing list

Re: [R] teaching R

2009-08-26 Thread Barry Rowlingson
On Wed, Aug 26, 2009 at 2:08 PM, Michael Nestrudm...@ataraxis.org wrote: Hello all, I am going to be running a small statistics workshop using R sometime in November.  I am restricted to R because of the specific libraries I will be using - a good thing in my book - however the attendees are

Re: [R] Import/export ENVI files

2009-08-24 Thread Barry Rowlingson
2009/8/24 Lucas Sevilla García luckocto...@hotmail.com: Hi! I'm a beginner with this webpage so, I don't know if I'm sending my question to the correct site. Anyway, I'm working with R and I need to import and export ENVI files, (*.HDR files). A colleague told me that there is a package to

Re: [R] Why is R so slow at plotting on Ubuntu 9.04?

2009-08-22 Thread Barry Rowlingson
On Sat, Aug 22, 2009 at 5:52 PM, Thomas Hartethomas.ha...@yahoo.com wrote: under Ubuntu 9.04 R seems to be very slow at plotting. the example below illustrates with a plot of error bars of sample means where i watch as each error bar is plotted one at a time. very annoying and pain in the

Re: [R] a --no-save option for Rprofile.site?

2009-08-21 Thread Barry Rowlingson
On Fri, Aug 21, 2009 at 4:33 AM, Scott Hydehy...@byuh.edu wrote: I've found that I can use --no-save after the RCMDR=TRUE above that will do what I want -- don't save any data after exiting.  However, this isn't the most secure -- a student only has to delete the option, or start R a

Re: [R] Where to put source code?

2009-08-21 Thread Barry Rowlingson
On Fri, Aug 21, 2009 at 11:06 AM, Peter Meilstruppeter.meilst...@gmail.com wrote: I'm just looking for the local equivalent of (in matlab) writing a function, saving it as functionName.m and then being able to call functionName(). Or in Python of writing a module.py and then typing import

Re: [R] Several simple but hard tasks to do with R

2009-08-20 Thread Barry Rowlingson
On Thu, Aug 20, 2009 at 3:59 PM, Rakknaraliengene...@yahoo.com wrote: I already using script. I'm using Tinn-R to write them. Thanks for the recommendation of the R2HTML package I'll see how to use it right now. If you run your script using the command line: R CMD BATCH script.R script.Rout

Re: [R] PowerCut Killed R - is my code retrievable?

2009-08-19 Thread Barry Rowlingson
On Wed, Aug 19, 2009 at 10:57 PM, Polwart Calum (County Durham and Darlington NHS Foundation Trust)calum.polw...@nhs.net wrote: I've been tweaking code for several days on and off in R, cut and pasting in from a text editor (I just leave them open all the time).  I think I got something that

Re: [R] extract data from shapefiles

2009-08-14 Thread Barry Rowlingson
On Fri, Aug 14, 2009 at 9:11 PM, Kate Zinszerkate.zins...@mail.mcgill.ca wrote: I'm hoping that someone could guide me in how to extract data from shapefiles.  I want to extract data from a shapefile (classed as SpatialPolygonsDataFrame) and more specifically, the data is contained within

Re: [R] building a package

2009-08-10 Thread Barry Rowlingson
On Mon, Aug 10, 2009 at 10:24 PM, Erin Hodgesserinm.hodg...@gmail.com wrote: Dear R People: I'm trying to build a package and am stuck on the last part; I keep getting there is no library. You seem to have more than one version of R on the go - the one in your system $PATH:

Re: [R] One critical question in R

2009-08-04 Thread Barry Rowlingson
On Tue, Aug 4, 2009 at 4:20 PM, Hyo Karen Leetotem...@gmail.com wrote: I am currently working on some research which involves huge amounts of data(it is about 15GB). One point nobody has seemed to make yet is that the above statement is meaningless... Do you have a CSV file that is 15GB

Re: [R] read.csv from a remote machine

2009-08-04 Thread Barry Rowlingson
On Tue, Aug 4, 2009 at 3:37 PM, Olga Lyashevskao...@herenstraat.nl wrote: Dear all, I am trying to import data with read.csv and my file is on remote machine. I believe that I need to open a connection, not sure about syntax though. If it's on an HTTP server then you don't need to faff with

Re: [R] Which CRAN mirror is the fastest ?

2009-07-30 Thread Barry Rowlingson
2009/7/30 Uwe Ligges lig...@statistik.tu-dortmund.de: Hard to lee, you have to try out, I fear. The speed you see highly depends on the connection from your country to others, but of course, there are also some mirrors that are not the fastest themselves. I figured you could write a

Re: [R] Which CRAN mirror is the fastest ?

2009-07-30 Thread Barry Rowlingson
On Thu, Jul 30, 2009 at 10:49 AM, Martin Maechlermaech...@stat.math.ethz.ch wrote: Yes!  And visualize the corresponding  nearest neigbourhood for each CRAN mirror on a world map and make this dynamically refreshing every few minutes and put it on a webserver so people can watch the CRAN

[R] CRAN + geography = Cranography

2009-07-30 Thread Barry Rowlingson
In response to an earlier discussion about finding the fastest/best/nearest CRAN site, I geocoded (using my geonames package) the locations of the CRAN sites returned by getCRANmirrors. I've mapped them here: http://www.maths.lancs.ac.uk/~rowlings/R/Cranography/ The geocoding may have got it

Re: [R] check for new files in a given directory

2009-07-28 Thread Barry Rowlingson
On Tue, Jul 28, 2009 at 12:04 PM, Andreas Poschandreas.po...@tugraz.at wrote: I am trying to continuously evaluate online created data files using R-algorithms. Is there any simple way to let R iteratively check for new files in a given directory, load them and process them? Any help would be

Re: [R] check for new files in a given directory

2009-07-28 Thread Barry Rowlingson
On Tue, Jul 28, 2009 at 12:36 PM, Ted Hardingted.hard...@manchester.ac.uk wrote: However, this got me looking into '?list.files, and I see there (R version 2.9.0 (2009-04-17)):  recursive: logical. Should the listing recurse into directories? But:  Directories are included only if

Re: [R] Multi-line comments?

2009-07-22 Thread Barry Rowlingson
On Wed, Jul 22, 2009 at 3:30 PM, Mark Knechtmarkkne...@gmail.com wrote: Hi,   I looked in the language definition and was surprised. Is there really no multi-line/block comment defined in R?   I wanted to comment out 20 lines that I'm moving to a function but didn't want to delete them. Is

Re: [R] assignments to function return values

2009-07-18 Thread Barry Rowlingson
On Sat, Jul 18, 2009 at 5:47 PM, Berndprof7...@googlemail.com wrote: colnames(m) = c(a, b) I am fairly new to R and trying to understand this language. Having learned quite a few other programming languages the above statement when i saw it first immediately led to two reactions: (1) wtf?

Re: [R] loading multiple .Rdata and preserving variable names

2009-07-15 Thread Barry Rowlingson
On Wed, Jul 15, 2009 at 10:41 AM, Duncan Murdochmurd...@stats.uwo.ca wrote: Given two .RData files, you can load them into separate environments. Dealing with conflicting variables names is another issue, of course. For example: DataSet1 - new.env() load( somefile, envir=DataSet1) Now

Re: [R] maximum/minimum value of a function

2009-07-11 Thread Barry Rowlingson
On Sat, Jul 11, 2009 at 6:24 AM, milton rusermilton.ru...@gmail.com wrote: my.values-myfunction(1,10,100) min(my.values) max(my.values) That finds the minimum and maximum of a limited sample from a univariate function. Extending this method to ten dimensions might be a bit tricky... If you

Re: [R] Dump plots to powerpoint?

2009-07-08 Thread Barry Rowlingson
On Tue, Jul 7, 2009 at 11:32 PM, Ben Bolkerbol...@ufl.edu wrote:  Why not directly generate a large PNG file (which will be much better for line art than JPG anyway)?  Or EMF?  See http://wiki.r-project.org/rwiki/doku.php?id=tips:graphics-misc:export  [Of course, this doesn't answer the

Re: [R] What command lists everything in a package?

2009-07-05 Thread Barry Rowlingson
On Sun, Jul 5, 2009 at 3:40 PM, hadley wickhamh.wick...@gmail.com wrote: 2) Related to the above, how do I tell what packages are currently loaded at any given time so that I don't waste time loading things that are already loaded? search() tells me what's available, but what's loaded? The

Re: [R] Package 'operators'

2009-07-03 Thread Barry Rowlingson
On Thu, Jul 2, 2009 at 11:57 PM, seeliger.c...@epamail.epa.gov wrote: Thanks for replying, Francois. To directly answer your question, the difference between using base R functions and a library comes down to code correctness and stability, as well as future support.  Portions of the

Re: [R] How do I change which R Graphics Device is active?

2009-07-01 Thread Barry Rowlingson
On Wed, Jul 1, 2009 at 3:30 PM, Don MacQueenm...@llnl.gov wrote: My version would be  newDev -  function() { dev.new(); invisible( dev.cur() ) } I agree with Hadley that return() is redundant in this instance. Using invisible() suppresses automatic printing of the returned value when it is

Re: [R] timer in R?

2009-07-01 Thread Barry Rowlingson
On Wed, Jul 1, 2009 at 8:41 PM, Michaelcomtech@gmail.com wrote: Hi all, How could I set a timer in R, so that at fixed interval, the R program will invoke some other functions to run some tasks? Use timer events in the tcltk package: z=function(){cat(Hello you!\n);tcl(after,1000,z)}

Re: [R] Question about creating lists with functions as elements

2009-06-30 Thread Barry Rowlingson
On Tue, Jun 30, 2009 at 1:00 PM, Craig P. Pyramecrap...@gmail.com wrote: But this fails, as above.  Why?  Why can c(character, character) create a list of two functions, but rep(character, 2) can't? Another solution to my problem I could find (and you'll hopefully suggest an even better one)

Re: [R] How to erase an environment?

2009-06-30 Thread Barry Rowlingson
On Tue, Jun 30, 2009 at 12:19 PM, David Haykazyandavid.haykaz...@onetick.com wrote: Hi, Isn't there a way to erase an environment (created by new.env) with all of the objects belonging to it? I've searched everywhere but could not find. Thanks in advance. Just rm(it) Barry

Re: [R] How do I change which R Graphics Device is active?

2009-06-30 Thread Barry Rowlingson
On Tue, Jun 30, 2009 at 5:15 PM, milton rusermilton.ru...@gmail.com wrote: How about: dev.cur() dev.list() dev.next(which = dev.cur()) dev.prev(which = dev.cur()) dev.off(which = dev.cur()) dev.set(which = dev.next()) dev.new(...) graphics.off() dev.cur() dev.list() dev.next(which =

Re: [R] How do I change which R Graphics Device is active?

2009-06-30 Thread Barry Rowlingson
On Tue, Jun 30, 2009 at 6:33 PM, Ted Hardingted.hard...@manchester.ac.uk wrote: Barry, spot on! If there were a prize for postings with simplicity, clarity, conciseness and usability, I would nominate yours (especially in the Why didn't *I* think of that? category). Thanks Ted! It's just a

Re: [R] How do I change which R Graphics Device is active?

2009-06-30 Thread Barry Rowlingson
On Tue, Jun 30, 2009 at 8:05 PM, Mark Knechtmarkkne...@gmail.com wrote: You could wrap it in a function of your own making, right? AddNewDev = function() {dev.new();AddNewDev=dev.cur()} histPlot=AddNewDev() Seems to work. You leaRn fast :) Probably better style is: newDev =

Re: [R] How to pass parameters to htmlParse Bank of Canada html pages

2009-06-30 Thread Barry Rowlingson
On Tue, Jun 30, 2009 at 9:32 PM, g...@ucalgary.ca wrote: To get USDCAD rates from Bank of Canada, we first go url - http://banqueducanada.ca/en/rates/exchange-avg.html; select 12 months for Rates for the past and click Get Rates button. Then the page moves to address -

Re: [R] how to access Internet from within R?

2009-06-26 Thread Barry Rowlingson
On Fri, Jun 26, 2009 at 7:21 AM, Michaelcomtech@gmail.com wrote: Let's say I have some automation tasks where I have to fill a table field on a webpage, and then submit it to the server, and then obtain the returned value (a typical web query), how to do that in R? The RCurl package will

Re: [R] opening URL for writing

2009-06-23 Thread Barry Rowlingson
On Tue, Jun 23, 2009 at 8:42 AM, Bierman, Stijn stijn.bier...@wur.nlwrote: Dear List, Sharepoint sites are used more and more often by researchers as a platform to share all the information in a joint research project. Typically, they can be accessed only by a Hypertext Transfer Protocol

Re: [R] Convert RGB-sRBG

2009-06-23 Thread Barry Rowlingson
On Tue, Jun 23, 2009 at 2:26 PM, Dieter Menne dieter.me...@menne-biomed.dewrote: Paulo Cardoso wrote: How can I convert from 8-bit RGB color to [0-1] interval (sRGB) and vice-versa? If you have the R/G/B values separately, divide by 255, and use function rgb in grDevices. If you

Re: [R] X-window graphics -- preventing window coming to front?

2009-06-23 Thread Barry Rowlingson
On Tue, Jun 23, 2009 at 6:03 PM, Steve Jaffesja...@riskspan.com wrote: When I do dev.new(), the  resulting window comes to the front and grabs the focus. Is there a way to prevent this so I can continue working in other windows while the graphics are being produced? That's a function of your

Re: [R] Help on drawing stars and radars in R (update)

2009-06-11 Thread Barry Rowlingson
On Thu, Jun 11, 2009 at 10:01 AM, Caroline Gideon-Adeniyic.gideon-adeni...@fashion.arts.ac.uk wrote: Hi I don't know if you can help. I am a 2nd year Bsc Cosmetic Science student and in R I need some help in drawing stars. The problem that I have is I want to recreate a radar diagram

Re: [R] Regex question to find a string that contains 5-9 alpha-numeric characters, at least one of which is a number

2009-06-08 Thread Barry Rowlingson
On Mon, Jun 8, 2009 at 10:40 PM, Tan, Richardr...@panagora.com wrote: Hi, This is not exactly an R question but I am trying to use gsub to replace a string that contains 5-9 alpha-numeric characters, at least one of which is a number.  Is there a good way to write it in a one line regex?

Re: [R] Error Catching?

2009-06-04 Thread Barry Rowlingson
On Thu, Jun 4, 2009 at 6:56 PM, Brigid Mooney bkmoo...@gmail.com wrote: Hi, Is there an easy way to catch errors, in order to arrange for r-scripts to exit gracefully? I'm thinking of something along the lines of using is.na with an if/else statement, but for errors. Try 'try'. Barry

Re: [R] R under Ubuntu

2009-05-26 Thread Barry Rowlingson
On Tue, May 26, 2009 at 11:17 AM, Luis Ridao Cruz lu...@hav.fo wrote: R-help, I have installed R under Ubuntu and I'm very new to a Linux distribution. To open an empty R session I just type R on the Terminal aplication. But how can I open a saved workspace? At present I just start R and

Re: [R] Simulation

2009-05-14 Thread Barry Rowlingson
As a beginner, I agree the for loop is much clearer to me. [Warning: Contains mostly philosophy] To me, the world and how I interact with it is procedural. When I want to break six eggs I do 'get six eggs, repeat break egg until all eggs broken'. I don't apply an instance of the break

Re: [R] Simulation

2009-05-13 Thread Barry Rowlingson
On Wed, May 13, 2009 at 4:26 PM, Gábor Csárdi csa...@rmki.kfki.hu wrote: On Wed, May 13, 2009 at 5:13 PM, Debbie Zhang debbie0...@hotmail.com wrote: Dear R users, Can anyone please tell me how to generate a large number of samples in R, given certain distribution and size. For example,

Re: [R] Simulation

2009-05-13 Thread Barry Rowlingson
On Wed, May 13, 2009 at 5:36 PM, Wacek Kusnierczyk waclaw.marcin.kusnierc...@idi.ntnu.no wrote: Barry Rowlingson wrote:  Soln - for loop:   z=list()   for(i in 1:1000){z[[i]]=rnorm(100,0,1)} now inspect the individual bits:   hist(z[[1]])   hist(z[[545]]) If that's the problem, then I

Re: [R] Simulation

2009-05-13 Thread Barry Rowlingson
On Wed, May 13, 2009 at 9:56 PM, Wacek Kusnierczyk waclaw.marcin.kusnierc...@idi.ntnu.no wrote: Barry Rowlingson wrote:    n = 1000    benchmark(columns=c('test', 'elapsed'), order=NULL,       'for'={ l = list(); for (i in 1:n) l[[i]] = rnorm(i, 0, 1) },       lapply=lapply(1:n, rnorm, 0, 1

Re: [R] I'm offering $300 for someone who know R-programming to do the assignments for me.

2009-05-08 Thread Barry Rowlingson
On Fri, May 8, 2009 at 4:06 PM, Mitchell Maltenfort mmal...@gmail.com wrote: And the crazy thing is that if he went to Amazon and ordered 2 R books with one-day shipping, he could do it himself and probably spend half as much. And the crazier thing is that if homework cheats lurked moar then

Re: [R] problem with rgl package

2009-05-05 Thread Barry Rowlingson
On Tue, May 5, 2009 at 10:55 AM, Erin Hodgess erinm.hodg...@gmail.com wrote: Dear R People: Here is something strange.  I'm using Ubuntu 9.04 with R 2.9.0. I need to have the rgl package.  Here are my results from installing: install.packages(rgl) Warning in install.packages(rgl) : []

Re: [R] Returning Variables in R to Linux Shell

2009-04-22 Thread Barry Rowlingson
On Wed, Apr 22, 2009 at 3:48 PM, Bierbryer, Andrew abierbr...@klsdiversified.com wrote: For example, if I had a simple one line R script that just did            string - 'TEST', when I call /usr/local/bin/R -no-save MY_R_FILE, how can I put the value TEST into a shell variable?

Re: [R] Manipulate single line in textfile

2009-04-17 Thread Barry Rowlingson
On Fri, Apr 17, 2009 at 9:20 AM, Guillaume Filteau filt...@unc.edu wrote: Hello all, Is it possible to modify a single line in a textfile? I know it is possible to load the whole text file, do the change, and  save this as a new file. However, this is not practical in my case, because the

Re: [R] reverse truncate to extract only decimal values

2009-04-16 Thread Barry Rowlingson
On Thu, Apr 16, 2009 at 10:30 PM, T.D.Rudolph prairie.pic...@gmail.com wrote: hello there, Is there a way of truncating in the opposite direction so as to retain only the values to the right of the decimal?? i.e. rather than: trunc(39.5) [1] 39 i would get something like:

Re: [R] Building GUI for custom R application

2009-04-14 Thread Barry Rowlingson
On Tue, Apr 14, 2009 at 9:23 AM, Harsh singhal...@gmail.com wrote: HI R users, I would appreciate information/examples/suggestions on building GUIs for R applications. I am currently working on a project that would require the following functionalities : 1) Display a  window to the user.

Re: [R] Automating object creation

2009-04-14 Thread Barry Rowlingson
On Tue, Apr 14, 2009 at 6:32 PM, Zachary Patterson zak.patter...@gmail.com wrote: I am new to R. I would like to automate the creation of a number of vectors but can't seem to get the string formatting to work. Here's what I would like to be able to do: Suppose we have a vector: x -

Re: [R] Template Engine Package for R?

2009-04-09 Thread Barry Rowlingson
On Thu, Apr 9, 2009 at 12:42 PM, Jason Rupert jasonkrup...@yahoo.com wrote: Related to the posting below, by any chance is there a Template Engine package for R? http://en.wikipedia.org/wiki/Template_processor This may make this type of editing much easier?  Maybe... Have you tried the

Re: [R] Warning messages in Splancs package :: no non-missing arguments to min; returning Inf

2009-03-30 Thread Barry Rowlingson
On Mon, Mar 30, 2009 at 7:12 AM, D eloquen...@gmail.com wrote: Hi, I would need some help with the splans package in R. I am using a Shapefile (downloadable at) http://rapidshare.com/files/215206891/Redlands_Crime.zip and the following execution code setwd(C:\\Documents and

Re: [R] Retrieving Vertices Coordinates from SpatialPolygons

2009-03-21 Thread Barry Rowlingson
On Sat, Mar 21, 2009 at 12:33 PM, Enrico R. Crema e.cr...@ucl.ac.uk wrote: Dear List, I'm trying to use different R packages for my Teaching Assistantship classes. And I cam out to an (apparently) very simple problem. I would like to retrieve the vertices coordinate of a SpatialPolygon data.

Re: [R] Taking diff of character vectors

2009-03-13 Thread Barry Rowlingson
2009/3/13 Sergey Goriatchev serg...@gmail.com: Say I have nm1 - c(rep(1,10), rep(0,10)) then I can do: diff(nm1) to see where I have shift in value but what if I have nm2 - c(rep(SPZ8, 10), rep(SPX9, 10)) how can I produce the same ouput as diff(nm1) does, that is zeros everywhere

Re: [R] different outcomes using read.table vs read.csv

2009-03-13 Thread Barry Rowlingson
2009/3/13 jatwood jatw...@montana.edu: Good Afternoon I have noticed results similar to the following several times as I have used R over the past several years. My .csv file has a header row and 3073 rows of data. rskreg-read.table('D:/data/riskregions.csv',header=T,sep=,) dim(rskreg) [1]

Re: [R] popular R packages

2009-03-08 Thread Barry Rowlingson
I think the situation is worse than messy.  If a client comes in with data that doesn't address the question they're interested in, I think they are better served to be told that, than to be given an answer that is not actually valid.  They should also be told how to design a study that

Re: [R] popular R packages

2009-03-08 Thread Barry Rowlingson
2009/3/8 Emmanuel Charpentier charp...@bacbuc.dyndns.org: I question 1) the usefulness of the effort necessary to get the data ; and 2) the very concept of data mining, which seems to be the rationale for this proposed effort. Furthermore (but this is seriously off-topic), I seriously

Re: [R] File checking problem

2009-03-05 Thread Barry Rowlingson
2009/3/5 ling ling metal_lical...@live.com: Dear all, I am a newcomer to R programming, I met the problem: I have a lot of .txt files in my directory. Firstly, I check whether the file satisfies the conditions: 1.empty 2.the Rep column of the file has no useractivity_idle or

Re: [R] Inefficiency of SAS Programming

2009-03-03 Thread Barry Rowlingson
2009/3/3 Jim Lemon j...@bitwrit.com.au: Ajay ohri wrote: for an inefficient language , it sure has dominated the predictive analytics world for 3 plus decades. I referred once to intellectual jealousy between newton and liebnitz. i am going ahead and creating the R package called Anne.

Re: [R] combining identify() and locator()

2009-02-27 Thread Barry Rowlingson
2009/2/27 Brian Bolt bb...@kalypsys.com: Hi, I am wondering if there might be a way to combine the two functions identify() and locator() such that if I use identify() and then click on a point outside the set tolerance, the x,y coordinates are returned as in locator().  Does anyone know of a

Re: [R] Inefficiency of SAS Programming

2009-02-27 Thread Barry Rowlingson
2009/2/27 Peter Dalgaard p.dalga...@biostat.ku.dk: Presumably, something like     IF N. =  1 THEN SUB_N = 1;     ELSE IF N. 5 THEN SUB_N = N.-1;     ELSE IF N. 16 THEN SUB_N = N.-2;     ELSE SUB_N = N.-3; would work, provided that 2, 5, 16 are impossible values. Problem is that it

Re: [R] combining identify() and locator()

2009-02-27 Thread Barry Rowlingson
2009/2/27 Brian Bolt bb...@kalypsys.com: awesome.  Thank you very much for the quick response. I think this is exactly what I was looking for. Here's a basic framework: `idloc` - function(xy,n=1, tol=0.25){ tol2=tol^2 icoords =

Re: [R] Download daily weather data

2009-02-26 Thread Barry Rowlingson
2009/2/26 Thomas Levine thomas.lev...@gmail.com: I'm writing a program that will tell me whether I should wear a coat, so I'd like to be able to download daily weather forecasts and daily reports of recent past weather conditions. The NOAA has very promising tabular forecasts

Re: [R] Inefficiency of SAS Programming

2009-02-26 Thread Barry Rowlingson
2009/2/26 Frank E Harrell Jr f.harr...@vanderbilt.edu: If anyone wants to see a prime example of how inefficient it is to program in SAS, take a look at the SAS programs provided by the US Agency for Healthcare Research and Quality for risk adjusting and reporting for hospital outcomes at

Re: [R] Python and R

2009-02-18 Thread Barry Rowlingson
2009/2/17 Esmail Bonakdarian esmail...@gmail.com: Well, I have a program written in R which already takes quite a while to run. I was just wondering if I were to rewrite most of the logic in Python - the main thing I use in R are its regression facilities - if it would speed things up. I

Re: [R] Python and R

2009-02-17 Thread Barry Rowlingson
2009/2/17 Esmail Bonakdarian esmail...@gmail.com: Hello all, I am just wondering if any of you are doing most of your scripting with Python instead of R's programming language and then calling the relevant R functions as needed? I tend to use R in its native form for data analysis and

Re: [R] How to comment in R

2009-02-11 Thread Barry Rowlingson
2009/2/11 mihai.mira...@bafin.de: Hi everybody, I use for the moment # at the begining of each line for comments. Is there any possibility to comment more than one line, like something which shows the beggingng and the end of the comment? Or is there a possibility to comment only a part

Re: [R] R on Mobile Devices (Android)

2009-02-06 Thread Barry Rowlingson
2009/2/6 Harsh singhal...@gmail.com: Hell R-list, At the cost of sounding far-fetched and almost incredulous, I would like to know if any R user is remotely considering the use of R on Mobile devices, and Android in particular. First, rewrite R in Java. Good luck with that!

Re: [R] Problems in Recommending R

2009-02-03 Thread Barry Rowlingson
2009/2/3 Neil Shephard nsheph...@gmail.com: Again I'd disagree, perhaps the most widely used suite of software has a very simple and clean web-site with few bells and whistles, ditto for one of the most popular text-editors. I am of course referring to the suite of GNU utilities

Re: [R] This site may harm your computer - Google warning about cran website

2009-01-31 Thread Barry Rowlingson
2009/1/31 Gabor Grothendieck ggrothendi...@gmail.com: I am having this same problem with a huge number of sites, not just CRAN. Google seem to have fixed it now. Almost every site had this warning attached. Don't panic. The internet is safe (unless Jen drops it...[1]). Barry [1] The IT Crowd

Re: [R] How do I get my IT department to bless R?

2009-01-30 Thread Barry Rowlingson
2009/1/29 Daniel Viar dan.v...@gmail.com: How does one get an all Microsoft shop on board with allowing users to user R? An 'all Microsoft shop' is what exactly? There is nothing on your PC that isn't from Microsoft? That makes me think that you're either going to be forced to do your

Re: [R] Character SNP data to binary MAF data

2009-01-29 Thread Barry Rowlingson
2009/1/29 Hadassa Brunschwig hadassa.brunsch...@mail.huji.ac.il: Hi An example is as follows. Consider the character 3x6 matrix: a A a T A t G g t T T t A a C C c c For each row I would like to identify the most frequent letter and assign a 1 to it and 0 to the less frequent character.

Re: [R] Character SNP data to binary MAF data

2009-01-29 Thread Barry Rowlingson
2009/1/29 Patrick Aboyoun paboy...@fhcrc.org: Hadassa, You may want to check out the snpMatrix package in Bioconductor http://bioconductor.org/packages/2.3/bioc/html/snpMatrix.html http://bioconductor.org/packages/2.4/bioc/html/snpMatrix.html It contains classes that manage this type of

Re: [R] last result

2009-01-23 Thread Barry Rowlingson
2009/1/23 Jorge Ivan Velez jorgeivanve...@gmail.com: See ?.Last.value But don't do that right after you've done the calculation! You get *one* chance with .Last.value: # here comes my important numbers... runif(10) [1] 0.7685472 0.2301233 0.3053993 0.5185696 0.3345997 0.1544350 0.2663696

Re: [R] title: words in different colors?

2009-01-22 Thread Barry Rowlingson
quotes: ### ### multiTitle(color=orange,Hello , ### color=red, \\\world\\\!) ### ### Barry Rowlingson b.rowling...@lancaster.ac.uk ### l = list(...) ic = names(l)=='color' colors = unique(unlist(l[ic])) for(i in colors){ color=par()$col.main strings=c() for(il in 1

Re: [R] title: words in different colors?

2009-01-21 Thread Barry Rowlingson
2009/1/21 Michael Friendly frien...@yorku.ca: In ?title I see the plot(cars, main = ) title(main = list(Stopping Distance versus Speed, cex=1.5, col=red, font=3)) I can't seem to generalize this to use several colors in a single title. Solution from

Re: [R] R in the NY Times

2009-01-10 Thread Barry Rowlingson
2009/1/10 Tony Breyal tony.bre...@googlemail.com: [SAS marketroid quote] In fact, SAS values open-source software. But clearly not enough to open-source SAS itself. It would seem that SAS values _other_people's_ open source. If SAS was open source and free, then SAS would collect on all the

Re: [R] The R Inferno

2009-01-09 Thread Barry Rowlingson
2009/1/9 Duncan Murdoch murd...@stats.uwo.ca: Which he well deserves -- it's good advice, and a fun read too. I'm looking forward to the sequel - Shakespeare perhaps? as.YouLike(it)? Much Ado About NULL? Night[12] | What(You.Will)? Barry __

Re: [R] R in the NY Times

2009-01-07 Thread Barry Rowlingson
2009/1/7 Darin A. England engl...@cs.umn.edu: Unfortunately, that type of FUD issued by the SAS marketing person still works. I see it at my employer (a large healthcare company.) I see it here, at a university. Quote: We couldn't possibly do our analysis using some software we've just

Re: [R] Suggestions for inputting a date via a dialog box?

2008-12-31 Thread Barry Rowlingson
2008/12/31 Tubin sredmon...@yahoo.com: Hm. This looks like a fantastic package in general... but for this particular project I would rather not have to redo the entire program to run in Rpad. And it is not immediately evident that I could use Rpad just for the function of getting values for

Re: [R] X11 is not availble

2008-12-18 Thread Barry Rowlingson
2008/12/18 Dennis Schmidt dennis.schm...@student.hpi.uni-potsdam.de: No, haven't seen this so far. But it quite looks like what I'm looking for, so thanks a lot :-) The png() device does not need an X server to connect to. I think it used to in versions gone by, but not any more. Here I've

Re: [R] Sink does not send graphs to sink file

2008-12-05 Thread Barry Rowlingson
2008/12/5 Philipp Pagel [EMAIL PROTECTED]: I am using sink() to send the results of my analyses to a text file. Unfortunately my graphs do not become part of the file. Is there anyway that I can have both the text and graphic output of my analyses appear in a file? Well, how would you expect

Re: [R] Running R Script on a Sequence of Files

2008-12-05 Thread Barry Rowlingson
2008/12/5 Chris Poliquin [EMAIL PROTECTED]: Hi, I have about 900 files that I need to run the same R script on. I looked over the R Data Import/Export Manual and couldn't come up with a way to read in a sequence of files. The files all have unique names and are in the same directory.

Re: [R] R simulations

2008-12-04 Thread Barry Rowlingson
2008/12/4 João Cruz [EMAIL PROTECTED]: I need help with these R simulations Try asking 'jrrbc', who has asked the exact same questions on this forum: http://www.artofproblemsolving.com/Forum/viewtopic.php?p=1338520#1338520 where he does at least admit this is Master's course homework. Oh hang

Re: [R] command files

2008-12-02 Thread Barry Rowlingson
2008/12/2 b g [EMAIL PROTECTED]: Since I'm a SAS programmer, I'm used to creating command files in an editor for submission later. Is there a way to do this in R? I'd need to retain an ouput listing and a log to check for errors. You probably want R CMD BATCH from a command-line. For

Re: [R] calculating an N50

2008-11-25 Thread Barry Rowlingson
2008/11/25 Jeremy Leipzig [EMAIL PROTECTED]: Given a set of integers of different values how do I calculate the minimum number of the largest of integers that are required, when summed, to equal 50% of the total sum of the the set? Actually I need the value of the smallest member such that

Re: [R] How to draw following plot in R?

2008-11-22 Thread Barry Rowlingson
2008/11/22 RON70 [EMAIL PROTECTED]: I want to draw following plot, given here http://www.2shared.com/file/4327128/830b82c4/pic.html for the following data : dat - cbind(rnorm(100), sample(c(1:4), 1000, T)) colnames(dat) - c(data,level) Here x-axis should be on data and y-axis is for level

Re: [R] rgl lighting question

2008-11-21 Thread Barry Rowlingson
2008/11/21 Rajarshi Guha [EMAIL PROTECTED]: Hi, I'm using rgl to generate a 3D surface plot and I'm struggling to get the lighting correct. Currently the surface gets plotted, but is very 'shiny'. On rotating the view, I get to see parts of the surface - but overall I don't see much detail

Re: [R] Identify command in R

2008-11-20 Thread Barry Rowlingson
2008/11/20 David Kaplan [EMAIL PROTECTED]: Hi all, In using the identify command, I get the following message plot(hatvalues(scireg3)) abline(h=.0154,lty=2) # plots a reference line at (k + 1)/n identify(1:1165, hatvalues(scireg3),row.names(sciach)) Error in xy.coords(x, y) : 'x' and 'y'

Re: [R] Identify command in R]

2008-11-20 Thread Barry Rowlingson
2008/11/20 David Kaplan [EMAIL PROTECTED]: Let me try to be more specific. The x y coordinates are different because of NAs in the dataset. In this analysis, a set of hat values (a measure of influence in regression) is given for each observation. On the basis of the regression that was run

Re: [R] licensing of R packages

2008-11-14 Thread Barry Rowlingson
2008/11/14 Duncan Murdoch [EMAIL PROTECTED]: Another question is if that strict interpretation of the GPL could be actually enforced, of course. Coming back to the GSL example, it seems a more flagrant violation of the license is already happening: http://www.numerit.com/gsl.htm (apparently

Re: [R] logical operators in 'subset'

2008-11-13 Thread Barry Rowlingson
2008/11/13 Reitsma, Rene - COB [EMAIL PROTECTED]: subset(foo, c1 1 c2 5) [1] c1 c2 c3 0 rows (or 0-length row.names) Too many ampersands: subset(foo, c1 1 c2 5) c1 c2 c3 r3 3 6 9 See help() Barry __ R-help@r-project.org mailing list

Re: [R] How to manipulate the time data without the date?

2008-11-07 Thread Barry Rowlingson
2008/11/7 tedzzx [EMAIL PROTECTED]: The problem is that: There is some rounding problems, for example Library(chron) any(times(4:00:01)==times(4:00:00)+times(00:00:01))) False But,it should be true FAQ 7.31 in disguise! chron stores date-times as fractions, so you're comparing two

<    1   2   3   4   5   6   7   >