Re: [R] Data Rearrangement

2014-02-28 Thread JiHO
You actually want cast() from the reshape package, not melt(). I would recommend using dcast() from reshape2, the newer version of reshape. Jean-Olivier Irisson — Université Pierre et Marie Curie Laboratoire d'Océanographie de Villefranche 181 Chemin du Lazaret 06230 Villefranche-sur-Mer Tel: +33

Re: [R] Solving Classification problems in R

2014-02-28 Thread JiHO
Do you mean supervised or unsupervised classification. If supervised, I have had great success using gradient boosted classification in package gbm. multinomial distribution will get you multiple classes and it will select relevant predictors by itself given the training data. Not sure about the

Re: [R] Heatmap in R and/or ggplot2

2011-06-15 Thread JiHO
se guicktime on Mac OS X or mencoder on Linux/OS X. I don't know about Windows. Since mencoder works on the command line, you can call it from R and I have code to ease that: https://gitorious.org/r/r-utils/blobs/master/lib_movie.R but you should get familiar with mencoder a l

[R] Class htest with non-numeric p-values

2011-04-20 Thread JiHO
way to include that in an object of class "htest"? I see in print.htest() that the p.value element goes through format.pval() which expect a numeric argument. Is there any workaround? Thank you in advance. Sincerely, JiHO --- http://maururu.net ___

[R] Marginality rule between powers and interaction terms in lm()

2011-01-21 Thread JiHO
aning when a quadratic term or an interation is involved, and why they should not be removed in most circumstances. I haven't found anything related to quadratic vs. interactions. Thanks in advance for your help. Sincerely, JiHO --- http://maururu.net ___

Re: [R] Plotting a cloud/fog of variable density in rgl

2010-11-28 Thread JiHO
f I could compute this, I am not sure how I would plot the result. My goal is really to add this to my R-plotting arsenal and use it in routine, not to develop something very specific for this particular application. But thank you for taking the time to reply, maybe I'll c

[R] Plotting a cloud/fog of variable density in rgl

2010-11-22 Thread JiHO
alpha = alpha/5 # plot library("rgl") spheres3d(d$x, d$y, d$z, alpha=alpha, radius=0.05) I saw the fog effect but it seems to add a fog in the scene to increase depth. What I want is my scene to actually look like a fog. Thanks in advance for

Re: [R] read.table or read.csv without row index?

2010-05-05 Thread JiHO
it needs a numeric vector and does not automatically convert your data.frame into it. So you need: mean.default(as.numeric(temp[2,2:3])) or more simply mean(as.numeric(temp[2,2:3])) I hope that helped. Sincerely, JiHO --- http://maururu.net

[R] Confidence interval around a mean count (poisson based?)

2010-05-05 Thread JiHO
ry much in advance. PS: what I did so far was just compute mean +/- SD. The result is here: http://dl.dropbox.com/u/1047321/hist_mean-SD.pdf Maybe the SD is already so large that it is not even worth trying to pursue my goal above... Sincerely, JiHO --- http://m

Re: [R] quartz() and dpi

2010-01-28 Thread JiHO
ut correct size. I currently chose the fonts over the size since the size can be corrected and the fonts cannot. BUt of course I would rather not have to choose ;) JiHO --- http://maururu.net __ R-help@r-project.org mailing list https://stat.ethz.ch/mailma

[R] quartz() and dpi

2010-01-27 Thread JiHO
to add a 'scale' argument to includegraphics in latex for those. I would rather leave the latex document alone, use extension-less file names includegraphics and decide from R wether to produce a pdf or a png. Thank you in advance, JiHO --- http://maururu.net ___

Re: [R] Merge data frames but prefer values in on

2009-09-14 Thread JiHO
"in one step" I meant within the merge, not in one post- processing step ;) JiHO --- http://maururu.net __ 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

[R] Merge data frames but prefer values in one

2009-09-10 Thread JiHO
r fonction that would do that or do I have to resort to some post-processing after merge? It seems that it might be something like a "right merge" for data bases but I don't know this world at all. I would be happy to look into sqldf if that allows to do things like that.

Re: [R] Cream Text Editor

2009-05-23 Thread JiHO
them. Maybe that's specific to Cream. JiHO --- http://jo.irisson.free.fr/ __ 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 pr

Re: [R] Cream Text Editor

2009-05-23 Thread JiHO
the default X-term to gnome-terminal. You have to edit the file .vim/ftplugin/r.vim. There is a line commented with the gnome- terminal command instead of xterm. Uncomment this one and comment the xterm one. JiHO --- http://jo.irisson.free.fr/ _

