[R] textbox in lattice

2010-06-01 Thread Noah Silverman
Hi, I want to add a box at the bottom of a lattice window (device/page?). Lattice has drawn a nice group of panels with all the plots I need. How do I add my own summary text at the bottom (several lines worth?) __ R-help@r-project.org mailing list

Re: [R] Problem using apply

2010-06-01 Thread Peter Langfelder
Well, your example matrix is symmetric, so row and column operations naturally return the same values. You may want to note though that if you apply your function to a matrix along rows, the results will be stored in the __columns__ of the resulting matrix. Thus, if you want to simply divide the

Re: [R] Plot multiple columns

2010-06-01 Thread Dennis Murphy
Hi: Ben's example worked for me as follows: x - matrix(runif(22000),ncol=22) library(lattice) library(coda) m - as.mcmc(x) xyplot(m, layout = c(2, 11)) layout = uses columns first, then rows...I always forget that :) It also has an optional third argument for pages, which might come in handy

Re: [R] Plot multiple columns

2010-06-01 Thread Noah Silverman
You are correct, I initially missed the as.mcmc step. Without it, R doesn't want to squeeze so many plots onto a page. Thanks! On 6/1/10 10:48 AM, Dennis Murphy wrote: Hi: Ben's example worked for me as follows: x - matrix(runif(22000),ncol=22) library(lattice) library(coda) m -

Re: [R] Plot multiple columns

2010-06-01 Thread Noah Silverman
Another thought I had was to use Sweave. I could, in theory, use Sweave to create a plot only 7 inches high, and then a summary table 4 inches high below it, all on the same page of a Latex document. Could be messy, but might work. On 6/1/10 11:18 AM, Dennis Murphy wrote: On Tue, Jun 1,

Re: [R] textbox in lattice

2010-06-01 Thread baptiste auguie
Hi, It's not clear what you mean by summary text without a minimal reproducible example. If your text is ordered as a matrix or a data.frame, you might want to try this grid function, gridExtra::grid.table(as.matrix(summary(iris)), theme=theme.white()) If your text has the form of a paragraph,

Re: [R] textbox in lattice

2010-06-01 Thread Noah Silverman
Hi, It is a matrix. Exactly the output of summary(foo) Would you call the gridExtra command before the xyplot command or after? Now I have: temp - as.mcmc(foo) xyplot(temp, layout=c(2,11), main=plot title) THANKS!! On 6/1/10 11:35 AM, baptiste auguie wrote: Hi, It's not clear what you

Re: [R] textbox in lattice

2010-06-01 Thread Noah Silverman
That's amazing. (It would have taken me many hours to figure this out on my own.) Two quick last questions and then I'm off to plotting: 1) How can I reduce the font size of the table. (It is huge on my plot.) 2) How can I control the ratio of plot area to table area in the grid? Thanks a

Re: [R] textbox in lattice

2010-06-01 Thread Erik Iverson
Noah Silverman wrote: That's amazing. (It would have taken me many hours to figure this out on my own.) Two quick last questions and then I'm off to plotting: 1) How can I reduce the font size of the table. (It is huge on my plot.) 2) How can I control the ratio of plot area to table area in

Re: [R] R on the iPhone/iPad? Not so much....a GPL violation

2010-06-01 Thread Ken Williams
Hi Marc, I want to debate a couple points from your post: 1. Distribution of GPL covered applications is not permissible via the App Store due to the Apple Terms of Service language, which infringes upon rights granted under the GPL. 'Nuff said. I'm not sure I agree with this, but there's

[R] studentized residues from nls()

