[R] How to handle "~" character after csv importation

2008-08-22 Thread Sébastien
Dear R users, I have to import some csv files in which column headers contain the character "~". Following the following import call, the character seems to be replaced by dots in the column names of my data frame. Plus, I cannot query names(mydata) to find the column index which header should

[R] Parenthesis recognition with grep

2008-08-31 Thread Sébastien
Dear R-users, I need to dynamically recognize the index of a given string myStr in a vector of string. The problem is that myStr might contain parenthesis, causing grep not to recognize it the way I want (see below). The help mentions that the pattern used by grep should be in the POSIX format

Re: [R] Parenthesis recognition with grep

2008-08-31 Thread Sébastien
Hi Jorge, This is doing the work just fine. Thank you ! However, I would like to know what should be done with the grep call... just for my personal education :) Sebastien Jorge Ivan Velez a écrit : > > Dear Sébastien, > > Is this what you want? > > which(myStr==headers)

[R] = or <-

2008-06-02 Thread Sébastien
Dear R-users, I have written a short VB application to clean and format my R code. Everything works fine except one small issue that I did not expected; it is related the automatic replacement of assignment signs from "=" to "<-". Most functions or arguments seem to accept either = or <-, but

Re: [R] = or <-

2008-06-02 Thread Sébastien
ien Erik Iverson a écrit : Sébastien wrote: Dear R-users, I have written a short VB application to clean and format my R code. Everything works fine except one small issue that I did not expected; it is related the automatic replacement of assignment signs from "=" to "<

[R] Optimisation of xyplot style

2008-06-27 Thread Sébastien
Dear R-users, The following provides a basis to illustrate some questions I have about xyplot() customization. x <- rep(1:2, times = 6) y <- numeric() for (i in 1:3) { y <- c(y, 1:4*10^(i-1)) } g <- rep(1:6, each = 2) ax <- rep(1:3, each = 4) tmp <- data.frame(x,y,g) xyplot(y ~ x | g, a

[R] Fixing the physical size of Trellis graphs panels

2008-04-10 Thread Sébastien
Dear R-users, Please consider the following script: # library(lattice) ID <- rep(1:8,each=2) x <- rep (c(1,2),8) y <- c(rep(c(0.5,2),4),rep(c(50,1000),4)) df<-data.frame(ID,x,y) g <- rep(1:2,each=8) df.split<-split(df,g) df.split pdf(file="C:/Test.pdf") for (i in 1:2) { mydf<-as.data.fram

[R] Citation in the literature

2008-05-07 Thread Sébastien
Hello everyone, Very quick question: How should I cite the use of R in a publication ? Thanks in advance. Sebastien __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-projec

Re: [R] Limiting size of pairs plots

2008-05-12 Thread Sébastien
gp = gpar(col = rainbow(n=my.Group.number)[j],fill = rainbow(n=my.Group.number)[j]), draw=TRUE) } END Prof Brian Ripley a écrit : On Tue, 28 Aug 2007, Sébastien wrote: Thanks you very much. I did not thought about calling oma inside

[R] 'Split' chracter

2007-11-24 Thread Sébastien
Dear R-users, The following code splits a very simple dataframe into a list, each element of the list being one line of the dataframe. You will see that the split function names each element of the list by using uses the content of a and b and merging them with a "." character. Is there a way

Re: [R] 'Split' character

2007-11-26 Thread Sébastien
This work fine with paste. Thanks Gabor. Seb Gabor Grothendieck a écrit : > Try this using the BOD data frame that comes with R or > try using interaction in place of paste: > > split(BOD, do.call(paste, c(BOD, sep = ":")), drop=TRUE) > > > On Nov 25, 2007 10:23 AM, <[EMAIL PROTECTED]> wrote: >

Re: [R] 'Split' character

2007-11-26 Thread Sébastien
One additionnal question about a problem that I just noticed in my script: the list created by my split function is sorted in the increasing order and not in the current order of the elements of the do.call argument (see the results of the two last lines of the following script). I was unsuccesf

Re: [R] 'Split' character

2007-11-26 Thread Sébastien
ool of Public Health > Catholic University of Leuven > > Address: Kapucijnenvoer 35, Leuven, Belgium > Tel: +32/(0)16/336899 > Fax: +32/(0)16/337015 > Web: http://med.kuleuven.be/biostat/ > http://www.student.kuleuven.be/~m0390867/dimitris.htm > > > Quoting Sébastien <

Re: [R] 'Split' character

