[R] density of hist(freq = FALSE) inversely affected by data magnitude

2013-01-22 Thread J Toll
Hi, I have a couple of observations, a question or two, and perhaps a suggestion related to the plotting of density on the y-axis within the hist() function when freq=FALSE. I was using the function and trying to develop an intuitive understanding of what the density is telling me. After

Re: [R] density of hist(freq = FALSE) inversely affected by data magnitude

2013-01-22 Thread J Toll
Bill, Thank you. I got it. That can require a fair amount of work to interpret the density, especially with odd or irregular bin sizes. Thanks again, James On Tue, Jan 22, 2013 at 5:33 PM, William Dunlap wdun...@tibco.com wrote: The probability density function is not unitless - it is the

Re: [R] split rbind (cast) dataframe

2013-01-11 Thread J Toll
On Fri, Jan 11, 2013 at 6:46 AM, Johannes Radinger johannesradin...@gmail.com wrote: I would like to split dataframe based on one colum and want to connect the two dataframes by rows (like rbind). Here a small example: # The orgininal dataframe df1 - data.frame(col1 = c(A,A,B,B),col2 =

Re: [R] locating element in distance matrix

2013-01-11 Thread J Toll
On Fri, Jan 11, 2013 at 11:55 AM, eliza botto eliza_bo...@hotmail.comwrote: Dear useRs, I have a very basic question. I have a distance matrix and i skipped the upper part of it deliberately. The distance matrix is 1000*1000. Then i used min command to extract the lowest value from that

Re: [R] weird merge()

