Re: [R] How to access the attributes of a ggplot?

2008-04-08 Thread Tribo Laboy
Hi Hadley, Thanks for replying. I know that I can directly modify some of the properties of the plot object, but I was more interested in querying the current plot properties, something like: xlimits - getggopts(pobj, x_scale_limits) Is there anything like this implemented? I tried to drill

Re: [R] How to pack my stuff into a package (library, collection)?

2008-04-08 Thread Tribo Laboy
okey-dokey, one more problem resolved. Keeping one documentation .Rd file for each R source file. Thanks! TL __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

[R] How to pack my stuff into a package (library, collection)?

2008-04-07 Thread Tribo Laboy
Hello, I am new useR, I have written some functions, which I currently use by source-ing them from the files. That's OK, but when I my functions start counting in the tens and hundreds I'd be glad to be able to type help.search(my_obscure_fun) and get a sensible reply. I also want to be able to

Re: [R] How to pack my stuff into a package (library, collection)?

2008-04-07 Thread Tribo Laboy
? Regards, TL On Mon, Apr 7, 2008 at 3:49 PM, Simon Blomberg [EMAIL PROTECTED] wrote: On Mon, 2008-04-07 at 15:13 +0900, Tribo Laboy wrote: Hello, I am new useR, I have written some functions, which I currently use by source-ing them from the files. That's OK, but when I my

Re: [R] How to pack my stuff into a package (library, collection)?

2008-04-07 Thread Tribo Laboy
On Mon, Apr 7, 2008 at 8:02 PM, Duncan Murdoch [EMAIL PROTECTED] wrote: Tribo Laboy wrote: Hi Simon, I did the example given in package.skeleton f - function(x,y) x+y g - function(x,y) x-y d - data.frame(a=1, b=2) e - rnorm(1000) package.skeleton(list=c(f,g,d,e), name=mypkg

Re: [R] How to pack my stuff into a package (library, collection)?

2008-04-07 Thread Tribo Laboy
On Mon, Apr 7, 2008 at 11:09 PM, Duncan Murdoch [EMAIL PROTECTED] wrote: On 4/7/2008 9:33 AM, Tribo Laboy wrote: ... Hi Duncan, Thanks for your reply. I checked the Rtools and the other relevant tools. I will most probably install them, although unwillingly. Unwillingly, because

Re: [R] Thinking about using two y-scales on your plot?

2008-04-04 Thread Tribo Laboy
Hi It always nice to follow these discussions. There's always so much to learn. I can't disagree with most of the article that Hadley pointed us to, but still I can see value in double y-axis plots. I even remember using one a few years ago. What was said about the temperature in Celsius and in

Re: [R] Combining several mappings in ggplot2

2008-04-04 Thread Tribo Laboy
-Oorspronkelijk bericht- Van: Tribo Laboy [mailto:[EMAIL PROTECTED] Verzonden: woensdag 26 maart 2008 17:42 Aan: ONKELINX, Thierry CC: hadley wickham; r-help@r-project.org Onderwerp: Re: [R] Combining several mappings in ggplot2 Hi Thierry Thanks for replying. I tried your code

Re: [R] ps or pdf

2008-04-04 Thread Tribo Laboy
The graphics devices are very similar (they share a lot of code). One small difference is that PostScript has an arc primitive, and PDF does not. Sorry for interjecting, but I have a burning question. It is a bit off topic, so I apologize in advance. What is the stance of the R

[R] Loosing attributes while binding data frames ...

2008-04-04 Thread Tribo Laboy
Hello I want to keep track of my units in the data frame. I have been advised in the past on this list to create a new units attribute of the data frame and keep the units strings there. It works fine as long as I don't manipulate the data frame. Here's an example: -CODE BEGIN

[R] How to access the attributes of a ggplot?

2008-04-04 Thread Tribo Laboy
Hi, I am having some hard time figuring how to access (and modify) the properties of an object created by ggplot. I found 'ggopts', but it only returns some of the properties. Say I want to get the x- and y-axis limits, the tickmark locations, legend current position, the legend box and

Re: [R] Rule for accessing attributes?

2008-03-27 Thread Tribo Laboy
PROTECTED] [1] x y z See ?'@' for more details. -Christos -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tribo Laboy Sent: Thursday, March 27, 2008 12:16 AM To: r-help@r-project.org Subject: [R] Rule for accessing

Re: [R] Moving data between R and Matlab back and forth?

2008-03-27 Thread Tribo Laboy
]])) } } labpcdata - as.data.frame(labpc) ---Code end Regards, TL On Thu, Mar 27, 2008 at 4:08 PM, Prof Brian Ripley [EMAIL PROTECTED] wrote: On Thu, 27 Mar 2008, Tribo Laboy wrote: I realized that not everyone has Matlab and that basically