2007-11-26 Thread Sébastien
Thank you very much Jim. jim holtman a écrit : > You can reorder like this: > > y <- unique(do.call(paste,c(mydata[,1:2],sep = ":"))) > ordered.mydata <- mydata.split[y] > > On Nov 26, 2007 3:08 PM, Sébastien <[EMAIL PROTECTED]> wrote: > >> One

Re: [R] 'Split' character

2007-11-27 Thread Sébastien
; On Nov 26, 2007 3:08 PM, Sébastien <[EMAIL PROTECTED]> wrote: > >> One additionnal question about a problem that I just noticed in my script: >> the list created by my split function is sorted in the increasing order and >> not in the current order of the elements of the

[R] Export in pdf, png, jpg, eps, etc...

2007-11-27 Thread Sébastien
Dear R-users, I have created a bunch of R scripts that automatically create multiple plots, all saved in a pdf device. I initially chose pdf output in order to easily access to multiple plots in a single file. Now, I am trying to play with different devices, like png or eps and I realize that t

[R] Equivalent of match for data.frame

2009-01-03 Thread Sébastien
Dear R-users, I am translating a S script into R and having some troubles with the match function. This function appears to work with vector and data.frame in S, but not in R, e.g.: a <- rep((1:4), each = 10) b <- rep((1:10), times = 4) mydf <- data.frame(a,b) myarg <- mydf[1,] match(myarg, my

Re: [R] Scan a folder for a given type of files

2008-12-08 Thread Sébastien
Thanks Gabor Gábor Csárdi a écrit : > Sebastien, > > see ?list.files, especially the 'pattern' argument. For your > particular case it is > > list.files(pattern="\\.txt$") > > You might want to use the 'ignore.case' argument as well. > > Gabor > > On Mon, Dec 8, 2008 at 10:53 PM, <[EMAIL PROTECTE

Re: [R] Factor levels

2007-09-19 Thread Sébastien
4 4 182 s > 5 5 123 k > 6 6 153 p > 7 7 176 l > 8 8 170 u > 9 9 140 z > 10 10 194 s > 11 11 164 j > 12 12 100 j > 13 13 127 x > 14 14 137 r > 15 15 198 d > 16 16 173 j > 17 17 113 x > 18 18 144 w > 19 19 198 q > 20 20 122 f > &quo

[R] Error message on script execution

2007-10-08 Thread Sébastien
Dear R_users, I have some troubles with a visual basic application I have recently created. This application automatically creates and executes an R script based on a dataset and settings defined by the user. The .r file (Create_Diagnostic_plots.r) is saved first in a given folder and then cal

Re: [R] Error message on script execution

2007-10-30 Thread Sébastien
Dear R_users, I am coming back to you about this problem, since I could not solve it by myself and because I did not receive any reply the first time I put the post on the list. Thanks in advance for any help you could provide. Sebastien Sébastien a écrit : > Dear R_users, > > I

Re: [R] summarize_ (NSE) in combination with quantile not working

2015-11-23 Thread Sébastien Durier
Hello, A more explicit response can be found in : https://cran.r-project.org/web/packages/lazyeval/vignettes/lazyeval.html where it is explained that : "quoted called and strings don’t have environments associated with them, so as.lazy() defaults to using baseenv(). This will work if the expres

[R] Question about a passage in R language

2015-12-11 Thread Sébastien Durier
Hello, In ?Extract, one can read "An empty index selects all values: this is most often used to replace all the entries but keep the attributes" No example is given but if x a vector I interpret this sentence as "x[]". And in fact, all attributes seem to be preserved by this indexing. But in th

[R] Lattice equivalent to ggplot function

2016-10-24 Thread Sébastien Bihorel
Hi, The ggplot2 includes the very convenient stat_summary function to summarize y variable data and plot this summary statistic in a y vs x graph. I need to implement similar functionality in a lattice-based framework. Googling this topic using keywords like lattice, equivalent, stat_summary, did

[R] Sweave and kile

2010-03-17 Thread Sébastien Bihorel
Dear R-users, I want to give a try to Sweave and Latex but I am having some problems compiling my .Rnw files within Kile. I have followed the recommendations given in http://tolstoy.newcastle.edu.au/R/e5/help/08/10/4277, but they do not seem to address my particular problem. I am using R 2.11.0 a

Re: [R] Sweave and kile

2010-03-17 Thread Sébastien Bihorel
for your TEXINPUTS environment variable to include the output > suggested by > > R CMD env |grep TEXINPUTS > > Martin > > On 03/17/2010 04:48 PM, Sébastien Bihorel wrote: > > Dear R-users, > > > > I want to give a try to Sweave and Latex but I am hav

[R] R package documentation

2010-04-14 Thread Sébastien Bihorel
Dear R users, I am currently writing the documentation for my first package. I have created a short user manual using sweave/pdflatex which is distinct from the manual/summary-of-package-functions created by R CMD CHECK. I was wondering how could I seamlessly combine both documents. Thanks for yo

Re: [R] R package documentation

2010-04-14 Thread Sébastien Bihorel
and I kind of like this combination. Sebastien On Wed, Apr 14, 2010 at 6:52 AM, Tobias Verbeke < tobias.verb...@openanalytics.eu> wrote: > Hi Sébastien, > > > Sébastien Bihorel wrote: > > I am currently writing the documentation for my first package. I have >> creat

Re: [R] R package documentation

2010-04-14 Thread Sébastien Bihorel
Thanks Tobias, If there is no automated way to combine both documents, I will stack them manually... that will likely cause some problems with page numbering tough. Sebastien On Wed, Apr 14, 2010 at 8:18 AM, Tobias Verbeke < tobias.verb...@openanalytics.eu> wrote: > Hi Sébastien, >

Re: [R] R package documentation

2010-04-15 Thread Sébastien Bihorel
Thanks David, After a bit of research, I believe that I've found the post you are referring to: http://tolstoy.newcastle.edu.au/R/e9/help/10/03/8779.html I will look into the proposed solutions. Sebastien On Wed, Apr 14, 2010 at 6:01 PM, David Scott wrote: > Sébastien Bihor

[R] Command not found

2010-04-16 Thread Sébastien Bihorel
Dear R users, I am getting the following error anytime I try to open a vignette, e.g.: > vignette('frame',package='grid') sh: : command not found I am working with "R version 2.11.0 Under development (unstable) (2010-02-17 r51148)" installed on an OpenSuse 11.0 system. Thanks for your help Seb

[R] Problem with vignette compilation during R CMD check

2010-05-02 Thread Sébastien Bihorel
Dear R-users, I am going through the last steps of package prep before submission to CRAN and I have the following problem. My package contains a single vignette written in optimbase.Rnw and that in stored in /inst/doc. optimbase.Rnw contains multiple \input{} statements that refer to .tex files s

[R] Question about output from optim

2009-11-29 Thread Sébastien Bihorel
Dear R-users, I am trying to port to R something that I wrote in Matlab to perform model parameter optimization using the Nelder-Mead simplex method (fminsearch). I read the help on ?optim (which seems to be the way to go) as well as a bunch of posts on the topic, but I would like to make sure abo

[R] Question about output from optim

2009-11-30 Thread Sébastien Bihorel
Thanks Ben for your reply, I would very much appreciate if you could share your code. That would be great! Sebastien PS: As suggested, I will forward this email to John Nash. Sébastien Bihorel free.fr> writes: >* *>* Dear R-users, *>* *>* I am trying to port to R something

[R] Strange behavior when sampling rows of a data frame

2020-06-19 Thread Sébastien Lahaie
I ran into some strange behavior in R when trying to assign a treatment to rows in a data frame. I'm wondering whether any R experts can explain what's going on. First, let's assign a treatment to 3 out of 10 rows as follows. > df <- data.frame(unit = 1:10) > df$treated <- FALSE > > s <- sampl

Re: [R] Strange behavior when sampling rows of a data frame

2020-06-19 Thread Sébastien Lahaie
un 19, 2020 at 7:04 PM Daniel Nordlund wrote: > On 6/19/2020 5:49 AM, Sébastien Lahaie wrote: > > I ran into some strange behavior in R when trying to assign a treatment > to > > rows in a data frame. I'm wondering whether any R experts can explain > > what's

Re: [R] average of rows of each column

2014-04-07 Thread Sébastien Durier
Hello, A solution which avoids apply functions is also possible and maybe quicker for large matrices : n.row <- 120 n.col <- 1000 n.mean <- 10 mat <- matrix(rnorm(n.col*n.row), nrow = n.row) res <- rowMeans(matrix(mat, ncol = n.mean, byrow = T)) dim(res) <- c(n.row/n.mean, n.col) SD 2014-04

[R] Information about font

2014-07-09 Thread Sébastien Bihorel
Hi, I have this set of R scripts which are ran on a linux box and create plots with the lattice package. I do not specify any custom font family, so I believe that whatever is the default font on my system is used in the plot. 1- how can I know which is the default font used in my plots? 2- is thi

Re: [R] Information about font

2014-07-10 Thread Sébastien Bihorel
Hi David, Thank you for your response. I use png devices to create my plots. Looking at ?pdfFonts and ?Type1Font, I believe these fonts only apply to pdf devices. Additionally, ?grid::gpar and ?png are not specific about default font options. Any suggestions? Sebastien On Thu, Jul 10, 2014 a

Re: [R] Information about font

2014-07-10 Thread Sébastien Bihorel
Correction The warnings section in ?png indicate that Helvetica is the default font. Now I need to verify if this is true for my plot and find out where this font is located on my system On Thu, Jul 10, 2014 at 8:54 AM, Sébastien Bihorel wrote: > Hi David, > > Thank you for your response. > >

Re: [R] Information about font

2014-07-11 Thread Sébastien Bihorel
If I may ask, how can I know the path to the font file(s) used by R when it generates the png files with the Helvetica font? Thanks On Thu, Jul 10, 2014 at 12:21 AM, David Winsemius wrote: > > On Jul 9, 2014, at 7:47 PM, Sébastien Bihorel wrote: > > > Hi, > > > > I have this set of R scripts

[R] How can I unsubscrie to this R forum¿?

2012-12-05 Thread Sébastien Morant
Hi, even though the help and the community was a greta plus and a very welcome experience, I wanted to know I can I exit it? thanks for you support. BR [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.c

[R] Problem of scope

2013-12-27 Thread Sébastien Bihorel
Hi, I have a problem of variable scope illustrated by the following example (this examples greatly simplifies the actual code I am working on but I unfortunately cannot share it). I have two functions, funa and funb: funb is called within funa. The goal of funb is to modify variables created withi

Re: [R] Problem of scope

2013-12-27 Thread Sébastien Bihorel
Thank you Uwe. I always forget about how environments are embedded within each other. On Fri, Dec 27, 2013 at 9:33 AM, Sébastien Bihorel wrote: > Hi, > > I have a problem of variable scope illustrated by the following example > (this examples greatly simplifies the actual code

Re: [R] select maximum values

2014-03-31 Thread Sébastien Durier
hello, It's also possible to use the quantile function : vec0 <- c(0.1,0.2, 0.5, 0.1,0.8, 0.4, 0.9) which(vec0 >= quantile(vec0, 0.7, type = 1)) SD 2014-03-29 18:02 GMT+01:00 arun : > Hi, > Try: > vec1 <- setNames(c(0.1,0.2, 0.5, 0.1,0.8, 0.4, 0.9), 1:7) > vec2 <- sort(vec1,decreasing=TRUE) >

[R] Manage several graphical devices in interactive mode

2010-07-25 Thread Sébastien Bihorel
Dear R-users, Does anybody know a good way to create and use several graphical devices at the same time in interactive mode? Ideally, I'd like to open 2 to 3 devices and assign names to them. This way, I could make any addition/modification/update to a particular device using its name. I did not

[R] R equivalent of SAS proc freq

2010-07-25 Thread Sébastien Bihorel
Dear R-users, I am looking for a R function that would be the equivalent of the SAS proc freq ( http://support.sas.com/documentation/cdl/en/procstat/63104/HTML/default/viewer.htm#/documentation/cdl/en/procstat/63104/HTML/default/procstat_freq_sect006.htm). The table, ftable, xtabs functions are cl

Re: [R] Manage several graphical devices in interactive mode

2010-07-26 Thread Sébastien Bihorel
/07/2010 10:03 AM, (Ted Harding) wrote: > >> On 25-Jul-10 13:22:11, Sébastien Bihorel wrote: >> >>> Dear R-users, >>> >>> Does anybody know a good way to create and use several graphical >>> devices at the same time in interactive mode? Ideally, I

[R] Cumulative percentage by unit of time

2010-12-15 Thread Sébastien Rioux
Hi All, I've been struggling on that one for a couple of days. I've tried several things, but nothing is worth publishing. I'm working with a bird nests data frame for which I have a laying date (LD) and a fledgling date (FD) (in calendar Julian date) by nest id. For the period spanning between L

[R] Help with ROracle

2010-12-31 Thread Sébastien Bihorel
Dear R-users, I am working with a colleague on extracting and processing data from our Oracle database using R scripts. We performed some initial testing using functions available in the ROracle package. Overall, our tests were successful and encouraging. There are however a couple of questions/pr

[R] Listing of available functions

2011-01-04 Thread Sébastien Bihorel
Dear R-users, Is there a easy way to access to a complete listing of available functions from a R session? The help.start() and ? functions are great, but I feel like they require the user to know the answer in advance (especially with respect to function names)... I could not find a easy way to s

Re: [R] Listing of available functions

2011-01-04 Thread Sébastien Bihorel
State is presented as a web page" > > http://www.science.oregonstate.edu/~shenr/Rhelp/00cheat.htm<http://www.science.oregonstate.edu/%7Eshenr/Rhelp/00cheat.htm> > > Others are available as pdf's. > > > > On Jan 4, 2011, at 7:13 AM, Sébastien Bihorel wrote: > &g

[R] Remove "Loading required package" message

2010-08-27 Thread Sébastien Moretti
Hi I use --vanilla --quiet --slave options on command line but I always get Loading required package: ... in stderr. How to remove this line ? Thanks R 2.5.1 -- Sébastien Moretti SIB Vital-IT EMBnet, Quartier Sorge - Genopode CH-1015 Lausanne, Switzerland Tel.: +41 (21) 692 4079/4221

Re: [R] Remove "Loading required package" message

2010-08-27 Thread Sébastien Moretti
e ? Thanks require it quietly: require(sp,quietly=TRUE) Barry -- Sébastien Moretti SIB Vital-IT EMBnet, Quartier Sorge - Genopode CH-1015 Lausanne, Switzerland Tel.: +41 (21) 692 4079/4221 http://www.vital-it.ch/ http://ch.embnet.org/ http://myhits.v

[R] Problem with vignette printing

2010-05-14 Thread Sébastien Bihorel
Dear R-users, I am trying to figure out why I cannot print vignettes in my new R installation (R.11 on opensuse 11.2). Apparently, vignette objects are properly created but could not be printed: > z<-vignette('grid') > str(z) List of 3 $ file : chr "/usr/lib/R/library/grid/doc/grid.Snw" $ pdf

Re: [R] Problem with vignette printing

2010-05-14 Thread Sébastien Bihorel
On 14/05/2010 7:25 AM, Sébastien Bihorel wrote: > >> Dear R-users, >> >> I am trying to figure out why I cannot print vignettes in my new R >> installation (R.11 on opensuse 11.2). Apparently, vignette objects are >> properly created but could not be print

Re: [R] Problem with vignette printing

2010-05-14 Thread Sébastien Bihorel
Ok, Solved the problem by editing my Renviron file in /usr/lib/R/etc. Thanks everyone for your help. On Fri, May 14, 2010 at 11:48 AM, Prof Brian Ripley wrote: > On Fri, 14 May 2010, Sébastien Bihorel wrote: > > Yes, I have installed R through opensuse's package installer. Is ?

Re: [R] Problem with vignette printing

2010-05-14 Thread Sébastien Bihorel
Yes, I have installed R through opensuse's package installer. Is ?Startup the correct place to look at about environment variables or is there a more appropriate help page? On Fri, May 14, 2010 at 10:00 AM, Prof Brian Ripley wrote: > On Fri, 14 May 2010, Sébastien Bihorel wrote: > &

[R] Building a package using classes

2010-06-05 Thread Sébastien Durand
R... Any quick comments. Thanks a lot for your time and consideration. Sébastien. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and

[R] Getting variable names in function output

2011-02-02 Thread Sébastien Bihorel
Dear R-users, I would like to have some advises about a problem illustrated by the following snippet. Within myf, I need to evaluate a piece of R code that is passed as a character argument and then return the objects that are created by this code. The difficulty comes from the fact that the conte

[R] Relationships between png resolution, axis.text$cex trellis setting, and paddings

2011-02-15 Thread Sébastien Bihorel
Dear R-users, I was wondering if somebody could shed some light on the relationships existing between the resolution of a png device, the axis.text$cex trellis setting, and the paddings of the actual graph. In the following code, I create a custom trellis theme that set (among other thing) axis.te

[R] Function scope issues

2011-02-16 Thread Sébastien Bihorel
Dear R-users, I have some questions about the scope of functions, which I would like to illustrate with the following example: ### First example require(Hmisc) combine.levels <- function(x,y) browser() whatever <- function(x,y) combine.levels(x,y) x <- 1:5 names(x) <- LETTERS[x] y <- 6: 10 name

[R] darcs patch: Apply on data frame

2011-02-17 Thread Sébastien Bihorel
Hi, You need to add parentheses around your return argument. (Please, note that your example is not successfully because of data problem). ranksum <- function(a){ g1 <- c(1, 2, 3) g2 <- c(4, 5, 6, 7, 8, 9, 10, 11, 12) c <- wilcox.test(a[g1], a[g2]) return(c$p.value) } [[alternati

[R] Discrepancies in run times

2011-02-22 Thread Sébastien Bihorel
Dear R-users, I am in the process of creating new custom functions and am quite puzzled by some discrepancies in execution time when I run some R scripts that call those new functions. So here is the situation: - let's assume I have created two custom functions, called myg and myf; - myg is mostly

Re: [R] Discrepancies in run times

2011-02-28 Thread Sébastien Bihorel
imple example that you can share that has the same > behavior. My guess is that you will answer your own question as you try to > do that. > > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Sébastien Bihorel > S

[R] Units and dimensions in grid object

2011-03-04 Thread Sébastien Bihorel
Dear R-users, As far as I understand, when one defines the width of a rectGrob call using a 'npc' unit, the width of the object is proportional to the width of the current viewport. Is there a way to refer to the height (or width) of the viewport when defining the width (or height) of the rectGrob

Re: [R] Units and dimensions in grid object

2011-03-10 Thread Sébastien Bihorel
ul Murrell wrote: > Hi > > > On 5/03/2011 9:37 a.m., Sébastien Bihorel wrote: > >> Dear R-users, >> >> As far as I understand, when one defines the width of a rectGrob call >> using >> a 'npc' unit, the width of the object is proportional to t

[R] Wald test with inequality constraints

2011-04-06 Thread sébastien saegesser
Dear Helpers, I need to do a spanning test with short sale constraints - so I have to impose and test multiple inequality restrictions to my panel regression model. I looked at several methodologies and for my research the most efficiency methodology is to a Wald test as proposed in: Econometr

[R] how to code a restriction matrix with the following restrictions

2011-04-14 Thread sébastien saegesser
Dear list members, I need to fit a regression with two inequality constraints. I look up in the literature and R archive and found some ways to do it, for example using the ic.infer package. However I do not know how to write in R my constraints. In the package help, it is told that I hav

[R] how to code a restriction matrix with the following restrictions

2011-04-14 Thread sébastien saegesser
Dear list members, I need to fit a regression with two inequality constraints. I look up in the literature and R archive and found some ways to do it, for example using the ic.infer package. However I do not know how to write in R my constraints. In the package help, it is told that

[R] Define ylim in lattice plot based upon panel function output

2011-04-18 Thread Sébastien Bihorel
Dear R-users, By default, the xyplot function automatically defines the axis ranges based upon the content of y and x variables. However, when one includes some calls to other panel. functions in the panel argument, the results might be out of range and not show up in the final graphs (see lower e

Re: [R] Define ylim in lattice plot based upon panel function output

2011-04-19 Thread Sébastien Bihorel
olves multiple panel.xyplot, panel.superpose, panel.abline, panel.loess, panel.lines and grid.polygon calls, all conditional on the settings of the xyplot call... This is going to be fun Sebastien On Mon, Apr 18, 2011 at 10:46 PM, Deepayan Sarkar wrote: > On Tue, Apr 19, 2011 at 7:38 AM, Sébastien

[R] Package check issue: Rprofile.site is not used

2011-04-21 Thread Sébastien Bihorel
Dear R-users, I am having some issues with a package I am working on (using R 2.12.1 in a Linux environment) and would like to have your opinions/advises. My package - let's call it mypackage for the purpose of this email - passes all checks of R CMD check, except for the following failure message

[R] Grid unit width and font face

2011-08-12 Thread Sébastien Bihorel
Dear R-users, When one defines a grid unit object using the 'strwidth' dimension, it seems that the default plain font is assumed as the following example illustrates. Is there a way to either make use of a font option when creating a unit object or to know the factor that exists between the width

[R] deSolve output

2011-08-12 Thread Sébastien Bihorel
Hi, Try with the following ODE function. This should give you an extra column with the derivative of G in your THAAC matrix. degradation = function (t, state, parameters) {  with(as.list(c(state, parameters)),    {dG = (-a*(t+i)^b)*(G)    list(c(dG),dG=dG)    }) } Any additional variables that y

[R] How to add horizontal lines above bar graph to display p-values?

2011-08-19 Thread Sébastien Vigneau
Hi, I would like to draw horizontal lines above a bar graph, in order to display the p-values of a Fisher test. Here is an exampleof the type of display I would like to have. Is there a way to draw the

[R] Groups and bwplot

2011-08-20 Thread Sébastien Bihorel
Dear R-users, A while ago, Deepayan Sarkar suggested some code that uses the group argument in bwplot to create some 'side-by-side' boxplots (https://stat.ethz.ch/pipermail/r-help/2010-February/230065.html). The example he gave was relatively specific and I wanted to generalize his approach into a

Re: [R] Groups and bwplot

2011-08-20 Thread Sébastien Bihorel
t, Aug 20, 2011 at 11:38 AM, Weidong Gu wrote: > You may want to consult a recent post by Felix > (https://stat.ethz.ch/pipermail/r-help/2011-August/286707.html) on how > to pass group parameter. > > Weidong Gu > > On Sat, Aug 20, 2011 at 6:59 AM, Sébastien Bihorel wrote: >> De

Re: [R] Groups and bwplot

2011-08-22 Thread Sébastien Bihorel
','uptake',myCO2) # works mybwplot('Type','uptake',myCO2,'Treatment') # works mybwplot('Type','uptake',myCO2,'year') # works On Sat, Aug 20, 2011 at 1:35 PM, Sébastien Bihorel wrote: > Thanks for your input and this

Re: [R] How to add horizontal lines above bar graph to display p-values?

2011-08-22 Thread Sébastien Vigneau
Thanks! Sebastien 2011/8/20 Uwe Ligges > > > On 19.08.2011 22:27, Sébastien Vigneau wrote: > >> Hi, >> >> I would like to draw horizontal lines above a bar graph, in order to >> display >> the p-values of a Fisher test. Here is an >> ex

[R] Two-levels labels on x-axis?

2011-08-22 Thread Sébastien Vigneau
Hi, I would like to draw a stacked bar chart with four bars (say "a", "b", "c", "d") . Two bars belong to group A and the two others to group B. Therefore, I would like to have, on the x-axis, a label for each bar and an additional label for each group, positioned underneath. To give an idea, the

Re: [R] Two-levels labels on x-axis?

2011-08-22 Thread Sébastien Vigneau
Thanks! Sebastien On Mon, Aug 22, 2011 at 2:11 PM, Marc Schwartz wrote: > On Aug 22, 2011, at 12:14 PM, Sébastien Vigneau wrote: > > > Hi, > > > > I would like to draw a stacked bar chart with four bars (say "a", "b", > "c", > >

Re: [R] Two-levels labels on x-axis?

2011-08-22 Thread Sébastien Vigneau
marks separating the groups are longer? Thank you for your help! Sebastien On Mon, Aug 22, 2011 at 2:07 PM, Joshua Wiley wrote: > Hi Sébastien, > > Not sure about an elegant, general way but here is something quick and > dirty: > > p <- barplot(matrix(1:8, 2)) >

Re: [R] Two-levels labels on x-axis?

2011-08-24 Thread Sébastien Vigneau
) axis(side=1,at=c(1,3,5,7),labels=c("a","b","c","d"),tick=FALSE) axis(side=1,at=c(2,6),labels=c("A","B"),tick=FALSE,padj=2) Sebastien On Mon, Aug 22, 2011 at 6:33 PM, Sébastien Vigneau < sebastien.vign...@gmail.com> wrote: > Th

[R] Combining a greek letter and a newline on the same label

2011-08-25 Thread Sébastien Vigneau
Hi, I would like to add a two-lines label consisting of: "Delta word1\n word2" (with Delta being the actual greek letter). However, when I try "expression(paste(Delta,"word1\nword2"))", I obtain the following display: "word1\n Delta word2". Do you have any idea on how to obtain the desired displ

Re: [R] Combining a greek letter and a newline on the same label

2011-08-25 Thread Sébastien Vigneau
Thank you very much for the detailed explanations, and sorry for being vague in my question. "atop" is what I needed :) Sebastien On Thu, Aug 25, 2011 at 11:59 AM, David Winsemius wrote: > > On Aug 25, 2011, at 11:23 AM, Sébastien Vigneau wrote: > > Hi, >> >&g

[R] How to modify the dot-dot-dot argument using level names instead of position

2011-08-31 Thread Sébastien Bihorel
Dear R-users, In the R internals manual, it is said that one can extract the elements of the dot-dot-dot argument using the special symbols ..1 or ..2. It seems to work just fine but I was wondering if there is a way one can extract or modify the content of the dot-dot-dot argument using a level n

Re: [R] How to modify the dot-dot-dot argument using level names instead of position

2011-08-31 Thread Sébastien Bihorel
to modify the content of dot-dot-dot by any means? Thank On Wed, Aug 31, 2011 at 9:25 AM, Sébastien Bihorel wrote: > Dear R-users, > > In the R internals manual, it is said that one can extract the > elements of the dot-dot-dot argument using the special symbols ..1 or > ..2. It s

Re: [R] How to modify the dot-dot-dot argument using level names instead of position

2011-08-31 Thread Sébastien Bihorel
Thanks Duncan On Wed, Aug 31, 2011 at 9:43 AM, Duncan Murdoch wrote: > On 31/08/2011 9:41 AM, Sébastien Bihorel wrote: >> >> Hi, >> >> I thought "..2<- 1" was a correct way to modify the content of the >> 2nd level of dot-dot-dot because it did

[R] R help

2012-07-16 Thread Sébastien Morant
hi would you please remove my email from the mailing list. thanks in advance Sebastien [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http:/

[R] How to adjust y-axis when using panel.densityplot within histogram function

2011-07-27 Thread Sébastien Bihorel
Hi I would like to superimpose group-specific densityplots on top of an overall histogram using panel.histogram and panel.densityplot. Furthermore, I would like to automatically adjust the range of the y-axis to take into account the ranges of both histogram and densityplot. This last part is wher

Re: [R] How to adjust y-axis when using panel.densityplot within histogram function

2011-07-27 Thread Sébastien Bihorel
allow to draw densityplots only when it is appropriate (ie when the type of the histogram is set to density). Sebastien On Wed, Jul 27, 2011 at 10:01 AM, David Winsemius wrote: > > On Jul 27, 2011, at 9:15 AM, Sébastien Bihorel wrote: > > Hi >> >> I would like to su

[R] Need to compute density as done by panel.histogram

2011-08-02 Thread Sébastien Bihorel
Hi, This might be a simple problem but I don't know how to calculate a random variable density the way panel.histogram does it before it creates the actual density rectangles. The documentation says that it uses the density function but the actual code suggests that the hist.constructor function (

Re: [R] Need to compute density as done by panel.histogram

2011-08-03 Thread Sébastien Bihorel
Thank you very much Peter, I'm going to dig deeper into the code of the functions you've listed. On Wed, Aug 3, 2011 at 6:57 AM, Peter Ehlers wrote: > On 2011-08-02 11:51, Sébastien Bihorel wrote: > >> Hi, >> >> This might be a simple problem but I do

[R] How to calculate the number of time a given string can be displayed in the width of a grid viewport

2011-08-03 Thread Sébastien Bihorel
Dear R users, I am trying to determine how many characters can be displayed within the width of an open grid viewport. Unfortunately, the arithmetic operation that seems obvious in this case is be permitted with unit objects (see example below). Although it isa brut force way to get this number (u

[R] How to calculate the number of times a given string can be displayed in the width of a grid viewport

2011-08-03 Thread Sébastien Bihorel
There was too many spelling mistakes in my original post so I have decided to re-submit it. So here is it Dear R users, I am trying to determine how many characters can be displayed within the width of an open grid viewport. Unfortunately, the arithmetic operation that seems obvious in this case

[R] How to automate the detection of break points for use in cut

2011-12-06 Thread Sébastien Bihorel
Dear R-users, I would like to know if there is a function (in base R or the extension packages) that would automatically detect the break points in a vector x for later use in the cut function. The idea is to determine the boundaries of the n intervals (n>=1) delimiting clusters of data points whi

Re: [R] How to automate the detection of break points for use in cut

2011-12-06 Thread Sébastien Bihorel
Obviously, cut would do the job if one knows the number of intervals in advance, which I assume I won't. I guess what I'm looking for is a function that figures out the number of intervals and their boundaries. Sebastien On Tue, Dec 6, 2011 at 3:29 AM, Sébastien Bihorel wrote: >

[R] Argument validation within functions

2011-12-06 Thread Sébastien Bihorel
Adding on Michael comment: If your trap all conditions that render your main code invalid at the beginning of your code, the main code does not have to be within the "else" part of a if else statement. For instance: myf <- function(a,b,c){ if ( ! (is.numeric(a) && (a>=0 & a<=1) ) ){ stop('a i

Re: [R] How to automate the detection of break points for use in cut

2011-12-06 Thread Sébastien Bihorel
I forgot to post my reply to Duncan's response on the list. On Tue, Dec 6, 2011 at 7:56 AM, Sébastien Bihorel wrote: > Thanks for the link Duncan, > > Given the number of methods and links listed in the Cluster task view, > things are looking a bit more complex than I though

  1   2   >