2013-01-11 Thread J Toll
On Fri, Jan 11, 2013 at 12:50 PM, array chip arrayprof...@yahoo.com wrote: Hi, I have some protein array data, each array in a separate text file. So I read them in and try to combine them into a single data frame by using merge(). see code below (If you download the attached data files into

Re: [R] arima.sim

2012-10-25 Thread J Toll
. Thanks. James On Mon, Oct 8, 2012 at 9:23 AM, J Toll jct...@gmail.com wrote: Hi, I have been using arima.sim from the stats package recently, and I'm wondering why I get different results when using what seem to be the same parameters. For example, I've given examples of three different ways

Re: [R] append for .Rdata?

2012-10-10 Thread J Toll
On Tue, Oct 9, 2012 at 10:35 AM, Jessica Streicher j.streic...@micromata.de wrote: Can i somehow append objects to an .Rdata file? I didn't see an option for it in the save() method. dump() won't work since i have s4 objects in there. I'm not sure I completely understand the issues you're

[R] arima.sim

2012-10-08 Thread J Toll
Hi, I have been using arima.sim from the stats package recently, and I'm wondering why I get different results when using what seem to be the same parameters. For example, I've given examples of three different ways to run arima.sim with what I believe are the same parameters. It's my

Re: [R] memory leak using XML readHTMLTable

2012-09-18 Thread J Toll
On Mon, Sep 17, 2012 at 3:16 PM, Duncan Temple Lang dtemplel...@ucdavis.edu wrote: The version of the package on github is in the standard R format and that part of the README is no longer relevant. Sorry for the confusion. It might be simplest to pick up a tar.gz file of the source at

Re: [R] memory leak using XML readHTMLTable

2012-09-17 Thread J Toll
On Mon, Sep 17, 2012 at 12:51 PM, Yihui Xie x...@yihui.name wrote: I think the correct address for GIT should be git://github.com/omegahat/XML.git :) Or just https://github.com/omegahat/XML Regards, Yihui -- Yihui Xie xieyi...@gmail.com Phone: 515-294-2465 Web: http://yihui.name

[R] memory leak using XML readHTMLTable

2012-09-16 Thread J Toll
Hi, I'm using the XML package to scrape data and I'm trying to figure out how to eliminate the memory leak I'm currently experiencing. In the searches I've done, it sounds like the existence of the leak is fairly well known. What isn't as clear is exactly how to solve it. The general process

Re: [R] R equivalent of python module structure and functionality?

2012-09-11 Thread J Toll
On Tue, Sep 11, 2012 at 6:00 PM, Tom Roche tom_ro...@pobox.com wrote: summary: how to structure an R file such that it can be both 1. used as a script via, e.g., (from OS commandline) $ Rscript foo.r bar=baz 2. imported and called as a function via, e.g. (from R commandline)

Re: [R] Problem with duplicates in row.names

2012-09-07 Thread J Toll
On Fri, Sep 7, 2012 at 11:04 AM, STADLER Frederic frederic.stad...@unifr.ch wrote: Hello, I am drawing a heatmap with hundreds of genes. Everything work fine, except when I want to had the name of the genes as the row.names with row.names (a)-a$Name And there's this things that duplicate are

Re: [R] Univariate Time Series Analysis in R

2012-07-31 Thread J Toll
On Tue, Jul 31, 2012 at 9:13 AM, override hugos...@gmail.com wrote: I want to realise an univariate time series analysis in R, can someone help me for the first steps? There's a lot of material on this subject if you just do a basic search of Google or rseek.org. As already mentioned, the CRAN

Re: [R] raw input prompt

2012-06-02 Thread J Toll
On Fri, Jun 1, 2012 at 1:01 PM, meatloafthefrog meatloafthef...@gmail.com wrote: I want a prompt that asks the user for the file name of the table, the response to which will be the name of the table in R. So I did something like: file_name = function()                                        

Re: [R] Remove columns from dataframe based on their statistics

2012-05-31 Thread J Toll
On Thu, May 31, 2012 at 8:27 AM, Johannes Radinger jradin...@gmx.at wrote: Hi, I have a dataframe and want to remove columns from it that are populated with a similar value (for the total column) (the variation of that column is 0). Is there an easier way than to calculate the statistics and

Re: [R] Remove columns from dataframe based on their statistics

2012-05-31 Thread J Toll
On Thu, May 31, 2012 at 8:52 AM, J Toll jct...@gmail.com wrote: for (i in seq(ncol(df), 1))  if (length(unique(df[, i])) == 1) {  df[, i] - NULL } Here's a similar method employing a more functional approach: df[, apply(df, 2, function(x) length(unique(x)) 1)] James

Re: [R] Using RDF/OWL with R?

2012-05-31 Thread J Toll
On Thu, May 31, 2012 at 6:40 AM, Oliver Ruebenacker cur...@gmail.com wrote:     Hello,  Is there a convenient way to import RDF/OWL data into R?  I'm interested in importing BioPAX/SBPAX data into R to make them available for a wider audience. One exciting application would be to use

[R] using XML package to read RSS

2012-05-16 Thread J Toll
Hi, I'm trying to use the XML package to read an RSS feed. To get started, I was trying to use this post as an example: http://www.r-bloggers.com/how-to-build-a-dataset-in-r-using-an-rss-feed-or-web-page/ I can replicate the beginning section of the post, but when I try to use another RSS feed

Re: [R] using XML package to read RSS

2012-05-16 Thread J Toll
On Wed, May 16, 2012 at 9:02 PM, Duncan Temple Lang dun...@wald.ucdavis.edu wrote: Hi James.  Yes, you need to identify the namespace in the query, e.g.  getNodeSet(doc, //x:entry, c(x = http://www.w3.org/2005/Atom;)) This yeilds 40 matching nodes. (getNodeSet() is more convenient to use

[R] Inf and lazy evaluation

2012-05-14 Thread J Toll
Hi, I have a question involving Inf, lazy evaluation, and maybe argument recycling. I have a directory where I am trying to check for the existence of files of a certain pattern, basically something like filename-#, where # is an integer. I can do something like this, which works.

Re: [R] Inf and lazy evaluation

2012-05-14 Thread J Toll
Thank you all for the replies. On Mon, May 14, 2012 at 2:45 PM, R. Michael Weylandt michael.weyla...@gmail.com wrote: R is lazy, but not quite that lazy ;-) Oh, what is this world coming to when you can't count on laziness to be lazy. ;) I should probably stop reading about Haskell and their

Re: [R] Scraping a web page.

2012-05-14 Thread J Toll
On Mon, May 14, 2012 at 4:17 PM, Keith Weintraub kw1...@gmail.com wrote: Folks,  I want to scrape a series of web-page sources for strings like the following: /en/Ships/A-8605507.html /en/Ships/Aalborg-8122830.html which appear in an href inside an a tag inside a div tag inside a table.

Re: [R] How to replace NA with zero (0)

2012-05-03 Thread J Toll
On Thu, May 3, 2012 at 10:43 AM, Christopher Kelvin chris_kelvin2...@yahoo.com wrote: Is there a command i can issue to replace the NA with zero (0) even if it is after generating the data? Chris, I didn't try your example code, so this suggestion is far more general, but you might try

[R] list.dirs() full.names broken?

2012-04-13 Thread J Toll
Hi, I am trying to list all the sub-directories in a particular directory and having a few issues. list.dirs seems to be slightly broken and/or poorly labelled. My issue appears to be the same as this one, from the archives: http://tolstoy.newcastle.edu.au/R/e16/help/11/11/1156.html Here is

Re: [R] list.dirs() full.names broken?

2012-04-13 Thread J Toll
OK, well list.dirs() seems broken to me. In case someone else needs a working version, I wrote a new function called lsdir(). It adds the ability to choose whether to include hidden directories. It should work on Mac and probably Linux/Unix. lsdir - function(path, format = relative, recursive

Re: [R] Simple For Loop Help

2012-03-29 Thread J Toll
On Thu, Mar 29, 2012 at 4:32 PM, arun.gurubaramurugeshan arun.gurubaramuruges...@autozone.com wrote: Hi, I need help with the following. I have a dataset Y with 200 observations and three variables Y1, Y2 Y3. I have to find the minimum of Y1, Y2 Y3 and if the minimum is Y1 then I have to

Re: [R] Format wanted...

2012-03-24 Thread J Toll
On Sat, Mar 24, 2012 at 7:30 PM, Duncan Murdoch murdoch.dun...@gmail.com wrote: Do we have a format that always includes a decimal point and a given number of significant digits, but otherwise drops unnecessary characters?  For example, if I wanted 5 digits, I'd want the following: Round to 5

[R] mapply assign to generate functions

2012-03-12 Thread J Toll
Hi, I have a problem that I'm finding a bit tricky. I'm trying to use mapply and assign to generate curried functions. For example, if I have the function divide divide - function(x, y) { x / y } And I want the end result to be functionally equivalent to: half - function(x) divide(x, 2)

Re: [R] mapply assign to generate functions

2012-03-12 Thread J Toll
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of J Toll Sent: Monday, March 12, 2012 10:47 AM To: r-help Subject: [R] mapply assign to generate functions Hi, I have a problem that I'm finding a bit tricky.  I'm trying to use mapply

[R] ggplot2: formula for bar width in geom_bar?

2012-03-01 Thread J Toll
Hi, I'm trying to figure out the formula used by ggplot2 to calculate the width of a bar in geom_bar so that I can use that elsewhere in the plot. My code looks like this: ggplot(xAll, aes(Date)) + geom_bar(subset = .(Direction == Up), aes(y = Change, fill = Time), stat = identity) +

Re: [R] downloading Excel files

2012-03-01 Thread J Toll
On Thu, Mar 1, 2012 at 6:43 PM, Erin Hodgess erinm.hodg...@gmail.com wrote: Dear R People: I have been using xlsReadWrite to read Excel files and am very pleased with it.  Thank you xlsReadWrite People! My question is:  is there a function, similar to get.hist.quote, to download Excel files

Re: [R] creating R package

2012-02-03 Thread J Toll
On Fri, Feb 3, 2012 at 11:25 AM, ql16717 ql16...@gmail.com wrote: Hi, I never acutally made a package before. I have a folder, say called john that has everything it needs to be in a R package. Some instruction says I need Rtools from R mirror site. I installed the Rtools, but under DOS, the

[R] ggplot2(0.9.0): could not find function ==

2012-02-01 Thread J Toll
Hi, I have a question related to the newest version of ggplot2 (0.9.0). I just updated this morning and from CRAN it looks like the Mac version is the only one at 0.9.0 as of right now. http://cran.r-project.org/web/packages/ggplot2/index.html Anyway, I was in the midst of a project where I

Re: [R] ggplot2(0.9.0): could not find function ==

2012-02-01 Thread J Toll
On Wed, Feb 1, 2012 at 9:48 PM, Hadley Wickham had...@rice.edu wrote: Hi James, There were a few problems with the 0.9.0 version, which is why it was pulled from CRAN.  I'd recommend re-installing 0.8.9: install.packages(ggplot2, type = source) Hadley Hadley, Thanks for your reply. I

Re: [R] ggplot2 stacked bar - sum of values rather than count

2012-01-17 Thread J Toll
On Mon, Jan 16, 2012 at 1:13 AM, Paul p...@paulhurley.co.uk wrote: On 16/01/12 02:08, J Toll wrote: Hi, I'm trying to create a stacked bar plot using ggplot2. Rather than plotting the count of each of the 13 Bar factors on the Y axis, I would like to represent the sum of the Values

[R] ggplot2 stacked bar - sum of values rather than count

2012-01-15 Thread J Toll
Hi, I'm trying to create a stacked bar plot using ggplot2. Rather than plotting the count of each of the 13 Bar factors on the Y axis, I would like to represent the sum of the Values associated with each of the 13 Bar factors. Is there a way to do that? Given the following data, that would

Re: [R] ggplot2 stacked bar - sum of values rather than count

2012-01-15 Thread J Toll
for your suggestion. Your first example using the lattice package is exactly what I was trying to do. I will have to explore lattice, as well as look into the HH package. Thank you. James On Sun, Jan 15, 2012 at 9:08 PM, J Toll jct...@gmail.com wrote: Hi, I'm trying to create a stacked

Re: [R] sum row and col

2011-11-23 Thread J Toll
On Wed, Nov 23, 2011 at 10:17 AM, aa99 abba...@gmail.com wrote:  hey ; i would like to sum the following table by row and col. Appreciate your help. ?rowSums ?colSums HTH James __ R-help@r-project.org mailing list

[R] ar() - AIC and BIC

2011-10-19 Thread J Toll
Hi, I'm slowly working through Tsay's Analysis of Financial Time Series 3rd ed.  I'm trying to replicate Table 2.1 on p.47, which gives PACF, AIC, and BIC for the monthly simple returns of the CRSP value-weighted index. The data:

[R] plot 3 lines with ggplot2

2011-09-12 Thread J Toll
Hi, I am trying to learn to use ggplot2 for what I had hoped would be a fairly simple task. I have a relatively small data.frame (100 by 4). The first column contains symbols. The 2nd, 3rd and 4th columns represent percentage weightings for each symbol using 3 different methodologies. For

Re: [R] plot 3 lines with ggplot2

2011-09-12 Thread J Toll
you, James On Mon, Sep 12, 2011 at 11:43 AM, J Toll jct...@gmail.com wrote: Hi, I am trying to learn to use ggplot2 for what I had hoped would be a fairly simple task.  I have a relatively small data.frame (100 by 4). The first column contains symbols.  The 2nd, 3rd and 4th columns

Re: [R] Grouped bar plot

2011-05-18 Thread J Toll
On Wed, May 18, 2011 at 2:38 PM, Peter Ehlers ehl...@ucalgary.ca wrote: On 2011-05-18 11:13, jctoll wrote: Hi, I am trying to produce a grouped bar plot from a data.frame and I'm having difficulties figuring out how to do so.  My data is 500 rows by 4 columns and basically looks like so:

Re: [R] Extract one element from yahooKeystats data

2009-04-28 Thread J Toll
On Mon, Apr 27, 2009 at 5:42 PM, David Winsemius dwinsem...@comcast.net wrote: Using str(data) would have been more informative. data it turns out is a dataframe with a single column. which is a factor with rownames. Not the most typical of constructions, but the authors must have had their

[R] Extract one element from yahooKeystats data

2009-04-27 Thread J Toll
I am trying to extract one particular piece of data(Float) from all the data returned by yahooKeystats, but thus far I'm having no luck. This is what I've got so far: library(fImport) Loading required package: timeSeries Loading required package: timeDate data-yahooKeystats(IBM) trying URL