Re: [R] [R-sig-Geo] Comparing spatial distributions - permutation test implementation

2009-05-21 Thread JiHO
omputed with QB and actually closer to yours. Looking at your code I still don't get what I am doing wrong though. It seems we both use sample to get a few of the columns and then swap them. Well, I'll use your test anyway. JiHO --- http://jo.irisson.free.fr/ ___

[R] Comparing spatial distributions - permutation test implementation

2009-05-20 Thread JiHO
quot;text") } # Compute the syrjala stat for the observations psi = syrjala.stat(dataCod) # Estimate the pvalue pvalue = (sum(psis>=psi)+1)/nperm psi pvalue # Should be: # statistic = 0.224 # p-value = 0.1900 Thank you very much in advance. Sincerely, JiHO --- h

Re: [R] Evaluating content of command line arguments

2009-05-01 Thread JiHO
On 2009-April-30 , at 22:28 , Gabor Grothendieck wrote: Check out the getopt package. Thanks! That's what I need. JiHO --- http://jo.irisson.free.fr/ __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEA

[R] Evaluating content of command line arguments

2009-04-30 Thread JiHO
and all that but did not find anything. Is that possible? Otherwise I will resort to parsing the arguments with strsplit but I would much prefer and more elegant solution. Thank you very much in advance. Sincerely, JiHO --- http://jo.irisson.free.fr/

Re: [R] 'require' equivalent for local functions

2009-03-23 Thread JiHO
imple keyboard shortcut in my text editor to source the current file in the currently R session, so it will be easy to re-source some files after I modify them. On the other hand I have a bundle of general enough functions that I import in many projects (http://github.com/jiho/r-utils/ for

[R] 'require' equivalent for local functions

2009-03-22 Thread JiHO
rce(lib) } } but I am really not confident with all those deparse/substitute things and the environment manipulation, so I guess there should be a better way. JiHO --- http://jo.irisson.free.fr/ __ R-help@r-project.org mailing list https://sta

Re: [R] Converting Matrix into List - problem (urgent)

2009-03-22 Thread JiHO
just want to print a clean output on the screen? If yes, look at `cat`, or `print`. JiHO --- http://jo.irisson.free.fr/ __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://

Re: [R] Converting Matrix into List - problem (urgent)

2009-03-22 Thread JiHO
.652199 0.579333"), sep=" ") # you would use scan with the filename in which the data is, rather than the textConnection. That's just for the purpose of the demonstration here. # possible outputs congeneric[1:20] as.list(congeneric[1:20]) for (i in 1:20) {

Re: [R] Converting Matrix into List - problem (urgent)

2009-03-22 Thread JiHO
with that? What do you need the list for? It would help to know (a bit) of the general context to help you. JiHO --- http://jo.irisson.free.fr/ __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

Re: [R] Plot and Boxplot in the same graph

2009-03-21 Thread JiHO
what you just asked: http://had.co.nz/ggplot2/geom_jitter.html look at the end. As for transparency, you can use geom_boxplot(fill=alpha("white",0.5)) for example. JiHO --- http://jo.irisson.free.fr/ __ R-help@r-project.org mai

Re: [R] plotting two variables with a third used for color

2009-03-21 Thread JiHO
ata.frame dat = data.frame(v=wV[0:15,3], y=wY[0:15,3], sign=ifelse(wY[0:15,3]>0,">0","<0")) ggplot(data=dat) + geom_point(aes(x=v,y=y,colour=sign)) JiHO --- http://jo.irisson.free.fr/ __ R-help@r-project.org mailing list h

Re: [R] R on Mac PRO does anyone have experience with R on such a platform ?

2008-02-12 Thread jiho
On 2008-February-11 , at 21:06 , Charilaos Skiadas wrote: > JiHO, in case you are not following TextMate's mailing list, you > might want to check out Hans-Jorg Bibiko's work on Rdaemon: > > http://article.gmane.org/gmane.editors.textmate.general/24195/ > > It pr

Re: [R] fun.aggregate=mean in reshape

2008-02-12 Thread jiho
6.2 >> year 2008 >> month 02 >> day08 >> svn rev44383 >> language R >> version.string R version 2.6.2 (2008-02-08) >> >> >>> installed.packages() >> >> reshape

Re: [R] R on Mac PRO does anyone have experience with R on such a platform ?

