Re: [R] R in MAC add many extra ´s

2011-06-16 Thread Jonathan Daily
Do you mean prompts (the that indicates R is waiting for input)? Your issue is not clear. Please post a copy/paste of your session, as well as your sessionInfo(). On Thu, Jun 16, 2011 at 7:16 AM, Rosario Garcia Gil m.rosario.gar...@slu.se wrote: Hello I have a annoying problem with R (which I

Re: [R] Read in from multiple Excel wksheets

2011-06-14 Thread Jonathan Daily
Java uses heap space when creating new objects. My guess is that since the default size is 128 Mb iirc, you are reading in an object larger than this. I don't know the guts of the xlsx package or if there is a way to increase the heap, but you may get by if you can divide up your data import.

Re: [R] Adapting R code for different traps

2011-06-09 Thread Jonathan Daily
Hi Ben, Unfortunately, I left the usb cable for my crystal ball at home, and thus have no idea how your data is organized. Could you post an example along with what you expect the output to be? Jon On Thu, Jun 9, 2011 at 7:22 AM, bjmjarrett bjmjarr...@gmail.com wrote: Hi all, My code:

Re: [R] Adapting R code for different traps

2011-06-09 Thread Jonathan Daily
OK, Assume all your trap names are stored in a vector trap.names. Does: sapply(trap.names, FUN = function(x) { tmp. - outer(release.days[Trap==x],collection.days.2[Trap==x],'-') tmp - ifelse(temp.ACAP1=0,NA,temp.ACAP1) return(apply(temp.ACAP1,2,max,na.rm=TRUE)) } ) Work? I feel there has to be

Re: [R] Decision Trees /Decision Analysis with R?

2011-06-08 Thread Jonathan Daily
See packages rpart, randomForest, party. Also, typing R Decision Trees produced good google results. http://www.google.com/search?aq=fsourceid=chromeie=UTF-8q=R+Decision+Trees On Wed, Jun 8, 2011 at 7:02 AM, stefan.d...@gmail.com stefan.d...@gmail.com wrote: Hello, this question is a bit out

Re: [R] Decision Trees /Decision Analysis with R?

2011-06-08 Thread Jonathan Daily
a synthetic tree with exogenously defined decision nods/rules. Or am I wrong? Thanks and best, Stefan On Wed, Jun 8, 2011 at 2:03 PM, Jonathan Daily biomathjda...@gmail.com wrote: See packages rpart, randomForest, party. Also, typing R Decision Trees produced good google results. http

Re: [R] qplot fill and colour not working as expected

2011-06-06 Thread Jonathan Daily
One difference between colour and fill can be demonstrated by specifying both with different values. In cases where a polygon is filled, colour specifies border line color. On Mon, Jun 6, 2011 at 9:49 AM, wwreith reith_will...@bah.com wrote: I am just learning to use qplot and can't get the

Re: [R] tkrplot Newbie

2011-06-03 Thread Jonathan Daily
According to documentation, tkrplot's fun parameter accepts a function of no arguments. If you remove the arguments from your function, does that kill the error message? On Fri, Jun 3, 2011 at 11:42 AM, Costas Vorlow costas.vor...@gmail.com wrote: Hello, I am trying to write a tcltk based

Re: [R] Removing rows of zeros from a matrix

2011-06-02 Thread Jonathan Daily
Assuming the matrix is named X: X[which(rowSums(X) 0),] should work. Also, this list is a text-only list. As you are using gmail, sending text only messages is very easy, and may clear confusion in future posts. HTH, Jon On Thu, Jun 2, 2011 at 11:23 AM, Jim Silverton jim.silver...@gmail.com

Re: [R] ARM package for R 2.10.1

2011-06-02 Thread Jonathan Daily
I would recommend trying to fix the installation of R 2.13.0 rather than trying to obtain old packages. Try downloading the installer again from a different mirror. On Thu, Jun 2, 2011 at 10:33 AM, jmdpulido jmdpul...@yahoo.es wrote: Dear all... I am looking for the zip file of an old version

Re: [R] generically forward low-level graphic parametres in function

2011-06-02 Thread Jonathan Daily
try using `...` function - function(x, ...) { #do stuff plot(xy, ...) } On Thu, Jun 2, 2011 at 1:26 PM, eldor ado rat.c...@gmail.com wrote: Hello, following problem: i have a written my own function  to draw some sophisticated graphic, which after manipulating data somewhere contains a

Re: [R] Identifying sequences

2011-06-01 Thread Jonathan Daily
I am assuming in this case that you are looking for continuity along integers, so if you expect noninteger values this will not work. You can get the index of where breaks can be found in your example using which(diff(x) 1) On Wed, Jun 1, 2011 at 6:27 AM, christiaan pauw cjp...@gmail.com

Re: [R] creating a vector from a file

2011-05-31 Thread Jonathan Daily
So you need to read a file into R in that format? Try changing the values in ?read.table. Using the example, I was able to get the data using: read.table(clipboard, sep = =, header = F, colClasses = c(character, numeric)) On Tue, May 31, 2011 at 10:19 AM, heimat los heimatlo...@gmail.com

Re: [R] where two matrices differ?

2011-05-31 Thread Jonathan Daily
Does this work for you? which(is.nan(mat1 %% mat2), arr.ind = T) On Tue, May 31, 2011 at 10:52 AM, Alaios ala...@yahoo.com wrote: Thanks alot. Unfortunately I can not apply this to much bigger matrices as I can not visually check all the components. Regards Alex --- On Tue, 5/31/11,

Re: [R] Suppress intermediate results on console

2011-05-27 Thread Jonathan Daily
If you want to extract values from without printing, use indexing. Check ?`[` for various ways to extract values. These, of course, depend on what x is, which you have still not provided. This is also fairly basic and covered in the introduction to R. Have you read it? If not, you should do so

Re: [R] Put names in the elements of lapply result

2011-05-27 Thread Jonathan Daily
Does this work for you? dat - lapply(c('EMAX','EC50','KOUT','GAMMA'),function(x)confint(lm(get(x)~RR0,dataset2))) names(dat) - c('EMAX','EC50','KOUT','GAMMA') On Fri, May 27, 2011 at 10:03 AM, Jun Shen jun.shen...@gmail.com wrote: Dear list, I am running some linear regressions through

Re: [R] Speed up an R code

2011-05-27 Thread Jonathan Daily
This is a very open ended question that depends very heavily on what you are trying to do and how you are doing it. Often times, the bottleneck operations that limit speed the most are not necessarily sped up by adding RAM. They also often require special setup to run multiple

Re: [R] Unable to Plot using headers.

2011-05-27 Thread Jonathan Daily
I would caution against using attach(), however, if you are not in an interactive session. In functions and scripts, errors can often cause the interpreter to exit before the detach(), leaving your data on the search path. 99% of all attach/detach cases can be handled by ?with and ?within. The

Re: [R] Using read.xls

2011-05-26 Thread Jonathan Daily
Another workaround if you don't need to batch the process up is to highlight the cells of the excel file in question, copy it to the clipboard, and use read.table(clipboard). I also use this often when people pass me huge, unwieldy excel files that have multiple sets of data, summaries, formula,

Re: [R] Suppress intermediate results on console

2011-05-26 Thread Jonathan Daily
Well, since we have no idea what x is, that is going to be hard to do. Are you calling summary because you want the info on the last iteration of a loop? If so, just put the summary call outside the loop. Otherwise, why are you calling summary if you don't want a summary? Also, the posting guide

Re: [R] Processing large datasets

2011-05-25 Thread Jonathan Daily
In cases where I have to parse through large datasets that will not fit into R's memory, I will grab relevant data using SQL and then analyze said data using R. There are several packages designed to do this, like [1] and [2] below, that allow you to query a database using SQL and end up with that

Re: [R] R in batch mode

2011-05-24 Thread Jonathan Daily
://cbhsqsurvey.samhsa.gov -Original Message- From: Jonathan Daily [mailto:biomathjda...@gmail.com] Sent: Tuesday, May 24, 2011 1:18 PM To: Muhuri, Pradip (SAMHSA/CBHSQ) Cc: R-help@r-project.org Subject: Re: [R] R in batch mode Save it anywhere that is on your search path, which can

Re: [R] Data Frame housekeeping

2011-05-24 Thread Jonathan Daily
My suggestion, since bold doesn't show up in a text only mailing list, would be to look into the function ?aggregate. It looks like something like (assuming your data is in a mydat): mydat.new - aggregate(cbind(STN_ID, YEAR, MM, DAY) ~ ELEM + ?, mydat, FUN = ?) #this is up to you Alternatively,

Re: [R] Building Custom GUIs for R

2011-05-20 Thread Jonathan Daily
Some good tcltk examples can be found online [1]. I have also found the fgui package on CRAN [2], though I have not actually used it yet. [1] http://bioinf.wehi.edu.au/~wettenhall/RTclTkExamples/ [2] http://cran.cnr.berkeley.edu/web/packages/fgui/index.html On Fri, May 20, 2011 at 2:52 AM,

Re: [R] problem with optim()

2011-05-19 Thread Jonathan Daily
What do you mean when you say wrong results? What do you expect for the output? Your code doesn't work for me because it references X in places and X is not defined. Have you tested your functions to make sure they return reasonable values? On Thu, May 19, 2011 at 9:17 AM, chirine wolley

Re: [R] problem with optim()

2011-05-19 Thread Jonathan Daily
I cc'd r-help to get this message back on the board. Again, you haven't really answered my questions. Comments inline. On Thu, May 19, 2011 at 9:45 AM, chirine wolley wolley.chir...@hotmail.com wrote: First, thank you for ur response... Actually I didn't write the entire code ...X, Y and

Re: [R] Dataset Quasi Poisson

2011-05-18 Thread Jonathan Daily
1) This mailing list is not for homework. 2) I would recommend reading the introduction to R that comes with every installation of R, since your answer is in there. Alternatively, you could google R and quasi poisson. On Wed, May 18, 2011 at 11:42 AM, ilpoeta84 antonioperfe...@gmail.com wrote:

Re: [R] Dealing with null values Aggregate function

2011-05-17 Thread Jonathan Daily
Furthermore, aggregate passes extra arguments to FUN, so explicit declaration of na.rm = T can be done in the call to aggregate directly: aggregate(cbind(v1, v2) ~ v3, data = testDF, FUN = mean, na.rm = T) HTH, Jon On Tue, May 17, 2011 at 5:22 AM, Jannis bt_jan...@yahoo.de wrote: Andy, have

Re: [R] pdf (probability distribution function) and cdf

2011-05-17 Thread Jonathan Daily
Do you have a reproducible example? As posed I have no idea what this vector contains. Are you assuming a specific distribution type and using these vectors to parameterize it? On Tue, May 17, 2011 at 10:08 AM, Alaios ala...@yahoo.com wrote: Dear all, I would like for a given vector to

Re: [R] integrate

2011-05-16 Thread Jonathan Daily
What exactly is the problem? Please read the posting guide and follow it. Your message is hard to interpret as is (in no small part because it looks like markup), contains no R code, and has no mention of an error at all. 2011/5/15 meltem gölgeli megolg...@gmail.com: Dear R-users, I'am really

Re: [R] R won't start keeps crashing

2011-05-12 Thread Jonathan Daily
This is not very informative. What exactly is crashing? What is your sessionInfo() output? On Thu, May 12, 2011 at 7:57 AM, Bazman76 h_a_patie...@hotmail.com wrote: OK I did a seach for the files and got: .Rdata which is 206KB Canada.Rdata which is 3kB If I click on .Rdata I get the crash.

