[R] Odp: Finding pairs

2010-08-24 Thread Petr PIKAL
Hi without other details it is probably impossible to give you any reasonable advice. Do you have your data already in R? What is their form? Are they in 2 columns in data frame? How did you get them paired? So without some more information probably nobody will invest his time as it seems no t

Re: [R] Plot bar lines like excel

2010-08-24 Thread abotaha
Thanks a lot for the nice explanation. however, you mention that it will be nicer if there is data. yes you are right it be very kind of you if you include a simple example. where my data are: x1<-c(11.5,9.38,9.3,9.8,9,9.06,9.42,8.8,9.05,8.14,8.2,7.59,6.92,6.47,7.12, 7.47,6.81,8.41,9.64,9.62,9.2,

[R] modify a nomogram

2010-08-24 Thread david dav
Hi, I would like to emphasize ("zoom") the zone of a nomogram where the probability are > 0.01 (nomogram built with nomogram, Design). As a consequence, I don't need to draw the part of the "Total points" axis with score < 60 equivalent in my case to a linear predictor < 4.5 - As far as I know, th

[R] Removing inter-bar spaces in barchart

2010-08-24 Thread Jonathan Greenberg
Rhelpers: I'm trying to make a barchart of a 2-group dataset (barchart(x~y,data=data,groups=z,horizontal=FALSE)). My problem is that I can't, for the life of me, seem to get rid of the inter-bar space -- box.ratio set to 1 doesn't do much. Any ideas? I'd ideally want zero space between the

[R] Documenting S4 Methods

2010-08-24 Thread Dario Strbenac
I'm in the process of converting some S3 methods to S4 methods. I have this function : setGeneric("enrichmentCalc", function(rs, organism, seqLen, ...){standardGeneric("enrichmentCalc")}) setMethod("enrichmentCalc", c("GenomeDataList", "BSgenome"), function(rs, organism, seqLen, ...) {

Re: [R] How to remove all objects except a few specified objects?

2010-08-24 Thread Cheng Peng
Thanks Josh and Karl. function dnrm() works well for my purpose. -- View this message in context: http://r.789695.n4.nabble.com/How-to-remove-all-objects-except-a-few-specified-objects-tp2335651p2337398.html Sent from the R help mailing list archive at Nabble.com. _

[R] how do R calculates the number of intervals between tick-marks

2010-08-24 Thread Antonio Olinto
Hello, I want to know how do R calculates the number of intervals between tick-marks in the y axis in a plot. I'm making a three y-axes plot and this information would help me a lot. Thanks in advance. Antonio Olinto Webmai

Re: [R] How to remove rows based on frequency of factor and then difference date scores

2010-08-24 Thread Chris Beeley
Many thanks to you both. I have now filed away for future reference the 2 factor tapply as well as the extremely useful looking plyr library. And the code worked beautifully :-) On 24 Aug 2010, at 19:47, "Abhijit Dasgupta, PhD" wrote: > The paste-y argument is my usual trick in these situat

Re: [R] degree C symbol in a function

2010-08-24 Thread Daisy Englert Duursma
Thanks for the advice, problem solved. -daisy On Wed, Aug 25, 2010 at 1:35 PM, David Winsemius wrote: > > On Aug 24, 2010, at 10:45 PM, Daisy Englert Duursma wrote: > >> Hello help, >> >> I have changed around some graphing code and made it into a function. >> Previously they y label of the axi

Re: [R] Rotate x-axis label on log scale

2010-08-24 Thread David Winsemius
On Aug 24, 2010, at 11:37 PM, Tim Elwell-Sutton wrote: Hi Jim Thanks for this. The staxlab function seems very useful. Unfortunately, the rotation option doesn't seem to work for me when the y-axis is on a log scale. What part of: "If srt is not NA, the labels will be rotated srt degree

Re: [R] Rotate x-axis label on log scale

2010-08-24 Thread Tim Elwell-Sutton
Hi Jim Thanks for this. The staxlab function seems very useful. Unfortunately, the rotation option doesn't seem to work for me when the y-axis is on a log scale. It will stagger the labels but not rotate them. There's no error message. On a linear axis the rotation works nicely. Any ideas? The exam

Re: [R] degree C symbol in a function

2010-08-24 Thread David Winsemius
On Aug 24, 2010, at 10:45 PM, Daisy Englert Duursma wrote: Hello help, I have changed around some graphing code and made it into a function. Previously they y label of the axis was inserted as text in its own layout box. text(1,1, expression(~degree~C),cex=1) This worked great and resulted i

Re: [R] Parsing a XML file

