Re: [R] Convert factor to numeric vector of labels

2007-08-14 Thread Matthew Keller
Hi all, If we, the R community, are endeavoring to make R user friendly (gasp!), I think that one of the first places to start would be in setting stringsAsFactors = FALSE. Several times I've run into instances of folks decrying R's rediculous usage of memory in reading data, only to come to find

Re: [R] Speed up R

2007-06-20 Thread Matthew Keller
Robert, I'm not exactly an expert, but here's what I think. If you have only 786 MB of RAM on your machine and you are using ~500 of it in a session of R, that could slow things down considerably because your machine is trying to find free blocks of memory that haven't been used yet. I would buy

Re: [R] Speed up R

2007-06-20 Thread Matthew Keller
So Mike, let me ask you a question. If R runs out of RAM, does it begin to use virtual RAM, and hence begin to swap from the hard drive? If so, I could see how a faster hard drive would speed R up when you don't have enough RAM... On 6/20/07, Mike Prager [EMAIL PROTECTED] wrote: Matthew Keller

Re: [R] Speed up R

2007-06-19 Thread Matthew Keller
Hi Robert, Here's my 2 cents. 64-bit is a memory issue, not a speed issue per se. If a concern is increasing RAM (which is important in R since objects are stored in RAM), then you will want to get 64 bit if you plan on getting a computer with over 4GB RAM. I'm not sure about this (someone

Re: [R] Cause of error message in cov function?

2007-06-13 Thread Matthew Keller
versions. I have no idea why the error was occurring, and can't track it down because I don't have access to R 2.1... Matt On 6/13/07, Uwe Ligges [EMAIL PROTECTED] wrote: Matthew Keller wrote: Hi all, I have written a script in R that simulates genetically informative data - it is posted

[R] Cause of error message in cov function?

2007-06-12 Thread Matthew Keller
Hi all, I have written a script in R that simulates genetically informative data - it is posted on my website and available to the public. This is my first time to write a script for use by others and am learning that it isn't as easy as it seems. To the issue. My script runs fine on my machine

Re: [R] Error loading libraries in MAC

2007-04-19 Thread Matthew Keller
HI Mayte Gregory, This is probably a question needing to be posted to r-sig-mac. A search for this problem on that forum turns up lots of hits. I think everyone is having these problems (which makes me pause about whether to switch to Mac, given how much I use R). Below is a message from the

Re: [R] Random Sequence

2007-04-12 Thread Matthew Keller
Hi Anup, (runif(100).5)*1 #would give you 0's and 1's. sample(rep(c(-1,1),50),100) #A bit slower I think, gives you -1's and 1's Best, Matt On 4/12/07, Anup Nandialath [EMAIL PROTECTED] wrote: Dear Friends, I'm trying to generate a sequence of 100 observations with either a 1 or -1.

Re: [R] Rserve and R to R communication

2007-04-09 Thread Matthew Keller
Hi Ramon, I've been interested in responses to your question. I have what I think is a similar issue - I have a very large simulation script and would like to be able to modularize it by having a main script that calls lots of subscripts - but I haven't done that yet because the only way I could

Re: [R] Rserve and R to R communication

2007-04-09 Thread Matthew Keller
PROTECTED] wrote: Matthew Keller wrote: Hi Ramon, I've been interested in responses to your question. I have what I think is a similar issue - I have a very large simulation script and would like to be able to modularize it by having a main script that calls lots of subscripts

Re: [R] matrix similarity comparison

2007-03-19 Thread Matthew Keller
hi Carlos, its not really clear what you're asking here. If all you want is to see what entries are the same and which are different between two matrices of the same dimensions, then this does it: #same m1==m2 #diff m1 != m2 If you want to extract the ones that are the same, indx - m1==m2 indx

[R] ideas to speed up code: converting a matrix of integers to a matrix of normally distributed values

2007-03-16 Thread Matthew Keller
Hi all, [this is a bit hard to describe, so if my initial description is confusing, please try running my code below] #WHAT I'M TRYING TO DO I'd appreciate any help in trying to speed up some code. I've written a script that converts a matrix of integers (usually between 1-10,000 - these

Re: [R] ideas to speed up code: converting a matrix of integers to a matrix of normally distributed values

2007-03-16 Thread Matthew Keller
. . . . . . . . . . .1.2 sort.list 12. . . . . . . . . . . .1.0 match.arg 13. . . . . . . . . . . . .0.7 eval On 3/16/07, Matthew Keller [EMAIL PROTECTED] wrote: Hi all, [this is a bit hard to describe, so if my initial description is confusing, please try running my code below

Re: [R] How to plot two graphs on one single plot?

2007-02-23 Thread Matthew Keller
Hi Yun, If you're asking how to place new graphic material on the same plot (e.g., several lines/points/etc in a single x-y region), this is covered in the Intro to R manual. E.g., you can do: plot(x1, y1, type='p', xlim=range(x1,x2), ylim=range(y1, y2), xlab='x', ylab='y') points(x2, y2,

Re: [R] Google Custom Search Engine for R

2007-02-23 Thread Matthew Keller
Hi Sergio, There was a discussion on this board recently about the difficulty of searching for R related material on the web. I think the custom google search engine is a good idea. It would be helpful if we could have access to the full list of websites it is indexing so that we could make

Re: [R] matlab style plotting in R

2007-02-13 Thread Matthew Keller
Hi Maria, I'm interested in the responses you get. The way I do this is to use par(new=TRUE), which tells R not to clean the frame before plotting the next plot. So, eg ###Overlaid plot op - par(mar = c(5, 4, 4, 5) + 0.1, las = 2)

Re: [R] R in Industry

2007-02-06 Thread Matthew Keller
Bob, Far from flaming you, I think you made a good point - one that I imagine most people who use R have come across. The name R is a big impediment to effective online searches. As a check, I entered R software, SAS software, SPSS software, and S+ software into google. The R 'hit rate' was only

Re: [R] Download stock prices

2007-02-04 Thread Matthew Keller
Hi Mihai, You might check out the Rmetrics bundle, available on the cran website. I've used its fBasics library to download stock prices. Try the yahooImport() function and the keystats() function for downloading specific stock prices. I had to fiddle with the keystats function to get it to work

Re: [R] Loading functions in R

2007-02-01 Thread Matthew Keller
Hi Jeff, The way I do this is to place all the options that I want, along with functions I've written that I always want available, into the Rprofile.site file. R always loads this file upon startup. That file is located in the etc/ folder. E.g., on my computer, it is at: C:\Program

Re: [R] How to print the objects in the memory

2007-01-31 Thread Matthew Keller
Hi usstata, I think this will get you what you want: mget(ls(),globalenv()) On 1/31/07, usstata [EMAIL PROTECTED] wrote: Hi,all: May be a pointless question a - 1:10 b - matrix(1:8,nrow = 4) c - letters[4:8] …… ls() [1] a b

[R] what is the purpose of an error message in uniroot?

2007-01-31 Thread Matthew Keller
Hi all, This is probably a blindingly obvious question: Why does it matter in the uniroot function whether the f() values at the end points that you supply are of the same sign? For example: f - function(x,y) {y-x^2+1} #this gives a warning uniroot(f,interval=c(-5,5),y=0) Error in uniroot(f,