Re: [R] R won't start keeps crashing

2011-05-12 Thread Jonathan Daily
I have some suggestions inline below. My biggest suggestion would be to read the help files that came with R, especially the section Invoking R in An Introduction to R. On Thu, May 12, 2011 at 10:24 AM, Bazman76 h_a_patie...@hotmail.com wrote:

Re: [R] do.call and applying na.rm=TRUE

2011-05-12 Thread Jonathan Daily
?do.call Second argument is a list of arguments to pass. Try do.call(mean, list(x, na.rm = T)) On Thu, May 12, 2011 at 1:57 PM, John Kerpel john.ker...@gmail.com wrote: Hi all!  I need to do something really simple using do.call. If I want to call the mean function inside do.call, how do I

Re: [R] what happens when I store linear models in an array?

2011-05-04 Thread Jonathan Daily
It looks like your call: lms.ASP[1,1] - list(surf105.lm.ASP) makes a list of length 1 containing the lm object and puts that list into element [1,1] of your array. That is why you will need the extra indexing call of [[1]] Andrew Robinson suggested. On Wed, May 4, 2011 at 9:02 AM, Andrew

Re: [R] combine lattice plot and standard R plot

2011-05-04 Thread Jonathan Daily
If you read the help documentation, lattice is not really compatible with standard graphics. library(lattice) ?lattice 2011/5/4 Lucia Cañas lucia.ca...@co.ieo.es: Dear R users, I would like to combine lattice plot (xyplot) and standard R plot (plot and plotCI) in an unique figure. I use

Re: [R] Problems with Rterm 2.13.0 - but not RGui

2011-05-03 Thread Jonathan Daily
\i386\Rterm  # Problem I will submit a bug report on this. Kind regards, Stefan McKinnon Edwards -Oprindelig meddelelse- Fra: Jonathan Daily [mailto:biomathjda...@gmail.com] Sendt: 2. maj 2011 16:59 Til: Stefan McKinnon Høj-Edwards Cc: r-help@r-project.org Emne: Re: [R] Problems