2010-08-24 Thread Duncan Temple Lang
xmlDoc() is not the function to use to parse a file. Use doc = xmlParse("Malaria_Grave.xml") xmlDoc() is for programmatically creating a new XML within R. It could be more robust to being called with a string, but the key thing here is that it is not the appropriate function for what you wa

Re: [R] degree C symbol in a function

2010-08-24 Thread Gabor Grothendieck
On Tue, Aug 24, 2010 at 10:45 PM, Daisy Englert Duursma wrote: > Hello help, > > I have changed around some graphing code and made it into a function. > Previously they y label of the axis was inserted as text in its own > layout box. > > text(1,1, expression(~degree~C),cex=1) > > This worked grea

Re: [R] degree C symbol in a function

2010-08-24 Thread Jorge Ivan Velez
Hi Daisy, Try it without paste(): > plot(1, col = 'white') > text(1,1, b_unit,cex=1) HTH, Jorge On Tue, Aug 24, 2010 at 10:45 PM, Daisy Englert Duursma <> wrote: > Hello help, > > I have changed around some graphing code and made it into a function. > Previously they y label of the axis was i

[R] degree C symbol in a function

2010-08-24 Thread Daisy Englert Duursma
Hello help, I have changed around some graphing code and made it into a function. Previously they y label of the axis was inserted as text in its own layout box. text(1,1, expression(~degree~C),cex=1) This worked great and resulted in the symbol for degree. In the function, I have changed it so

[R] degree C

2010-08-24 Thread Daisy Englert Duursma
-- Daisy Englert Duursma Room E8C156 Dept. Biological Sciences Macquarie University  NSW  2109 Australia Tel +61 2 9850 9256 10A Carrington Rd Hornsby, NSW 2077 Mobile: 0421858456 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/l

Re: [R] How to remove all objects except a few specified objects?

2010-08-24 Thread Peter Alspach
Tena korua ls()[!(ls() %in% c('keepThis','andThis'))] will give the elements excluding 'keepThis' and 'andThis'. Thus rm(list= ls()[!(ls() %in% c('keepThis','andThis'))]) will remove everything except these two objects, and hidden objects. It you want to remove the hidden objects as be use ls

Re: [R] find most repeated item from column in dataframe

2010-08-24 Thread Marc Schwartz
How about this approach, using aggregate(): > DF StandID PlotNum HerbNum Woody 1 001 1 1low 2 001 2 2 medium 3 001 3 1low 4 001 4 3low 5 001 5 1 high 6 001 6 2 medium 7 002

Re: [R] find most repeated item from column in dataframe

2010-08-24 Thread Peter Alspach
Tena koe Randy If your dataframe is called randy, then the following seems to work: aggregate(randy[,-(1:2)], list(randy[,1]), function(x) {tt <- table(x); names(tt)[which.max(tt)]}) HTH Peter Alspach > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun.

Re: [R] find most repeated item from column in dataframe

2010-08-24 Thread Bill.Venables
Do you expect this to be easy? It may be, but I can't see a particularly graceful way to do it. Here is one possible solution. > dat StandID PlotNum HerbNum Woody 1 001 1 1low 2 001 2 2 medium 3 001 3 1low 4 001 4 3

Re: [R] break the long R code lines automatically

2010-08-24 Thread heyi xiao
Thanks a lot, Charles and Yihui, Your ideas are great! Both worked, although Yihui's solutions are a lot more comprehensive. BTW as a comment on Charles idea, parse function works for loosen statement lines, for not for the code blocks of a function. For example, the following code for vennC

[R] find most repeated item from column in dataframe

2010-08-24 Thread Randy Cass
R users, I am trying to find some way to find the value of a column that is repeated the most for each StandID of a dataframe. I have research methods online and the help page, but have had no success in finding a solution. I have tried using the table function but it returns items for the whole

Re: [R] How to remove all objects except a few specified objects?

2010-08-24 Thread Dejian Zhao
If your specified objects have a certain pattern, you can use the parameter "pattern" in ls() to remove or keep it. rm(list=ls(..., pattern="your_pattern")) If not, possibly you have to manually specify them. On 2010-8-24 3:00, Cheng Peng wrote: How to remove all R objects in the RAM except for

Re: [R] Comparing/diffing strings