Re: [R] Rule for accessing attributes?

2008-03-27 Thread Tribo Laboy
access the list elements by name directly: lst$x; lst$y; lst$z, But I want to do for (k in 1:3) { lst$nm[k] } But this doesn't work, basically because lst$nm[1] returns a NULL. So what do I do? Thanks for helping, TL On Thu, Mar 27, 2008 at 4:30 PM, Tribo Laboy [EMAIL PROTECTED] wrote: So

Re: [R] Rule for accessing attributes?

2008-03-27 Thread Tribo Laboy
Ripley [EMAIL PROTECTED] wrote: Use [[ ]]. It seems it is time for you to study a good introduction to R. On Thu, 27 Mar 2008, Tribo Laboy wrote: Now, how is it that I can access the contents of a named list by dynamically computed name? To go back to my previous example I

Re: [R] Moving data between R and Matlab back and forth?

2008-03-27 Thread Tribo Laboy
I have packaged the above posted code as a function and I am posting it here in case someonw would find it useful in the future. --function begin - readMat2df - function(readfiledata, datastr){ tmpdata - readfiledata[[datastr]] # use the string contained

Re: [R] Combining several mappings in ggplot2

2008-03-26 Thread Tribo Laboy
= data) : 'x' and 'units' must have length 0 What am I doing wrong? Regards, TL On Wed, Mar 26, 2008 at 2:08 AM, hadley wickham [EMAIL PROTECTED] wrote: On Tue, Mar 25, 2008 at 11:48 AM, Tribo Laboy [EMAIL PROTECTED] wrote: Hello, I want to be able to make a plot that has

[R] Moving data between R and Matlab back and forth?

2008-03-26 Thread Tribo Laboy
Hi to the list, I am trying to find a way to painlessly move structured data back and forth between R and Matlab (also Octave). For this purpose I found the R.matlab package great help. I wish to use a Matlab -v6 MAT file as an intermediary format, because it is well read by both Matlab and

Re: [R] Moving data between R and Matlab back and forth?

2008-03-26 Thread Tribo Laboy
at 1:27 AM, Tribo Laboy [EMAIL PROTECTED] wrote: Hi to the list, I am trying to find a way to painlessly move structured data back and forth between R and Matlab (also Octave). For this purpose I found the R.matlab package great help. I wish to use a Matlab -v6 MAT file as an intermediary

Re: [R] Combining several mappings in ggplot2

2008-03-26 Thread Tribo Laboy
:01 AM, Tribo Laboy [EMAIL PROTECTED] wrote: Apologies! I though that the Orange dataset comes with R, but it is in fact in the package datasets. So here's another Orange2 dataset for the example: Tree_v = rep(c(1:5),each = 5) age_v = rep(seq(1,25, by = 5),5) + 10*runif(25

[R] Rule for accessing attributes?

2008-03-26 Thread Tribo Laboy
Hi ! I am a new user and quite confused by R-indexing. Make a list and get the attributes lst - list(x = 1:3, y = 4:6, z = 7:9) attributes(lst) This returns: $names [1] x y z I can easily do: nm -names(lst) or nm -attr(lst,names) which both return the assigned names of the named list

Re: [R] Rule for accessing attributes?

2008-03-26 Thread Tribo Laboy
PROTECTED] wrote: You need to use the '@' operator to directly access attributes (not elements) of objects: [EMAIL PROTECTED] [1] x y z See ?'@' for more details. -Christos -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tribo Laboy

[R] Combining several mappings in ggplot2

2008-03-25 Thread Tribo Laboy
Hello, I want to be able to make a plot that has several series with different color and linetype. Online documentation suggest that this is possible, but I haven't found how: We can also create redundant mappings, mapping the same variable to multiple aesthetics. This is most useful when

[R] How to assign multiple return values

2008-03-24 Thread Tribo Laboy
Hi, I am moving from MATLAB, where one can easily assign a number of output values from a function like this: [x,y] = myfun(a,b) Then variables x and y can be directly used in the caller workspace. I understand that R functions return a single argument, which could be a list. This in a way

Re: [R] More elegant multiplication or division of a data frame with avector

2008-03-23 Thread Tribo Laboy
: [EMAIL PROTECTED] on behalf of Tribo Laboy Sent: Sat 3/22/2008 8:21 AM To: r-help@r-project.org Subject: [R] More elegant multiplication or division of a data frame with avector Hello, I am importing some raw voltage multichannel measurements into an R data frame. I need to scale each

[R] More elegant multiplication or division of a data frame with a vector

2008-03-22 Thread Tribo Laboy
Hello, I am importing some raw voltage multichannel measurements into an R data frame. I need to scale each column with the respective sensitivity for that channel. I figured how to do it, but I am curious if there isn't a more elegant way. Now I start with something like this: rawdata -