2010-06-01 Thread array chip
Hi, I am wondering if there is a way to extract studentized residues from a nls() object? I searched archive, someone posted a similar question before (http://tolstoy.newcastle.edu.au/R/e6/help/09/04/10845.html), but didn't get an answer. Thanks for any suggestions, John

Re: [R] data frame manipulation with zero rows

2010-06-01 Thread arnaud Gaboury
Maybe not the cleanest way, but I create a fake data frame with one row so ddply() is happy!! if (nrow(futures)==0) futures-data.frame(...) -Original Message- From: Peter Ehlers [mailto:ehl...@ucalgary.ca] Sent: Tuesday, June 01, 2010 12:07 PM To: arnaud Gaboury Cc: 'Prof

Re: [R] Problem using apply

2010-06-01 Thread Joachim de Lezardiere
Thank you Henrique, I still don’t understand why my code doesn’t work ? According to the definition of apply function it should work no ? From: Henrique Dallazuanna [mailto:www...@gmail.com] Sent: Tuesday, June 01, 2010 7:34 PM To: Joachim de Lezardiere Cc: r-help@r-project.org Subject:

[R] When normality test violate and sample size is large(n=400) can I use t-test

2010-06-01 Thread Kourosh Ks
Dears  When normality test  violate and sample size is large(n=400) can I use t-test? best gards kourosh [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

[R] Using R with Web services

2010-06-01 Thread marcos carvajalino
Hello list helpers, I'm working at a research institute and I've been asked to develop a way of using R as a scripting and analysis tool which takes information from users via web forms, perform a query to an Oracle Database running on a Linux server and finally return formatted reports to the

[R] regexpr help (match.length=0)

2010-06-01 Thread McGehee, Robert
R-help, Sorry if this is more of a regex question than an R question. However, help would be appreciated on my use of the regexpr function. In the first example below, I ask for all characters (a-z) in 'abc123'; regexpr returns a 3-character match beginning at the first character.

[R] Reading file

2010-06-01 Thread Robert Tsutakawa
I am trying to read a source program into a mac pro laptop, which uses Snow Leopard. R is unable to find the file containing my source program. I'm using the function source( file name). I need some examples or detailed instructions. I have no problem reading the file using PC. Bob

Re: [R] regexpr help (match.length=0)

2010-06-01 Thread Erik Iverson
McGehee, Robert wrote: R-help, Sorry if this is more of a regex question than an R question. However, help would be appreciated on my use of the regexpr function. In the first example below, I ask for all characters (a-z) in 'abc123'; regexpr returns a 3-character match beginning at the first

Re: [R] When normality test violate and sample size is large(n=400) can I use t-test

2010-06-01 Thread Robert A LaBudde
At 11:45 AM 6/1/2010, Kourosh Ks wrote: Dears When normality test violate and sample size is large(n=400) can I use t-test? best gards kourosh Generally yes, unless there is something really pathological about the distribution. You should note that, for n = 400, even the simplest

[R] problem with intToChar

2010-06-01 Thread Changbin Du
Hi, Dear R- community, I am use the intToChar function to convert the integers to letters. But the output is mess. Can you guys give some suggestions? Thanks! outcome.predict [1] 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 7 4 4 4 4 4 4 4 4 [26] 4 4 4 4 4 4 4 4 4 4 4

Re: [R] Using R with Web services

2010-06-01 Thread Ista Zahn
Hi Marcos, If your server is running Apache I highly recommend looking at RApache (see http://biostat.mc.vanderbilt.edu/rapache/). This will not help with the database connection part though. Best, Ista On Tuesday 01 June 2010 3:05:27 pm marcos carvajalino wrote: Hello list helpers, I'm

Re: [R] problem with intToChar

2010-06-01 Thread Henrique Dallazuanna
Try this: LETTERS[outcome.predict] On Tue, Jun 1, 2010 at 5:43 PM, Changbin Du changb...@gmail.com wrote: Hi, Dear R- community, I am use the intToChar function to convert the integers to letters. But the output is mess. Can you guys give some suggestions? Thanks! outcome.predict [1]

Re: [R] Using R with Web services

2010-06-01 Thread Tal Galili
I refer to several resources on the subject here: http://www.r-statistics.com/category/r-and-the-web/ But the first I would suggest you to look at is this: http://www.r-statistics.com/2010/02/web-development-with-r-an-hd-video-tutorial-of-jeroen-ooms-talk/ It won't answer all of yor questions

Re: [R] problem with intToChar

2010-06-01 Thread Changbin Du
It does not work. outcome.label-LETTERS(outcome.predict) Error: could not find function LETTERS On Tue, Jun 1, 2010 at 1:48 PM, Henrique Dallazuanna www...@gmail.comwrote: Try this: LETTERS[outcome.predict] On Tue, Jun 1, 2010 at 5:43 PM, Changbin Du changb...@gmail.com wrote: Hi,

Re: [R] problem with intToChar

2010-06-01 Thread Sarah Goslee
That isn't really enough information to answer your question, since you don't tell us where intToChar comes from or what you are trying to do, but here are a couple of possibilities: ?intToChar No documentation for 'intToChar' in specified packages and libraries: you could try '??intToChar'

Re: [R] problem with intToChar

2010-06-01 Thread Erik Iverson
Changbin Du wrote: It does not work. outcome.label-LETTERS(outcome.predict) Error: could not find function LETTERS That is not when Henrique typed. LETTERS is a vector, and must be indexed as such, i.e., with []. __ R-help@r-project.org

Re: [R] problem with intToChar

2010-06-01 Thread Henrique Dallazuanna
use [ not ( On Tue, Jun 1, 2010 at 5:50 PM, Changbin Du changb...@gmail.com wrote: It does not work. outcome.label-LETTERS(outcome.predict) Error: could not find function LETTERS On Tue, Jun 1, 2010 at 1:48 PM, Henrique Dallazuanna www...@gmail.comwrote: Try this:

[R] lapply with functions with changing parameters

2010-06-01 Thread Bunny, lautloscrew.com
Dear all, I am trying to avoid a for loop here and wonder if the following is possible: I have a data.frame with 6 columns and i want to get a cross-correlogram (by using ccf) . Obivously ccf only accepts two columns at once and then returms a list. In fact, with a for loop i´d do the

Re: [R] problem with intToChar

2010-06-01 Thread Erik Iverson
Changbin Du wrote: Hi, Dear R- community, I am use the intToChar function to convert the integers to letters. But the output is mess. Can you guys give some suggestions? Thanks! I suggest you tell us what you were expecting to happen, that is, what do you actually want? It looks like

Re: [R] Reading file

2010-06-01 Thread Stephan Kolassa
Have you set the correct working directory? ?setwd ?getwd HTH Stephan Robert Tsutakawa schrieb: I am trying to read a source program into a mac pro laptop, which uses Snow Leopard. R is unable to find the file containing my source program. I'm using the function source( file name). I

Re: [R] problem with intToChar

2010-06-01 Thread Changbin Du
the intToChar function is in the package R.oo I AM try to plot the SOM result, use the outcome.labels as labels in the following plot command. outcome.xyf - predict(final.xyf)$unit.prediction outcome.predict- as.numeric(classmat2classvec(outcome.xyf))

Re: [R] problem with intToChar

2010-06-01 Thread Changbin Du
Thanks to all! Yes, LETTERS[outcome.predict] works! I appreciated your guys help! On Tue, Jun 1, 2010 at 1:53 PM, Henrique Dallazuanna www...@gmail.comwrote: use [ not ( On Tue, Jun 1, 2010 at 5:50 PM, Changbin Du changb...@gmail.com wrote: It does not work.

Re: [R] Using R with Web services

2010-06-01 Thread Charles C. Berry
On Tue, 1 Jun 2010, marcos carvajalino wrote: Hello list helpers, I'm working at a research institute and I've been asked to develop a way of using R as a scripting and analysis tool which takes information from users via web forms, perform a query to an Oracle Database running on a Linux

Re: [R] lapply with functions with changing parameters

2010-06-01 Thread Henrique Dallazuanna
Try this: lapply(mydf[-6], ccf, y = mydf[6]) On Tue, Jun 1, 2010 at 5:50 PM, Bunny, lautloscrew.com bu...@lautloscrew.com wrote: Dear all, I am trying to avoid a for loop here and wonder if the following is possible: I have a data.frame with 6 columns and i want to get a

Re: [R] lapply with functions with changing parameters

2010-06-01 Thread Erik Iverson
Bunny, lautloscrew.com wrote: Dear all, I am trying to avoid a for loop here and wonder if the following is possible: I have a data.frame with 6 columns and i want to get a cross-correlogram (by using ccf) . Obivously ccf only accepts two columns at once and then returms a list. In fact,

Re: [R] how to make monthly time series out of daily

2010-06-01 Thread Jannis
I am not sure about specific timeseries objects, but using an ordinary vector with the values the aggregate() function works fine: monthly.means - aggregate(timeseries, mean, by=months) months now only has to be a vector of length(timeseries) with numbers relating each entry in timeseries to

Re: [R] Problem using apply

2010-06-01 Thread Sarah Goslee
As far as I can tell, your code works perfectly. It's just that the mean of your rows is the same as the mean of your columns because the matrix is symmetric. Compare these two examples (the first one is yours): m = matrix( c(1,4,7,4,5,8,7,8,9), nrow = 3 ) m [,1] [,2] [,3] [1,]14

Re: [R] regexpr help (match.length=0)

2010-06-01 Thread Matt Shotwell
On Tue, 2010-06-01 at 16:43 -0400, Erik Iverson wrote: McGehee, Robert wrote: R-help, Sorry if this is more of a regex question than an R question. However, help would be appreciated on my use of the regexpr function. In the first example below, I ask for all characters (a-z) in

Re: [R] R on the iPhone/iPad? Not so much....a GPL violation

2010-06-01 Thread Marc Schwartz
Ken, See comments inline. On Jun 1, 2010, at 2:25 PM, Ken Williams wrote: Hi Marc, I want to debate a couple points from your post: 1. Distribution of GPL covered applications is not permissible via the App Store due to the Apple Terms of Service language, which infringes upon rights

Re: [R] loop

2010-06-01 Thread jim holtman
try this: x - readLines(textConnection(V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 + TP53 Dis1 Dis2 Dis3 Dis4 Dis5 Dis6 + DCI New1 New2 New3 New4 + FDI Hi2 H3 H4 + GHD I1 I3 I4 I5 I6 I7 I8))[-1] # drop the first line output - do.call(rbind, lapply(x, function(.line){ + # split the data + parms -

Re: [R] regexpr help (match.length=0)

2010-06-01 Thread Joris Meys
Dear all, It sounds as if regexp works according to the same rules as Perl, very nicely explained in: http://blob.perl.org/books/beginning-perl/3145_Chap05.pdf Yet, I couldn't help but wonder if there are also differences in behaviour. I couldn't find any yet, but there must be some. Anybody

Re: [R] how to label the som notes by the majority vote

2010-06-01 Thread Joris Meys
Dear Changbin, Please provide a self-contained, minimal example, meaning the whole code should run and create the plot as it is now, without having to load your dataset (which we don't have). Otherwise it's impossible to see what's going on and help you. Cheers Joris On Wed, Jun 2, 2010 at 2:21

Re: [R] Fancy Page layout

2010-06-01 Thread Dejian Zhao
I think you can use grid.layout() to create the appropriate layout, allocating proper space for the upper plotting area and the bottom text region, and then use viewport() with the layout parameter to control the output by pushing the viewport at the proper region on the graphical device.

Re: [R] MacOS X binary for lme4 not available on CRAN

2010-06-01 Thread Ben Madin
Armin, On Tue, 1 Jun 2010, Armin Goralczyk wrote: I have noticed that the MacOS X binary for lme4 is not available on CRAN at the moment. I am aware that it may be possible to install from source but I am not very familiar with that procedure and would rather avoid it. But I need the package

[R] Faster union of polygons?

2010-06-01 Thread Remko Duursma
Dear R-helpers, thanks for yesterday's speeding-up tip. Here is my next query: I have lots of polygons (not necessarily convex ones, and they never have holes) given by x,y coordinates. I want to get the polygon that is the union of these polygons. This is my current method, but I am hoping

[R] How to get a list of subdirectories in the wd?

2010-06-01 Thread Nevil Amos
How do I get a list of subdirectories only, not files, in a directory dir.create(test) setwd(test) dir.create(adir) dir.create(bdir) file.create(afile) dir() returns [1] adir afile bdir in need to return [1] adir bdir cheers Nevil Amos __

Re: [R] How to get a list of subdirectories in the wd?

2010-06-01 Thread Henrique Dallazuanna
Try this: dir()[file.info(dir())$isdir] On Tue, Jun 1, 2010 at 11:06 PM, Nevil Amos nevil.a...@gmail.com wrote: How do I get a list of subdirectories only, not files, in a directory dir.create(test) setwd(test) dir.create(adir) dir.create(bdir) file.create(afile) dir() returns [1]

[R] Help - C Compiler

2010-06-01 Thread Ali Makhmali
Dear Group Members, First of all thanks for all the great work and effort. I am trying to compile a part of the Project R, 'pnorm.c' in visual studio 6.0 c++ language. First i downloaded the standalone R-2.11.0 and tried to compile it. Some files were missing here such as 'Rconfig.h'. Then i

Re: [R] Reading file

2010-06-01 Thread David Winsemius
On Jun 1, 2010, at 3:19 PM, Robert Tsutakawa wrote: I am trying to read a source program into a mac pro laptop, which uses Snow Leopard. R is unable to find the file containing my source program. I'm using the function source( file name). I need some examples or detailed instructions.

Re: [R] how to label the som notes by the majority vote

2010-06-01 Thread Changbin Du
library(kohonen) data(nir) attach(nir) #SOM, the supervised learning, train the map using temperature as the class variable. set.seed(13) nir.xyf- xyf(data=spectra, Y=classvec2classmat(temperature), xweight = 0.9, grid=somgrid(4, 4, hexagonal)) temp.xyf - predict(nir.xyf)$unit.prediction #get

Re: [R] Help - C Compiler

2010-06-01 Thread Matt Shotwell
Take a look at the R Installation and Administration manual http://cran.r-project.org/doc/manuals/R-admin.pdf, under the section with header The standalone Rmath library. Matt Shotwell Graduate Student Division of Biostatistics and Epidemiology Medical University of South Carolina On Tue,

Re: [R] how to make monthly time series out of daily

2010-06-01 Thread Jeffrey Ryan
library(xts) to.monthly(x) The code is all Fortran, and is very fast. It should work just fine on most all time-series-like objects/classes, including timeSeries. Documentation in the vignette will help, as will ?to.period A wealth of functions to manipulate/test/transform time-series data

[R] code for power and suffix for x,y labels in plot( ).

2010-06-01 Thread Shant Ch
Hi I was trying to have a graph whose axes are X axis: m, Y axis: var[X ((a,b) in suffix, and (n,d) in the power)]. X ((a,b) in suffix, and (n,d) in the power)-X^(n,d) _ (a,b). Actually I require many plots involving different values of a,b,n,d, so need to keep this complicated

Re: [R] Faster union of polygons?

2010-06-01 Thread baptiste auguie
Hi, I think you could use a concave hull from the alphahull package, http://yihui.name/en/2010/04/alphahull-an-r-package-for-alpha-convex-hull/ It may be difficult to find the right parameters if the polygons differ widely in edge lengths, though. HTH, baptiste On 2 June 2010 03:53, Remko

Re: [R] mean calculation within dataframe corrupted

2010-06-01 Thread Joshua Wiley
Hello, I was hunting for something else and came across your old message, and I noticed that it had never received an answer (at least on the list). I really tried to figure out what might be going on just by looking at your code, but I could not get enough information from your email and your

Re: [R] textbox in lattice

2010-06-01 Thread Deepayan Sarkar
On Wed, Jun 2, 2010 at 12:37 AM, baptiste auguie baptiste.aug...@googlemail.com wrote: Please do read the posting guide, in particular regarding reproducible examples. You can use a Grid layout to place the lattice plot and a table in the same page. For example, library(lattice)  

<    1   2