2008-02-11 Thread jiho
ou don't use only R, you can keep the same habits with a nice editor. I haven't tried Emacs+ESS. I've heard a lot of good things about it but learning Emacs is a task in itself. [1] http://macromates.com/ [2] modification of those http://j

Re: [R] [R-sig-Geo] Comparing spatial point patterns - Syrjala test

2008-02-10 Thread jiho
ease include me in the > distribution list? > > Thanks much! Begin forwarded message: > From: jiho <[EMAIL PROTECTED]> > Subject: Comparing spatial point patterns - Syrjala test > > Dear Lists, > > At several stations distributed regularly in space[1], we sa

Re: [R] [R-sig-Geo] Comparing spatial point patterns - Syrjala test

2008-02-09 Thread jiho
On Feb 9, 2008 10:39 PM, milton ruser <[EMAIL PROTECTED]> wrote: > I have no idea of how to solve this issue, but I suggest you write to the > authors of spatstat package. I think they could help you very much. Another > thing is that there was a threhead on this many times ago. May be that Alan >

[R] Comparing spatial point patterns - Syrjala test

2008-02-09 Thread jiho
Dear Lists, At several stations distributed regularly in space[1], we sampled repeatedly (4 times) the abundance of organisms and measured environmental parameters. I now want to compare the spatial distribution of various species (and test wether they differ or not), or to compare the dis

Re: [R] Incomplete ouput with sink and split=TRUE

2008-02-06 Thread jiho
On 2008-February-06 , at 14:45 , Duncan Murdoch wrote: > On 2/5/2008 11:12 AM, jiho wrote: >> Dear List, >> I am trying to get R's terminal output to a file and to the >> terminal at the same time, so that I can walk through some tests >> and keep a log

Re: [R] Incomplete ouput with sink and split=TRUE

2008-02-06 Thread jiho
commands in a .R file and source it to execute it. In this case the transcript would only contain "source("whatever.R", print.eval=T)" which won't be very informative :/. And in the case of sourcing, the problem with disappearing text stays the same. Tha

Re: [R] How to search for packages

2008-02-05 Thread jiho
hands) would be to have reviews in a wiki form: review text editable + comments. - some tag reviews. they would essentially serve the purpose of Task Views but would probably be more dynamic (since the number of packages linked to a tag can change) and integrate with the rest. (Thanks for

[R] Incomplete ouput with sink and split=TRUE

2008-02-05 Thread jiho
37929 1.600 > Is this a known bug (I'm using R 2.6.1 on OS X and Linux - FC8)? Is there an inherent reason why some portions of this output are not redirected? Thank you in advance for your help. JiHO --- http://jo.irisson.free.fr/ __

Re: [R] how to suppress some tk dialogs

2008-02-05 Thread jiho
ure. > But I think the answer is in the help for options(), and more > obvious from ?chooseCRANmirror (which seems to be one of the > functions you are using). Indeed, the option to set is menu.graphics=FALSE Thank you very much! > On Tue, 5 Feb 2008, jiho wrote: > >>

[R] how to suppress some tk dialogs

2008-02-05 Thread jiho
). This may give you the reason behind this seemingly strange question. JiHO --- http://jo.irisson.free.fr/ __ 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

Re: [R] row-wise conditional update in dataframe

2008-01-22 Thread jiho
ta.frames directly. Is there such a modified apply in some package? [1] ?apply says "If X is not an array but has a dimension attribute, apply attempts to coerce it to an array via as.matrix if it is two-dimensional (e.g., data frames) or via as.array." JiHO --- http:/

[R] sorting in 'merge'

2008-01-21 Thread jiho
on (if someone knows it) for the current behaviour of merge? Thanks in advance. PS: code a = data.frame(field1=c(1,1,2,2),field2=c(1:2,1:2),var1=runif(4)) b = data.frame(field1=c(2,2,1,1),field2=c(1,2,2,1),var2=runif(4)) a b merge(b,a) merge(b,a,sort=F) b = rbind(b,b[1,]) b merge(b,a,sort=F) Ji

[R] Selecting rows conditionally between 2 data.frames

2008-01-18 Thread jiho
would welcome suggestions. Thank you in advance. JiHO --- http://jo.irisson.free.fr/ __ 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

Re: [R] things that are difficult/impossible to do in SAS or SPSS butsimple in R

2008-01-15 Thread jiho
ction (since its purpose is documentation) but overlaying two graphs is often as simple as adding them: p <- ggplot(mtcars, aes(x=wt, y=mpg)) + geom_point() g <- geom_path(aes(x=wt,y=mpg, colour=qsec)) p + g (this example is probably useless but it is only for demonstration pu

[R] ggplot2, coord_equal and aspect ratio

2008-01-10 Thread jiho
=c(0,1)) which has no effect. but the side effect of enforcing the square domain is that: ggplot(data=a, aes(x=x,y=y)) + geom_point() + coord_equal() + scale_y_continuous(limits=c(0,0.3)) has no effect either (i would expect to see only the points <0.3) JiHO --- http://jo.irisson.free

Re: [R] 4 dimensional graphics

2008-01-10 Thread jiho
9 93.5 4 4 17 140.2 4 1 1 90.3 4 1 9 36.5 4 1 17 55.1 7 4 1 169.1 7 4 9 718 7 4 17 813 7 1 1 73.4 7 1 9 46.5 7 1 17 205

Re: [R] Rscript on OSX

2008-01-09 Thread jiho
to you shell startup script (.profile, .bashrc whatever) so that the display variable is defined. You'll have to start X11 manually but once it is started, you should be able to run X11 apps directly from Terminal.app Hope that helps. JiHO --- http://jo

Re: [R] use ggplot in a function to which a column name is given

2007-12-13 Thread jiho
On 2007-December-13 , at 15:56 , hadley wickham wrote: > Hi Jiho, > > The key to solving this problem is to use aes_string instead of aes. > Instead of the complicated munging that aes does to get the names of > the variables, aes_string works directly with strings, so that: &

Re: [R] use ggplot in a function to which a column name is given

2007-12-13 Thread jiho
Follow up. On 2007-December-13 , at 10:45 , jiho wrote: > foo1 <- function(uv="u") > { > # solution 1: do not use the data argument at all > # (forces the use of qplot, could be more elegant) > B = A[A$y<=5,] > qplot(

[R] use ggplot in a function to which a column name is given

2007-12-13 Thread jiho
y<=5,],aes(x=x,y=y,fill=???)) + geom_tile() # or ... } print(foo1("u")) print(foo1("v")) print(foo2("u")) print(foo3("u")) # Any help in making foo3 work would be appreciated. Thanks in advance for your expertise. JiHO --- h