2010-08-24 Thread Hadley Wickham
On Tue, Aug 24, 2010 at 11:25 AM, Martin Morgan wrote: > On 08/24/2010 07:27 AM, Doran, Harold wrote: >> There is the stringMatch function in the MiscPsycho package. >> >>> stringMatch('Hadley', 'Hadley Wickham', normalize = 'no') >> [1] 8 >>> stringMatch('Hadley', 'Hadley Wickham', normalize = 'y

Re: [R] how to plot y-axis on the right of x-axis

2010-08-24 Thread David Winsemius
On Aug 24, 2010, at 7:12 PM, elaine kuo wrote: Dear List, I have a richness data distributing across 20 N to 20 S latitude. (120 E-140 E longitude). I would like to draw the richness in the north hemisphere and a regression line in the plot (x-axis: latitude, y-axis: richness in the no

Re: [R] break the long R code lines automatically

2010-08-24 Thread Yihui Xie
Actually I've implemented Charles' idea in the function tidy.source() in package 'animation' years ago. An example can be found here: http://animation.yihui.name/animation:misc#tidy_up_r_source BTW, you might be interested in the 'formatR' package if you are somehow addicted to GUI: http://yihui.n

[R] how to plot y-axis on the right of x-axis

2010-08-24 Thread elaine kuo
Dear List, I have a richness data distributing across 20 N to 20 S latitude. (120 E-140 E longitude). I would like to draw the richness in the north hemisphere and a regression line in the plot (x-axis: latitude, y-axis: richness in the north hemisphere). The above demand is done using plot. Th

Re: [R] Constrained non-linear optimisation

2010-08-24 Thread Ravi Varadhan
David, I am not sure I completely understand your problem. However, you can take a look at a couple of packages in R that can handle (smooth) nonlinear optimization with general (smooth) constraints: library(alabama) ?constrOptim.nl and library(Rsolnp) ?solnp Best, Ravi. __

Re: [R] Parsing a XML file

2010-08-24 Thread Orvalho Augusto
My system is an Ubuntu 9.10 32bit: #uname -a Linux cavemanpc 2.6.31-22-generic #63-Ubuntu SMP Wed Aug 18 22:54:26 UTC 2010 i686 GNU/Linux # free -m total used free sharedbuffers cached Mem: 3000 1847 1152 0120961 -/

Re: [R] Parsing a XML file

2010-08-24 Thread Orvalho Augusto
It seems to be a bug on the XML package. This is what I run (and it is not the only file): > library("XML") > doc <- xmlDoc("Malaria_Grave.xml") *** caught segfault *** address 0x9, cause 'memory not mapped' Traceback: 1: .Call("RS_XML_createDocFromNode", node, PACKAGE = "XML") 2: xmlDoc("Mal

[R] Customized Sweavel Style File

2010-08-24 Thread r.ookie
Liviu, thanks again for the suggestion. Do you have a customized style file that you wouldn't mind sharing? I like the default output but I'm curious about others. Thanks! __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-hel

Re: [R] Index list by other list (w/ logical elements)?

2010-08-24 Thread Phil Spector
Marianne - The function you're looking for is mapply: mapply(function(one,two)one[two],x,y) [[1]] [1] "one" [[2]] [1] "four" "five" - Phil Spector Statistical Computing Facility

Re: [R] Parsing a XML file

2010-08-24 Thread Gavin Simpson
On Tue, 2010-08-24 at 23:35 +0200, Orvalho Augusto wrote: > I have one XML file with 30MB that I need to read the data. > > I try this; > library(XML) > doc <- xmlDoc("Malaria_Grave.xml") > > And R answers like this > *** caught segfault *** > address 0x5, cause 'memory not mapped' This is most

Re: [R] Sweave.sty

2010-08-24 Thread r.ookie
That is great Liviu, thanks for letting me know. My LaTeX documents have been looking like this, however I have been doing all the cosmetics through LaTeX. Thanks for letting me know about this! On Aug 24, 2010, at 2:34 PM, Liviu Andronic wrote: On Tue, Aug 24, 2010 at 10:40 PM, r.ookie wrote:

Re: [R] Fwd: [R-sig-hpc] Holtman's levelplot ?

2010-08-24 Thread David Winsemius
On Aug 24, 2010, at 5:15 PM, Michel Lutz wrote: > Thank you David for your answer. > > To be honest, I didn't read those posting guide, because I don't > know where to find it - I just get this email from N. Gunther. > So here the txt file, and sorry for having sent a wrong format. > > I checke

[R] Index list by other list (w/ logical elements)?

2010-08-24 Thread Marianne Promberger
I have two lists of the same shape, like this: x <- list() x[[1]] <- c("one","two") x[[2]] <- c("three","four","five") y <- list() y[[1]] <- c(TRUE,FALSE) y[[2]] <- c(FALSE,TRUE,TRUE) I would like to index x "by" y, that is, the result in this case should be: z [[1]] [1] "one" [[2]] [1] "four

[R] Parsing a XML file

2010-08-24 Thread Orvalho Augusto
I have one XML file with 30MB that I need to read the data. I try this; library(XML) doc <- xmlDoc("Malaria_Grave.xml") And R answers like this *** caught segfault *** address 0x5, cause 'memory not mapped' Traceback: 1: .Call("RS_XML_createDocFromNode", node, PACKAGE = "XML") 2: xmlDoc("Mala

Re: [R] Sweave.sty

2010-08-24 Thread Liviu Andronic
On Tue, Aug 24, 2010 at 10:40 PM, r.ookie wrote: > Does anyone know where I can download the latest version of Sweave.sty? I > have looked all over the site http://www.stat.umn.edu/~charlie/Sweave/ with > no luck. > Not exactly an answer, Frank Harrell once published a fork of Sweave, Sweavel [1

Re: [R] Plot bar lines like excel

2010-08-24 Thread Dennis Murphy
Hi: This is pretty straightforward to do in ggplot2, but it would be nice to have some data to work with (hint). The job requires processing the two input series and dates with melt() from the reshape package, a couple of opts() to change, proper rotation of the dates, etc. It's easier to show how

Re: [R] Trouble configuring R to use ACML

2010-08-24 Thread Prof Brian Ripley
This is easier if you simply link to the ACML BLAS as an alternative to Rblas.so -- see the R-admin manual. If you need further help, please ask on the R-devel list (see the posting guide). It seems likely that you missed the comment in the R-admin manual about ensuring that the ACML lib dire

Re: [R] break the long R code lines automatically

2010-08-24 Thread Charles C. Berry
On Tue, 24 Aug 2010, heyi xiao wrote: Dear all, I have written some R source program with many thousands of lines. I didn???t insert line breaks automatically or manually for the long lines. But now I would like to edit the source code in Emacs/ESS to make it more formal as a package. One o

Re: [R] Compiling Fortran for R : .so: mach-o, but wrong architecture

2010-08-24 Thread Prof Brian Ripley
R-sig-mac is the right list for Mac-specific questions. But Command-line R on Snow Leopard is 64-bit R.app is 32-bit. So either use R32 CMD INSTALL or use R64.app. (And as 'R' is 32-bit on Leopard, it is rather easy to get confused.) On Tue, 24 Aug 2010, Marie-Hélène Ouellette wrote: Dear

Re: [R] lme4 + R 2.11.0 + mac unavailable

2010-08-24 Thread Prof Brian Ripley
On Tue, 24 Aug 2010, Daniel Malter wrote: Hi, has there been a solution to this issue? I am encountering the same Yes, please look in the R-sig-mac archives (the place to ask Mac-specific questsions!). My notes say July 28, https://stat.ethz.ch/pipermail/r-sig-mac/2010-July/007601.html

Re: [R] drop unused levels in lattice dotplot axis?

2010-08-24 Thread Stephen T.
Hi Dennis, thanks! No, this looks good to me, with equal-sized panels. I didn't realize there was such a similar post before - all my queries had retrieved questions about dropping categories in panels... but this is great - thank you.All the best!Stephen Date: Tue, 24 Aug 2010 12:58:20 -0700

Re: [R] Fwd: [R-sig-hpc] Holtman's levelplot ?

2010-08-24 Thread David Winsemius
On Aug 24, 2010, at 2:56 PM, Michel Lutz wrote: Hello, As recommended by N. Gunther, I'm writing you because I have some difficulties to create a script to track computer performance, as done in Holtman, 2005 (Visualization techniques for analysing patterns in system performance). I woul

Re: [R] Constrained non-linear optimisation

2010-08-24 Thread Dennis Murphy
Hi: A reasonable place to start would be the Optimization task view at CRAN: http://cran.r-project.org/web/views/ HTH, Dennis On Tue, Aug 24, 2010 at 10:47 AM, David Beacham wrote: > I'm relatively new to R, but I'm attempting to do a non-linear maximum > likelihood estimation (mle) in R, with

Re: [R] Time and space considerations in using predict.glm.

2010-08-24 Thread David Winsemius
On Aug 24, 2010, at 3:16 PM, Daniel Yarlett wrote: Hello, I am using R to train a logistic regression model and save the resulting model to disk. I am then subsequently reloading these saved objects, and using predict.glm on them in order to make predictions about single- row data frames

Re: [R] change order of plot panels in faceted ggplot/qplot

2010-08-24 Thread Hadley Wickham
On Mon, Aug 23, 2010 at 1:02 PM, Alison Macalady wrote: > Hi, > > I have a 5-paneled figure that i made using the facet function in qplot > (ggplot).  I've managed to arrange the panels into two rows/three columns, > but for the sake of easy visual comparisons between panels in my particular > dat

[R] Trouble configuring R to use ACML

2010-08-24 Thread szembek
I am trying to get R to use the ACML BLAS, specifically the 'mp' version for multithreading. I have installed acml-4-4-0-gfortran-64bit I added /opt/acml4.4.0/gfortran64_mp/lib to $LD_LIBRARY_PATH. I ran: sudo ./configure --with-blas="-L/opt/acml4.4.0/gfortran64_mp/lib -lacml_mp" At the end

[R] help with summary.lm aliased

2010-08-24 Thread Yasir
Dear R users, I'm building linear models that use poly and has a lot of product terms. My model summaries look messy. I know that the summary could use aliases for the variable names, but I don't know how to get it to do that. Please help Thanks, -- View this message in context: http://r.789695.

[R] Fwd: [R-sig-hpc] Holtman's levelplot ?

2010-08-24 Thread Michel Lutz
Hello, As recommended by N. Gunther, I'm writing you because I have some difficulties to create a script to track computer performance, as done in Holtman, 2005 (Visualization techniques for analysing patterns in system performance). I would like to do a leveplot, with the kind of file here enclo

[R] Time and space considerations in using predict.glm.

2010-08-24 Thread Daniel Yarlett
Hello, I am using R to train a logistic regression model and save the resulting model to disk. I am then subsequently reloading these saved objects, and using predict.glm on them in order to make predictions about single-row data frames that are generated in real-time from requests arriving at an

[R] break the long R code lines automatically

2010-08-24 Thread heyi xiao
Dear all, I have written some R source program with many thousands of lines. I didn’t insert line breaks automatically or manually for the long lines. But now I would like to edit the source code in Emacs/ESS to make it more formal as a package. One of the major problems here is how to break

Re: [R] Sweave.sty

2010-08-24 Thread Gavin Simpson
On Tue, 2010-08-24 at 12:40 -0700, r.ookie wrote: > Does anyone know where I can download the latest version of > Sweave.sty? I have looked all over the site > http://www.stat.umn.edu/~charlie/Sweave/ with no luck. It is provided in the R sources as Sweave is an integrated part of R. You can get i

Re: [R] drop unused levels in lattice dotplot axis?

2010-08-24 Thread Dennis Murphy
Hi: This looks to be a step in the right direction, but the resulting panels are all the same size. Perhaps you can build on it... # Solution based on an R-help post by Deepayan Sarkar: # http://tolstoy.newcastle.edu.au/R/e2/help/06/09/1579.html dotplot(A ~ B | C, data=dfr, scales=list(y=list(re

Re: [R] Sweave.sty

2010-08-24 Thread Peter Dalgaard
On 08/24/2010 09:40 PM, r.ookie wrote: > Does anyone know where I can download the latest version of > Sweave.sty? I have looked all over the site > http://www.stat.umn.edu/~charlie/Sweave/ with no luck. I don't think there is anything newer than what is inside the latest version of R. Look under

Re: [R] Sweave.sty

2010-08-24 Thread Matt Shotwell
Here is one: http://svn.r-project.org/R/trunk/share/texmf/tex/latex/Sweave.sty -Matt On Tue, 2010-08-24 at 15:40 -0400, r.ookie wrote: > Does anyone know where I can download the latest version of Sweave.sty? I > have looked all over the site http://www.stat.umn.edu/~charlie/Sweave/ with > no

[R] Sweave.sty

2010-08-24 Thread r.ookie
Does anyone know where I can download the latest version of Sweave.sty? I have looked all over the site http://www.stat.umn.edu/~charlie/Sweave/ with no luck. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do rea

Re: [R] Compiling Fortran for R : .so: mach-o, but wrong architecture

2010-08-24 Thread Peter Dalgaard
On 08/24/2010 09:01 PM, Marie-Hélène Ouellette wrote: > Dear all, > > I'm trying to compile FORTRAN code to be used in R, failing miserably. I got > a simple code function to try to figure out what is going wrong. Here is the > code (available on the web) : > > > > subroutine bar(n, x) >

Re: [R] How to obtain seed after generating random number?

2010-08-24 Thread William Dunlap
> -Original Message- > From: r.ookie [mailto:r.oo...@live.com] > Sent: Tuesday, August 24, 2010 12:25 PM > To: William Dunlap > Cc: r-help@r-project.org > Subject: Re: [R] How to obtain seed after generating random number? > > Thanks for your solution, however, which values would I then

[R] Time and space considerations in using predict.glm()

2010-08-24 Thread Daniel Yarlett
Hello, I am using R to train a logistic regression model and save the resulting model to disk. I am then subsequently reloading these saved objects, and using predict.glm on them in order to make predictions about single-row data frames that are generated in real-time from requests arriving at an

Re: [R] Applying t-test to matrix without using a loop

2010-08-24 Thread Joshua Wiley
You can certainly use apply() #make up some data x <- 10; y <- 10; g <- 5 set.seed(1969) dat <- matrix(rnorm((x + y) * g), ncol = x + y) # apply() the t.test function to each row fo the matrix and extract just the p value results <- apply(dat, 1, function(dat) { t.test(x = dat[1:x], y = d

Re: [R] How to obtain seed after generating random number?

2010-08-24 Thread r.ookie
Thanks for your solution, however, which values would I then provide someone else so that they can produce the same results? On Aug 24, 2010, at 12:06 PM, William Dunlap wrote: The following will attach (as an attribute) the current global value of .Random.seed to the value of the evaluated 'exp

Re: [R] lme4 + R 2.11.0 + mac unavailable

2010-08-24 Thread David Winsemius
On Aug 24, 2010, at 3:13 PM, Daniel Malter wrote: Hi, has there been a solution to this issue? I am encountering the same problem on a Mac with OSX 10.6.4. The problem persists when I try to install lme4 from the source (see below), and my R version is up to date according to R's update

Re: [R] Plot bar lines like excel

2010-08-24 Thread David Winsemius
On Aug 24, 2010, at 1:40 PM, abotaha wrote: Hello guys, I would to plot a bar line between to curves like in excel as shown in the following image. but i do not know how I can do that in R. http://r.789695.n4.nabble.com/file/n2337089/excel_Plot.png any help would appreciate. ?segments

Re: [R] lme4 + R 2.11.0 + mac unavailable

2010-08-24 Thread Daniel Malter
Hi, has there been a solution to this issue? I am encountering the same problem on a Mac with OSX 10.6.4. The problem persists when I try to install lme4 from the source (see below), and my R version is up to date according to R's update check. Thanks for any help, Daniel -- session

[R] Applying t-test to matrix without using a loop

2010-08-24 Thread Cedric Laczny
Hi, the actual thread on "multiple assignments ?" made up an interesting point for me. If I have a matrix with g rows and x + y columns where columns 1 - x contain values of group1 and columns x+1 to y contain the values of group2. Now I want to compute a vector of length g that holds the p-valu

Re: [R] How to obtain seed after generating random number?

2010-08-24 Thread William Dunlap
The following will attach (as an attribute) the current global value of .Random.seed to the value of the evaluated 'expr' argument. If you supply the initial.Random.seed argument then it will use that when evaluating the expression (and also attach it to the result) so you can repeat the 'unusual'

[R] Compiling Fortran for R : .so: mach-o, but wrong architecture

2010-08-24 Thread Marie-Hélène Ouellette
Dear all, I'm trying to compile FORTRAN code to be used in R, failing miserably. I got a simple code function to try to figure out what is going wrong. Here is the code (available on the web) : subroutine bar(n, x) integer n double precision x(n) integer i do

Re: [R] How to obtain seed after generating random number?

2010-08-24 Thread Ben Bolker
> On Aug 24, 2010, at 10:11 AM, Bogaso Christofer wrote: > > Dear all, I was doing an experiment to disprove some theory therefore > performing lot of random simulation. Goal is to show the audience that > although something has very rare chance to occur but it doesn't mean that > event would be

[R] Plot bar lines like excel

2010-08-24 Thread abotaha
Hello guys, I would to plot a bar line between to curves like in excel as shown in the following image. but i do not know how I can do that in R. http://r.789695.n4.nabble.com/file/n2337089/excel_Plot.png any help would appreciate. -- View this message in context: http://r.789695.n4.nabble

[R] Finding pairs

2010-08-24 Thread Mike Rhodes
Dear R Helpers, I am a newbie and recently got introduced to R. I have a large database containing the names of bank branch offices along-with other details. I am into Operational Risk as envisaged by BASEL II Accord.  I am trying to express my problem and I am using only an indicative da

Re: [R] How to obtain seed after generating random number?

2010-08-24 Thread r.ookie
I have wondered this in the past too so thanks for the question. On Aug 24, 2010, at 10:11 AM, Bogaso Christofer wrote: Dear all, I was doing an experiment to disprove some theory therefore performing lot of random simulation. Goal is to show the audience that although something has very rare cha

Re: [R] How to remove rows based on frequency of factor and then difference date scores

2010-08-24 Thread Abhijit Dasgupta, PhD
The paste-y argument is my usual trick in these situations. I forget that tapply can take multiple ordering arguments :) Abhijit On 08/24/2010 02:17 PM, David Winsemius wrote: On Aug 24, 2010, at 1:59 PM, Abhijit Dasgupta, PhD wrote: The only problem with this is that Chris's unique individu

[R] lattice: plot alignment fails

2010-08-24 Thread Marius Hofert
Dear expeRts, I would like to have four plots appearing in one figure. The minimal example shows this. However, the four figures are not properly aligned. Why? If I comment out the scales=... arguments, then it works, but I would like to use this... :-) Cheers, Marius library(lattice) set.

Re: [R] How to remove rows based on frequency of factor and then difference date scores

2010-08-24 Thread David Winsemius
On Aug 24, 2010, at 1:59 PM, Abhijit Dasgupta, PhD wrote: The only problem with this is that Chris's unique individuals are a combination of Type and ID, as I understand it. So Type=A, ID=1 is a different individual from Type=B,ID=1. So we need to create a unique identifier per person, sim

Re: [R] How to remove rows based on frequency of factor and then difference date scores

2010-08-24 Thread Abhijit Dasgupta, PhD
The only problem with this is that Chris's unique individuals are a combination of Type and ID, as I understand it. So Type=A, ID=1 is a different individual from Type=B,ID=1. So we need to create a unique identifier per person, simplistically by uniqueID=paste(Type, ID, sep=''). Then, using th

Re: [R] How to remove rows based on frequency of factor and then difference date scores

2010-08-24 Thread Abhijit Dasgupta, PhD
An answer to 1) > x = data.frame(Type=c('A','A','B','B'), ID=c(1,1,3,1), Date = c('16/09/2010','23/09/2010','18/8/2010','13/5/2010'), Value=c(8,9,7,6)) > x Type ID Date Value 1A 1 16/09/2010 8 2A 1 23/09/2010 9 3B 3 18/8/2010 7 4B 1 13/5/2010 6 > x$

Re: [R] How to remove rows based on frequency of factor and then difference date scores

2010-08-24 Thread David Winsemius
On Aug 24, 2010, at 1:19 PM, Chris Beeley wrote: Hello- A basic question which has nonetheless floored me entirely. I have a dataset which looks like this: Type ID DateValue A 116/09/2020 8 A 1 23/09/2010 9 B 3 18/8/20107 B

Re: [R] odd behavior of "summary" function

2010-08-24 Thread Peter Ehlers
On 2010-08-24 11:06, Mike Williamson wrote: Hello All, Using the standard "summary" function in 'R', I ran across some odd behavior that I cannot understand. Easy to reproduce: Typing: summary(c(6,207936)) Yields:: Min. *1st Qu. MedianMean 3rd Qu.Max.* 6 *5199

[R] Constrained non-linear optimisation

2010-08-24 Thread David Beacham
I'm relatively new to R, but I'm attempting to do a non-linear maximum likelihood estimation (mle) in R, with the added problem that I have a non-linear constraint. The basic problem is linear in the parameters (a_i) and has only one non-linear component, b, with the problem being linear when

Re: [R] odd behavior of "summary" function

2010-08-24 Thread Erik Iverson
summary.default uses the signif function to round for display purposes. In ?summary, we can see the digits argument is used to control the value passed to signif. > lapply(1:6, function(x) summary(c(6, 207936), digits = x)) [[1]] Min. 1st Qu. MedianMean 3rd Qu.Max. 6e+00 5e+04

Re: [R] Strange space characters in character strings

2010-08-24 Thread Mark Breman
Hello J.R.M. Hosking, charToRaw() works perfectly, thank you: > charToRaw(as.character(moose[1, "V3"])) [1] 24 38 38 30 2c 33 37 30 c2 a0 gsub("[[:space:]]", "", ...) did not remove them, but now I know what they are (hex: c2 a0) I can remove them with gsub() by: > gsub("[$,\xc2\xa0]", "", as.

[R] Using kfilter in package sspir - dimensions do not agree

2010-08-24 Thread John Dryden
I'm currently running into a little trouble with the kfilter method, and would love some clarification if you are able to offer it. When trying to run kfilter, I've been running into errors that seem to result from having mismatched dimensions. Specifically, the dimension of my observations is 2,

[R] How to remove rows based on frequency of factor and then difference date scores

2010-08-24 Thread Chris Beeley
Hello- A basic question which has nonetheless floored me entirely. I have a dataset which looks like this: Type ID DateValue A 116/09/2020 8 A 1 23/09/2010 9 B 3 18/8/20107 B 1 13/5/20106 There are two Types, whi

Re: [R] multiple assignments ?

2010-08-24 Thread Bert Gunter
On Tue, Aug 24, 2010 at 8:45 AM, Maas James Dr (MED) wrote: > Thanks Bert, will have a look.  I'm originally a Fortran programmer so tend > to think in loops ... so yes expect it may be job for loops, just tried to > avoid it because several references say not to use loops in R. -- Yes, an un

Re: [R] odd behavior of "summary" function

2010-08-24 Thread David Winsemius
On Aug 24, 2010, at 1:06 PM, Mike Williamson wrote: Hello All, Using the standard "summary" function in 'R', I ran across some odd behavior that I cannot understand. Easy to reproduce: Typing: summary(c(6,207936)) Yields:: Min. *1st Qu. MedianMean 3rd Qu.Max.* 6 *51

Re: [R] generate random numbers from a multivariate distribution with specified correlation matrix

2010-08-24 Thread rusers.sh
BTW, can you recommend a book on statistical simulations? I want to know more on how to generate random numbers from distributions, how to generate the theoretical models,... Thanks a lot. 2010/8/24 Michael Dewey > At 02:40 24/08/2010, rusers.sh wrote: > >> Hi all, >> rmvnorm()can be used to ge

Re: [R] xylab formatting

2010-08-24 Thread David Winsemius
On Aug 24, 2010, at 12:39 PM, Jennifer Hains wrote: Dear r-help, I'm having trouble formatting xy labels for plot in r. I want to make the following y-label "benzene (mug-3)" where mu is greek and -3 is superscript and benzene is held in an array. I tried this, myname = c("benzene", "etc

Re: [R] graphing plots of plots

2010-08-24 Thread Greg Snow
In addition to the other suggestions you may also want to look at the subplot function in the TeachingDemos package (the version in Hmisc is a copy of a prior version of this one) as well as the my.symbols or panel.my.symbols functions in the same package. -- Gregory (Greg) L. Snow Ph.D. Stati

[R] SAMR for paired samples

2010-08-24 Thread Haesook Kim
Hi R-help, I am trying to use 'samr' for 10 pre and post paired samples to test whether post is different from pre (i.e., the location shift for the delta of (post-pre)). However, I got an error message saying > samr.obj<-samr(d, resp.type="Two class paired", nperms=100, random.seed=100) pe

[R] odd behavior of "summary" function

2010-08-24 Thread Mike Williamson
Hello All, Using the standard "summary" function in 'R', I ran across some odd behavior that I cannot understand. Easy to reproduce: Typing: summary(c(6,207936)) Yields:: Min. *1st Qu. MedianMean 3rd Qu.Max.* 6 *51990 104000 104000 156000 207900* None of t

Re: [R] generate random numbers from a multivariate distribution with specified correlation matrix

2010-08-24 Thread rusers.sh
Great. It is more clearer for me. Thanks all. 2010/8/24 Michael Dewey > At 02:40 24/08/2010, rusers.sh wrote: > >> Hi all, >> rmvnorm()can be used to generate the random numbers from a multivariate >> normal distribution with specified means and covariance matrix, but i want >> to specify the c

[R] How to obtain seed after generating random number?

2010-08-24 Thread Bogaso Christofer
Dear all, I was doing an experiment to disprove some theory therefore performing lot of random simulation. Goal is to show the audience that although something has very rare chance to occur but it doesn't mean that event would be impossible. In this case after getting that rare event I need to

[R] xylab formatting

2010-08-24 Thread Jennifer Hains
Dear r-help, I'm having trouble formatting xy labels for plot in r. I want to make the following y-label "benzene (mug-3)" where mu is greek and -3 is superscript and benzene is held in an array. I tried this, myname = c("benzene", "etc") plot (c(0:10), ylab = bquote(.(myname[1])~~(mu~g ~m^-3)))

Re: [R] Comparing/diffing strings

2010-08-24 Thread Martin Morgan
On 08/24/2010 07:27 AM, Doran, Harold wrote: > There is the stringMatch function in the MiscPsycho package. > >> stringMatch('Hadley', 'Hadley Wickham', normalize = 'no') > [1] 8 >> stringMatch('Hadley', 'Hadley Wickham', normalize = 'yes') > [1] 0.4285714 > > It uses Levenshtein distance to tel

[R] Minus values in Tps

2010-08-24 Thread sam.e
Hello there, I am using the Tps function to fit a spline to my data which is measurements of a sedimentary layer on an xy plane to see how the thickness of the layer changes. I was wondering if it was possible to change the Tps code so that no minus values are calculated by the spline as these a

Re: [R] multiple assignments ?

2010-08-24 Thread Bert Gunter
None of this would work if the list is long. Isn't this an obvious task for a loop, explicit or implicit? e.g. for(i in 1:100)assign(paste("vec",i,sep=""), vector("integer",5)) or probably better because it creates a list structure: ## warning, untested. You may have to fool with the syntax a b

Re: [R] How to remove all objects except a few specified objects?

2010-08-24 Thread Karl Brand
Hi Cheng, Check out the keep() function in package:gdata. And to be sure the "removed" objects are really removed from system memory i think you need to run gc(). hth, Karl On 8/23/2010 9:00 PM, Cheng Peng wrote: How to remove all R objects in the RAM except for a few specified ones? rm(l

  1   2   >