Re: [R] Plotting series marked with a symbol on every nth data point, preferably in ggplot...

2008-02-25 Thread Tribo Laboy
On 2/26/08, hadley wickham [EMAIL PROTECTED] wrote: Maybe someone can help with the ggplot version of this thing? Your best bet is just to wait a couple of weeks until the next version of gglot2 comes out :) Hadley -- http://had.co.nz/ I'm certainly looking forward to it! Cheers, TL

[R] Plotting series marked with a symbol on every nth data point, preferably in ggplot...

2008-02-24 Thread Tribo Laboy
Hello! I am working with signals and a plot of several signals on the same axes can get quite messy. With lines that are very fractured, distinction by only the linestyle is not very clear. If I add symbols to the plot however, there are so many symbols, that they overplot and the whole plot is

Re: [R] Plotting series marked with a symbol on every nth data point, preferably in ggplot...

2008-02-24 Thread Tribo Laboy
) On Sun, Feb 24, 2008 at 11:01 PM, Tribo Laboy [EMAIL PROTECTED] wrote: Hello! I am working with signals and a plot of several signals on the same axes can get quite messy. With lines that are very fractured, distinction by only the linestyle is not very clear. If I add symbols

Re: [R] How to split a factor (unique identifier) into severalothers?

2008-02-08 Thread Tribo Laboy
Of Tribo Laboy Sent: Thursday, February 07, 2008 2:33 AM To: Dimitris Rizopoulos Cc: r-help@r-project.org Subject: Re: [R] How to split a factor (unique identifier) into severalothers? Hi Dimitris, Your code works like charm, but I don't really understand how. If you have

Re: [R] Bode plots in ggplot2

2008-02-08 Thread Tribo Laboy
Hi Hadley and Thiery Thanks for the responses. I worked through the code provided by Thiery and at the end I realized that the scales for the phase and the gain are the same, which in practice is not the case. Then I read Hadley's comment and worked with it a bit too. It is already quite late

[R] How to split a factor (unique identifier) into several others?

2008-02-06 Thread Tribo Laboy
Hello, I have a data frame with a factor column, which uniquely identifies the observations in the data frame and it looks like this: sample1_condition1_place1 sample2_condition1_place1 sample3_condition1_place1 . . . sample3_condition3_place3 I want to turn it into three separate factor

Re: [R] Reformatting data into data frame and plotting it in ggplot2

2008-02-03 Thread Tribo Laboy
of uncertainties, a surgery of suppositions. ~M.J.Moroney -Oorspronkelijk bericht- Van: Tribo Laboy [mailto:[EMAIL PROTECTED] Verzonden: vrijdag 1 februari 2008 15:18 Aan: ONKELINX, Thierry CC: r-help@r-project.org Onderwerp: Re: [R] Reformatting data into data frame

[R] Reformatting data into data frame and plotting it in ggplot2

2008-02-01 Thread Tribo Laboy
Hello, I am sure this must have been asked before, but my nabble search did not turn anything useful. Just pointer where to look will also be nice. So, I have the following data: x_test1 - c(1:10) y_test1-rnorm(10) x_test2 - c(1:15) y_test2-rnorm(15) x_test3 - c(1:20)

[R] Reformatting data into data frame and plotting it in ggplot2

2008-02-01 Thread Tribo Laboy
Hello, I am sure this must have been asked before, but my nabble search did not turn anything useful. Just pointer where to look will also be nice. So, I have the following data: x_test1 - c(1:10) y_test1-rnorm(10) x_test2 - c(1:15) y_test2-rnorm(15) x_test3 - c(1:20) y_test3-rnorm(20) These

Re: [R] Reformatting data into data frame and plotting it in ggplot2

2008-02-01 Thread Tribo Laboy
- Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Namens Tribo Laboy Verzonden: vrijdag 1 februari 2008 9:59 Aan: r-help@r-project.org Onderwerp: [R] Reformatting data into data frame and plotting it in ggplot2 Hello, I am sure this must have been asked before, but my nabble

Re: [R] Reformatting data into data frame and plotting it in ggplot2

2008-02-01 Thread Tribo Laboy
Hi Hadley, Thanks for ggplot. Great piece of work. Very intuitive. The legend always seems to be the most difficult part to implement in any plotting package. gnuplot and RLplot come to mind. Good luck! On Fri, Feb 1, 2008 at 10:17 PM, hadley wickham [EMAIL PROTECTED] wrote: just the patch.

Re: [R] Reformatting data into data frame and plotting it in ggplot2

2008-02-01 Thread Tribo Laboy
For some reason I get the following error: Error: could not find function scale_colour_manual so I couldn't make the plots. Otherwise I completely agree that color is good way to summarize in the key several different models and operations performed on the same data (it is always a trick to