Re: [R] Problem with graphics device in Mac OS X

2007-12-10 Thread jiho
am I not a Mac OS > user and I did check the archives but found mostly discussions on > X11() under Mac OS X. > > Wayne > > __ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting gui

Re: [R] 2/3d interpolation from a regular grid to another regular grid

2007-12-05 Thread jiho
rinciple holds. Thanks very much. I'll test this soon (and it looks like the vector operation might even be directly translatable in Fortran which is nice since I'll need to do it in Fortran too). Thanks again. JiHO --- http://jo.irisson.free.fr/ __

Re: [R] 2/3d interpolation from a regular grid to another regular grid

2007-12-05 Thread jiho
self in a probably highly specialized and not reusable manner. Thank you very much for you answer and if someone knows a function doing what is described above, that would be terrific. JiHO --- http://jo.irisson.free.fr/ __ R-help@r-project.org m

[R] 2/3d interpolation from a regular grid to another regular grid

2007-12-04 Thread jiho
(but I am sure the solution to this is generic enough to work in nD) Thank you in advance. JiHO --- http://jo.irisson.free.fr/ __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-

Re: [R] pdf() device uses fonts to represent points - data alteration?

2007-11-01 Thread jiho
scape so it is fine on this side. The only "problem" with this workflow for me is that many of my plots stay between stage 1 and 2 and I like to be able to view them quickly. I would need a quick SVG viewer but there are none on OS X. If you are on Linux, many documents

Re: [R] pdf() device uses fonts to represent points - dataalteration?

2007-10-31 Thread jiho
draws real circles) so I would rather not tweak the rest to get the pdf right. Thanks anyway. JiHO --- http://jo.irisson.free.fr/ __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www

Re: [R] pdf() device uses fonts to represent points - data alteration?