Re: [R] Sum the cell of a vector

2011-05-03 Thread Jonathan Daily
?cumsum On Tue, May 3, 2011 at 11:32 AM, Alaios ala...@yahoo.com wrote: Dear all, I would like to know what is the most time efficient way to calculate the following in a huge vector. Let's say that I have the vector 1,2,3,4,5,6 and I want to return a vector of the same length which

Re: [R] Simple loop

2011-05-03 Thread Jonathan Daily
It is actually possible and preferable to do this with no loops. Assuming your data is in a dataframe called dat: idx - with(dat, Site == 1 Prof == 1) dat - within(dat, { new = H - ifelse(Site == 1 Prof == 1, min(H[idx]), min(H[!idx])) }) dat which also serves to illuminate the difference

Re: [R] pie of pie chart

2011-05-02 Thread Jonathan Daily
The package ggplot2 can do this using a density statistic, polar coordinates, and faceting. Extra documentation for the package can be found at the author's site [1]. [1] http://had.co.nz/ On Mon, May 2, 2011 at 10:06 AM, Mathias Walter mathias.wal...@gmx.net wrote: Hi, despite the fact that

Re: [R] Problems with Rterm 2.13.0 - but not RGui

2011-05-02 Thread Jonathan Daily
The message is pretty clear. Access denied means you don't have permission to access the path. This also explains why the packages fail to load - you don't have access to R's package library. It most likely works on RGui because you are clicking it/running it as admin (you did not specify how you

Re: [R] setting options only inside functions

2011-04-29 Thread Jonathan Daily
/enableInterupts or something like that).  There is something in the Haskell literature on this that I have looked at a while back -- probably time to have another look. On Thu, 28 Apr 2011, Jonathan Daily wrote: I would also love to see this implemented in R, as my current solution to the issue

Re: [R] ctree and survival problem

2011-04-28 Thread Jonathan Daily
It would help people who know more about R's guts than me if you posted your sessionInfo() output and exactly what commands produced your error. It is also recommended that you try simply upgrading R to the latest version and see if you get an error with the latest version of 'party'. My guess is

Re: [R] setting options only inside functions

2011-04-28 Thread Jonathan Daily
I would also love to see this implemented in R, as my current solution to the issue of doing tons of open/close, dev/dev.off, etc. is to use snippets in my IDE, and in the end I feel like it is a hack job. A pythonic with function would also solve most of the situations where I have had to use

Re: [R] Putting x-axis in opposite order

2011-04-28 Thread Jonathan Daily
Actually, it is plotting the points in the decreasing order. See: plot(xx) Are you looking to reverse the x axis? Perhaps you will find an answer in either ?par or ?axis. On Thu, Apr 28, 2011 at 2:09 PM, Bogaso Christofer bogaso.christo...@gmail.com wrote: Hi all, please consider this plot:

Re: [R] Subsetting Data

2011-04-28 Thread Jonathan Daily
Try this: sum(dat$Number = 10) On Thu, Apr 28, 2011 at 3:13 PM, Abraham Mathew abmathe...@gmail.com wrote: I'm using the subset() function in R. dat - data.frame(one=c(6,7,8,9,10), Number=c(5,15,13,1,13)) subset(dat, Number = 10) However, I want to find the number of all rows who meet the

Re: [R] setting options only inside functions

2011-04-27 Thread Jonathan Daily
There is probably a more elegant way to do this, but you could write it into dummy1(): dummy1 - function() { ...original function options(old.options) } Alternatively, you could use ?tryCatch with the finally argument as a call to options. HTH, Jon On Wed, Apr 27, 2011 at 9:16 AM, Jannis

Re: [R] Pause the execution of a function

2011-04-27 Thread Jonathan Daily
Try ?scan or ?readLines. On Wed, Apr 27, 2011 at 11:42 AM, Lisa lisa...@gmail.com wrote: Dear all, I am trying to write a script to pause the execution of a function and provide some additional commands to the function and then continue execution of the function. For example, when my

Re: [R] Paste problem when looping variable assignments

2011-04-22 Thread Jonathan Daily
The function you are looking for is ?assign. assign(paste(pds_gagehandles[[i]], _pdswy, sep = ), ...) For the reverse, in case you are interested, check out ?get. HTH, Jon On Fri, Apr 22, 2011 at 1:49 PM, armstrwa william.armstr...@noaa.gov wrote: One thing I should have mentioned before is