2007-10-31 Thread jiho
Thank you very much for your answer, even so long after I first posted the message. On 2007-October-31 , at 12:00 , Paul Murrell wrote: > Hi > > jiho wrote: >> Hello all, >> I discovered that the pdf device uses fonts to represent "points" >> symbols (a

Re: [R] Linux editor for R+LaTeX, but not Emacs

2007-10-05 Thread jiho
linux replacement and ditch my half-bitten apple for a penguin. [1] http://jo.irisson.free.fr/?p=32 JiHO --- http://jo.irisson.free.fr/ __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guid

[R] pdf() device uses fonts to represent points - data alteration?

2007-10-04 Thread jiho
t.pdf","pdfwrite","test_embed.pdf") visualize the fonts: pdffonts test.pdf and a package with the two pdf files and bitmaps of how they render or are interpreted in various programs: http://jo.irisson.free.fr/

Re: [R] Version control and R package development (was: plot graph with error bars trouble)

2007-10-01 Thread jiho
On 2007-October-01 , at 23:13 , jiho wrote: > [...] > The end result looks like this: > http://cbetm.univ-perp.fr/irisson/svn/ > to see what an inner view looks like: > http://cbetm.univ-perp.fr/irisson/svn/distribution_data/tetiaroa/ > trunk/data/?rev=0&sc=1

[R] Version control and R package development (was: plot graph with error bars trouble)

2007-10-01 Thread jiho
First a quick summary of the beginning of an interesting discussion (not all indented correctly but in the correct order at least): > From: "Gabor Grothendieck" <[EMAIL PROTECTED]> > On 9/30/07, hadley wickham <[EMAIL PROTECTED]> wrote: >> On 9/30/

Re: [R] clipping viewports

2007-10-01 Thread jiho
27;x'height' is printed. The only relations between the paper argument and the device size arguments are: - when using the default size "special" - when the device size is > paper size, in which case the device is resized to fit on the paper sheet I would also like the

Re: [R] Plotting from different data sources on the same plot (with ggplot2)

2007-09-30 Thread jiho
ided that the 'arrow' argument is >> passed on to segmentsGrob which is used in geom_segment. > > In general, ... doesn't get passed on to the underlying grid function > because there isn't a one-to-one mapping from geoms to grobs (take > geom_boxplot for example

Re: [R] Plotting from different data sources on the same plot (with ggplot2)

2007-09-30 Thread jiho
This was meant to be sent on the list: On 2007-September-30 , at 23:12 , jiho wrote: > On 2007-September-30 , at 21:01 , hadley wickham wrote: >>>> [...] >>> As expected there is nothing in the data part of the p object >>>> p$data >>> NULL >>

Re: [R] plot graph with error bars trouble

2007-09-30 Thread jiho
ing small bugs is probably more efficiently done by a team than by a single person, with little free time. Furthermore, most of these things can be done without deep knowledge of the architecture of ggplot2. I probably won' t be able to make significant contributions before a whi

Re: [R] Plotting from different data sources on the same plot (with ggplot2)

2007-09-30 Thread jiho
rop=T) >> which would give p1 and p2 plots clipped to the xlim and ylim of p2. > > Yes, it would be nice to have some syntax to overrule the default > policy of showing all the data, although it gets a bit more > complicated when you consider other scales like colour and size. I

Re: [R] Graphics and LaTeX documents with the same font

2007-09-29 Thread jiho
On 2007-September-28 , at 18:25 , Frank E Harrell Jr wrote: > jiho wrote: >> On 2007-September-28 , at 16:57 , Frank E Harrell Jr wrote: >>> jiho wrote: >>>> On 2007-September-28 , at 15:18 , Paul Smith wrote: >>>>> On 9/28/07, Prof Brian Ripley <

Re: [R] Graphics and LaTeX documents with the same font

2007-09-28 Thread jiho
On 2007-September-28 , at 16:57 , Frank E Harrell Jr wrote: > jiho wrote: >> On 2007-September-28 , at 15:18 , Paul Smith wrote: >>> On 9/28/07, Prof Brian Ripley <[EMAIL PROTECTED]> wrote: >>>>> I know how to export graphics as pdf files and then how t

Re: [R] Graphics and LaTeX documents with the same font

2007-09-28 Thread jiho
on all my R graphics because I find it easier and quicker to get decent graphics and R and refine their look in Inkscape than to get them perfect in R in one shot ( though with ggplot2 things are improving on R's side). Cheers, JiHO --- http://jo.irisson.free.fr/ ___

[R] Plotting from different data sources on the same plot (with ggplot2)

2007-09-27 Thread jiho
produce the plot in several steps, otherwise it will soon become too complicated to manage. Thank you very much in advance for your help. JiHO --- http://jo.irisson.free.fr/ __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r

[R] ggplot and xlim/ylim

2007-09-20 Thread jiho
=wt, x=qsec)) + geom_point() + ??? Indeed the ggplot syntax is in general more flexible and powerful and I usually rely on it in scripts. It would be nice to know how to use xlim/ylim with this syntax. Thank you in advance. JiHO --- http://jo.irisson.f