Re: [R] TSclust multivariate time series clustering

2015-08-27 Thread cgenolin
You can also try kml3d. You can either use some default distances or define your own. http://www.jstatsoft.org/v65/i04/paper Christophe -- View this message in context: http://r.789695.n4.nabble.com/TSclust-multivariate-time-series-clustering-tp4711517p4711555.html Sent from the R help mailin

Re: [R] S4 / operator "[" : Compatibility issue between lme4 and kml

2015-06-06 Thread cgenolin
Thanks a lot for your time. Two questions: 1/ Shall I submit a bug report? 2/ In your point 2), I cannot find the verb... Is my english not good enough to understand it, or is it a "not-ended" sentence? :-) -- View this message in context: http://r.789695.n4.nabble.com/S4-operator-Compatibil

[R] S4 / operator "[" : Compatibility issue between lme4 and kml

2015-06-05 Thread cgenolin
Hi all, There is a compatibility issue between the package 'lme4' and my package 'kml'. I define the "[" operator. It works just fine in my package (1). If I try to use the lme4 package, then it does no longer work (2). Moreover, it has some kind of strange behavior (3). Do you know what is wrong?

Re: [R] is.na for S4 object

2015-06-05 Thread cgenolin
So easy! Thanks a lot. -- View this message in context: http://r.789695.n4.nabble.com/is-na-for-S4-object-tp4708201p4708234.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more

[R] is.na for S4 object

2015-06-04 Thread cgenolin
Hi the list, I have a variable y that is either NA or some S4 object. I would like to know in which case I am, but it seems taht is.na does not work with S4 object, I get a warnings: --- 8< setClass("myClass",slots=c(x="numeric")) if(runif(1)>0.5){a <- new("myClass")}else{a <- NA} is

[R] How to use character in C code?

2013-05-10 Thread cgenolin
Hi the list, I include some C code in a R function using .C. The argument is a character. I find how to acces to the characters one by one: --- 8< --- C void dealWithCharacter(char **chaine, int *size){ int i=0; for(i=0;i<*size;i++){ Rprintf("Le caractere %i est %c\n",i,chaine

Re: [R] Using as.integer(NA) in the .C function

2013-05-07 Thread cgenolin
Damm... I am reading the WRE, but I am only at page 83. I start to try to play with NAOK to early. Anyway, exactly the same function for numeric instead of integer will give different results: --- 8< C code --- void hein2(double *a, double *b, double* c){ *c = (*a + *b); } --

[R] Using as.integer(NA) in the .C function

2013-05-07 Thread cgenolin
Hi the list, I am including some C code in a R program using the .C interface. I want to deal with NA values, but the result is strange: --- 8< C code --- void hein(int *a, int *b, int* c){ *c = (*a + *b); } --- 8< --- --- 8< - R c

[R] Add axes to a 3D scene (afer makeTriangles)

2013-01-30 Thread cgenolin
Hi all, I am drawing some 3D surfaces using the Triangle tools (package misc3) and drawScene.rgl. Do you know if it is possible to add axes and graduation on the scene? Christophe -- View this message in context: http://r.789695.n4.nabble.com/Add-axes-to-a-3D-scene-afer-makeTriangles-tp465702

[R] Creating a "scene" with plot3d or point3d

2013-01-24 Thread cgenolin
Hi the list, As far as I understand, a possibility to create a "scene" is to provide a list of triangles to the function makeTriangles. Is there also a way to turn the data that are used by "plot3d" into a scene? I would like to write: --- 8< - M <- matrix(runif(12),4) plot3d(M) ### Some

[R] "shift" + "arrow" in getGraphicsEvent

2012-05-25 Thread cgenolin
Hi the list, Do you know if getGraphicsEvent can detect the use of keys combinaison like "shift+arrow" or "Crlt+arrow" ? Best Christophe -- View this message in context: http://r.789695.n4.nabble.com/shift-arrow-in-getGraphicsEvent-tp4631419.html Sent from the R help mailing list archive at Nab

Re: [R] 'deparse(substitute'))' then 'assign' in a S4 methods

2012-02-06 Thread cgenolin
Thanks Bill, In France, there is a famous joke about politician: "Tell me what you need, I will explain you how to do without"... But in my specific case, I can not use the classical <- and [, it is why I ask my question. More precisely, my fonction fooBis can be very long to end. So I want to up

[R] 'deparse(substitute'))' then 'assign' in a S4 methods

2012-02-04 Thread cgenolin
Hi the list, I am writing a function in which I need to affect a variable on a higher level. My fnction could be: ++ fooBis <- function(x){ nameObject <- deparse(substitute(x)) print(nameObject) assign(nameObject,4,envir=parent.frame()) } > fooBis(e) [1] "e" > e

Re: [R] R package dev: how to export constant?

2012-01-25 Thread cgenolin
Either in Data and say LazyData: yes It works, thanks a lot. Since the constant from above is probbaly only used within the NAMESPACE; No, I am write four package. The first is "all the tools" used by the three others. It includes the constants, so the others needs to "see" them.

Re: [R] R package dev: how to export constant?

2012-01-25 Thread cgenolin
Hi Jonas, hi the list > Try adding > LazyData: yes > to the DESCRIPTION file. I am a bit surprise by this answer since I found in writing R extentions, that lazydata is ignore since version 2.14. But I have the same problem, I do not manage to export contants. So how can I do that? My consta

[R] 'callNextMethod' in a '[<-' function does not work ?

2011-12-09 Thread cgenolin
Hi the list, I try to use callNextMethod in a setteur ([<-) but it does not work. Any raison ? Any other option ? --- 8< -- ### Class B0 ### setClass("B0" , representation(b0 = "numeric")) setReplaceMethod("[","B0",function(x,i,j,value){x@b0 <- -value}) a <- new("B0") a@b0 <- 3

Re: [R] S4 : defining [<- using inheritance from 2 classes

2011-11-21 Thread cgenolin
My working example is in the package kml3d. The class 'clusterLongData' is define by inehirance from class 'listClustering' and 'longitudinalData'. But as you say, it is unusual, I will try an other way. Thank you for your help. Christophe -- View this message in context: http://r.789695.n4.nab

[R] S4 : defining [<- using inheritance from 2 classes

2011-11-17 Thread cgenolin
Hi the list, I define a class 'C' that inherit from two classes 'A' and 'B'. 'A' and 'B' have no slot with similar names. setClass( Class="C", contains=c("A","B") ) To define the get operator '[' for class "C", I simply use the get of "A" or "B" (the constante 'SLOT_OF_A

Re: [R] Sweave: Changing the background color, adding a border

2011-08-09 Thread cgenolin
I am not familiar with wiki (wich one?) but here is the code without line-break --- 8< -- %\usepackage{Sweave} \RequirePackage[T1]{fontenc} \RequirePackage{graphicx,ae,fancyvrb} \IfFileExists{upquote.sty}{\RequirePackage{upquote}}{} \setkeys{Gin}{width=0.8\textwidth} %\De

Re: [R] Link to a pdf document

2010-07-01 Thread cgenolin
Hmmm. I guess I did something wrong since it does not work. The file r2lhOutput.pdf is in the folder \inst\doc\ In the Rd file (for example in rthb.Rd) I add "See \url{/library/r2lh/doc/r2lhOutput.pdf} for display detail." But the link leads to a dead link. I did not manage to find the file r2l

Re: [R] Link to a pdf document

2010-06-29 Thread cgenolin
Thanks > > > > On 29/06/2010 6:55 AM, cgenolin wrote: >> Thanks, Duncan. >> And where am I suppose to put the file toto.pdf ? >> In "/myPack/doc/" or in "myPack/inst/doc/" >> > > > The latter. When your package is in

Re: [R] Link to a pdf document

2010-06-29 Thread cgenolin
Thanks, Duncan. And where am I suppose to put the file toto.pdf ? In "/myPack/doc/" or in "myPack/inst/doc/" Christophe -- View this message in context: http://r.789695.n4.nabble.com/Link-to-a-pdf-document-tp2271973p2272016.html Sent from the R help mailing list archive at Nabble.com.

[R] Link to a pdf document

2010-06-29 Thread cgenolin
Hi the list, I would like to put a link in a .Rd file to a PDF document (not a vignette, just a regular PDF). I put my PDF in the folder inst/doc/toto.pdf. In the bible "2.5 Cross-references", I read that \link can point to PDF file, but I did not manage to do it. How shall I do that ? Christoph

[R] K-Centroids fuzzy Clusters Analysis ?

2010-06-23 Thread cgenolin
Hi the list, Using flextClust, we can cluster data using k-mean with some user-define distances. Is there something similar for fuzzy k-means ? Christophe __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do re

[R] using the name of an argument in a function

2010-05-25 Thread cgenolin
Hi all, In a function, I need to get the name of a variable that has been used to call the function. For example, I want: --- 8< -- toto <- 3 fun <- function(y){ nameOfY <-deparse(substitute(y)) cat("name is ",nameOfY) } fun(toto) # [1] name is toto --- 8< But deparse(substitut

Re: [R] Exporting an rgl graph

2010-04-29 Thread cgenolin
I need to use the function saveTriangleAsASY in my package. Does it allready exist in a package or may I unclude it ? Christophe -- View this message in context: http://r.789695.n4.nabble.com/Exporting-an-rgl-graph-tp1872712p2075086.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] Drawing a line with misc3d

2010-04-28 Thread cgenolin
Thanks. I did write a function cuboid, then 3dLine for joining two points, then 3dLines for more points. I do create an asy file with your function saveTrianglesAsASY, then I include the scene.pre in the LaTeX file. So far, everything works fine. My last problem is that I did not manage to get

Re: [R] Exporting an rgl graph

2010-04-15 Thread cgenolin
Thanks for you answer. Let me precise my question. In fact, I do not want to "capture" a screen, I want to save an object that can be seen in 3D. With rgl, using my mouse, I can make the object move. This is what I want to export: an real 3D object that my collaborator will have the possibilit

[R] Exporting an rgl graph

2010-04-15 Thread cgenolin
Hi the list, I use rgl to produce a 3D graph. I would like to "show" this graph to some collaborator. Is there a way to save it and send it to someone else? Christophe Genolini __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listi

[R] [R-pkgs] kml 0.9.2

2009-02-24 Thread cgenolin
KmL, version 0.9.2 KmL is a new implematation of k-means for longitudinal data (or trajectories). This algorithm is able to deal with missing value and provides an easy way to re roll the algorithm several times, varying the starting conditions and/or the number of clusters looked for. It als

[R] parameter "i" in "mfg" is out of range

2008-12-27 Thread cgenolin
Hi the list, and merry christmas ! I am using some screen tool (screen, split.screen, close.screen) and at some point, I get an error : parameter "i" in "mfg" is out of range What does in mean ? How can I correct it ? On the web, I find an old message from Giovanni that suggest to erase all

Re: [R] Gower distance between a individual and a population

2008-10-13 Thread cgenolin
If you used daisy, is there a problem with converting the resulting object to a full dissimilarity matrix and extracting the relevant row/column you need for the target site? Well, the lost of efficiantcy is huge. I need to compute the distance several time on data base that count 1000 or eve

[R] Gower distance between a individual and a population

2008-10-13 Thread cgenolin
Hi the list, I need to compute Gower distance between a specific individual and all the other individual. The function DAISY from package cluster compute all the pairwise dissimilarities of a population. If the population is N individuals, that is arround N^2 distances to compute. I need

Re: [R] S4 : setGeneric for classical methods

2008-07-28 Thread cgenolin
Martin Maechler <[EMAIL PROTECTED]> a écrit : "CG" == Christophe Genolini <[EMAIL PROTECTED]> on Sun, 27 Jul 2008 09:27:34 +0200 writes: CG> Martin Maechler <[EMAIL PROTECTED]> a écrit : >>> "CG" == Christophe Genolini <[EMAIL PROTECTED]> >>> on Sat, 26 Jul 2008 12:12:

Re: [R] S4 : setGeneric for classical methods

2008-07-27 Thread cgenolin
Martin Maechler <[EMAIL PROTECTED]> a écrit : "CG" == Christophe Genolini <[EMAIL PROTECTED]> on Sat, 26 Jul 2008 12:12:12 +0200 writes: CG> Martin Maechler <[EMAIL PROTECTED]> a écrit : >>> "CG" == Christophe Genolini <[EMAIL PROTECTED]> >>> on Tue, 22

Re: [R] S4 : setGeneric for classical methods

2008-07-26 Thread cgenolin
Martin Maechler <[EMAIL PROTECTED]> a écrit : "CG" == Christophe Genolini <[EMAIL PROTECTED]> on Tue, 22 Jul 2008 19:04:37 +0200 writes: CG> Prof Brian Ripley <[EMAIL PROTECTED]> a écrit : >> On Tue, 22 Jul 2008, [EMAIL PROTECTED] wrote: >> >>> Hi the list (well, half of th

Re: [R] S4 : setGeneric for classical methods

2008-07-22 Thread cgenolin
Prof Brian Ripley <[EMAIL PROTECTED]> a écrit : On Tue, 22 Jul 2008, [EMAIL PROTECTED] wrote: Hi the list (well, half of the list, only the one who are not on holidays...) I am trying to make an S4 package. When I run it on a console, everything seems ok. When I run R CMD check, I got an

[R] S4 : setGeneric for classical methods

2008-07-22 Thread cgenolin
Hi the list (well, half of the list, only the one who are not on holidays...) I am trying to make an S4 package. When I run it on a console, everything seems ok. When I run R CMD check, I got an error --- 8< -- Error in setMethod("plot", "ClassX", function(x, y) { : no exis

Re: [R] probleme with R CMD check

2008-07-18 Thread cgenolin
ta for non-ASCII characters ... OK CG> * creating packClassic-Ex.R ... OK CG> * checking examples ... ERROR CG> Running examples in 'packClassic-Ex.R' failed. CG> --- 8< --- c> I find the problem: the name of my base directory (the

Re: [R] NAMESPACE vs internal.Rd

2008-07-16 Thread cgenolin
Thanks for your answer. I guess writing a regular expression that says "export everything that does not start with a dot but do not export foo and bar" would be not trivial to write (at least not for me). The NAMESPACE created by package.skeleton contain a single line : exportPattern("^[[:alp

Re: [R] NAMESPACE vs internal.Rd

2008-07-16 Thread cgenolin
Thanks, Berwin, So the main idea is - With NAMESPACE, you do not document the "not-for-user" because they don't have to be documented - Witout NAMESPACE, you document the "not-for-user" with a toto-internal.Rd that say "not for user" That's clear. Is it stupid to consider to use both techniq

[R] NAMESPACE vs internal.Rd

2008-07-16 Thread cgenolin
Hi the list, When we use package.skeleton, it create some file in the man directorie. - If we use package.skeleton with namespace=FALSE, it create a file toto-internal.Rd - If we use package.skeleton with namespace=TRUE, it does not create the file toto-internal.Rd Why is that ? Christophe

Re: [R] R logo

2008-07-16 Thread cgenolin
The R Logo was done "manually" (using software) in several phases IIRC. Well, that's not a surprise. Let me rephrase my question : is the logo drawer still on this list ? Did you use gimp ? A specific filter ? or a scriptfu ? Christophe __ R-hel

Re: [R] package under unix

2008-06-16 Thread cgenolin
x11(xpos = 1) # makes one on the left x11(xpos = -1) # makes one on the right Thanks you very much, I'll try that. Is there any difference between x11 and X11? Christophe Patrick Connolly <[EMAIL PROTECTED]> a écrit : On Mon, 16-Jun-2008 at 09:43AM +0200, [EMAIL PROTECTED] wrote: I do

Re: [R] package under unix

2008-06-16 Thread cgenolin
Hi I entirely agree with Patrick, and would add 'why do you think a 5" square window is appropriate on both 8" and 30" monitors?'. I do not realy care about 5", 8" or 20", I use it when I devellop, I will remove it for the final package. I just want the two windows to not be one on the top of

[R] package under unix

2008-06-13 Thread cgenolin
Hi the list, I write a package for clusterizing longitudinal data using a non parametric algorithm. I develop the package under windows. To be as user friendly as possible, the package use some graphical procedure to "show" to the user the evolution of the cluster construction, and to export

Re: [R] probleme with R CMD check

2008-06-03 Thread cgenolin
I find the problem: the name of my base directory (the one that contain R, man and test) was not the same than the name of the package... I thaught this was allowed, I guess I was wrong. Christophe "c" == cgenolin <[EMAIL PROTECTED]> on Tue, 03 Jun 2008 09:55

Re: [R] probleme with R CMD check

2008-06-03 Thread cgenolin
x)userA(privateA(x)) privateC <- function(x).userB(.privateB(x)) userD<- function(x)userA(.userB(x)) privateD <- function(x)privateA(.privateB(x)) --- 8< "c" == cgenolin <[EMAIL PROTECTED]> on Tue, 03 Jun 2008 00:32:13 +0200 writes: c> Hi the list.

[R] probleme with R CMD check

2008-06-02 Thread cgenolin
Hi the list. I got a probleme with R CMD check. I run a package.skeleton on a very simple code (four toy function, no probleme with the R CMD build). But on the R CMD check packClassique, I get : * checking for unstated dependencies in R code ... WARNING Erreur dans .find.package(package, lib

[R] package.skeleton again

2008-05-31 Thread cgenolin
Hi the list I do not manage to build a package using package.skeleton. My pacakge in called 'partition' I have no probleme to source the file. Then I run package.skeleton("partition") I get : Saving function and data... Error in file(file,ifelse(append,"a","w")): impossible to open the conne

[R] problems with package.skeleton

2008-05-31 Thread cgenolin
Hi the list, I do not manage to build a package using package.skeleton. My pacakge in called 'partition' I run package.skeleton, then I write the Rd file. R CMD check partition is ok But R CMD build --binary partition does not compile. I get : WARNING * some HTML links may not be found in

[R] drawing lines in 3D (rotating them)

2008-05-20 Thread cgenolin
Hi the list, I write a short function to draw lines in 3D, showing then turning. At some point, I add "delais" to slow down the rotation. So two questions: 1) I try to find a library to draw animate lines in 3D but I did not find. That surprise me since it is very simple to do. Did I forget t

[R] adding an argument to ...

2008-05-05 Thread cgenolin
Hi the list Is it possible to add one argument to the arguments contain in ... ? I would like to do : f <- function(ttt,...)[ if(... does not contain the args uuu) [add uuu=3 to ...] else[] g(ttt,...) ] More precisely, my function g is a callNextMethod() Thanks Christophe

[R] getGraphicsEvent plotting two graph

2008-04-13 Thread cgenolin
Hi the list, I need to use getGraphicsEvent to plot two graph. On the following toy example: - the function b is ploting two graph depending on a parameter - the function a is calling b according to some user answers. It is suppose to call b until the user press Return, but it does not. b <- f

Re: [R] inheritence in S4

2008-03-27 Thread cgenolin
Sorry to come back on callNextMethod, I am still not very confident about it. Consideres the following (there is a lot of code, but very simple with almost only some cat) : -- setClass("A",representation(a="numeric")) setValidity("A",function(object){cat(" * Valid A *\n")

Re: [R] inheritence in S4

2008-03-24 Thread cgenolin
> The code example is incomplete, so I don't really know why one > version assigned y=3 for you and the other did not; for me, neither > version did the assignment. I probably add the return in the mail without imagining il will change things. My question was more on the use of ... versus the a

Re: [R] inheritence in S4

2008-03-24 Thread cgenolin
> callGeneric is an advanced topic. Ok, when I will be older :-) >> * >> This works : >> >> setMethod("initialize","B", >> function(.Object,..., yValue){ >> callNextMethod(.Object, ..., y=yValue) >> return(.Object) >> }) >> new("

Re: [R] inheritence in S4

2008-03-24 Thread cgenolin
Hi Martin I am re reading all the mail we exchange with new eyes because of all the thing I learn in the past few weeks. That very interesting and some new question occurs... *** Once, you speak about callGeneric : setClass("A", representation(x="numeric")) setC

Re: [R] alias for a class

2008-03-14 Thread cgenolin
> Not easily. Ok > So you could probably write a function that tracked down and copied > all the pieces, but it's not easy. b. Well, you're right, it's not worth it. So I will define a class ClusterizLongData then a constructor cld <- clusterizLongData <- function(){new("ClusterizLongData"

Re: [R] inheritence in S4

2008-03-05 Thread cgenolin
Well well well... To summarize : let assume that A is a class (slot x) and C is a class containing A (A and slot y) - as(c,"A") calls new("A"). So new("A") HAS TO works, you can not decide to forbid empty object (unless you define setAs("C","A") ?) - In addition, any test that you would like to

Re: [R] inheritence in S4

2008-03-04 Thread cgenolin
Hi Martin, thanks for your answer > But a couple > of other quick points. I would have written > > setMethod("initialize", "A", > function(.Object, ..., xValue=numeric(0)){ > callNextMethod(.Object, ..., x=xValue) > }) > I am not that much familiar with S3... In our

[R] inheritence in S4

2008-02-29 Thread cgenolin
Hi the list I define a class A (slot a and b), a class C (slot c and d) and a class E that inherit from A and B. I define print(A) and print(B). For print(C), I would like to use both of them, but I do not see how... Thanks for your help... Christophe -

[R] learning S4

2008-02-08 Thread cgenolin
Hi the list. I try to learn the S4 programming. I find the wiki and several doc. But I still have few questions... 1. To define 'representation', we can use two syntax : - representation=list(temps = 'numeric',traj = 'matrix') - representation(temps = 'numeric',traj = 'matrix') Is the

Re: [R] Integer vs numeric

2008-01-30 Thread cgenolin
Ok, I get your point. On the other hand, R is not only for high level programmer. On low level, the fact that ":" change the type is strange. Is it not possible to define two operator ? A "::" that will be use only for indexing and that will be integer (for efficiency) and a ":" that will be us

Re: [R] Integer vs numeric

2008-01-29 Thread cgenolin
Seems strange to me to define an operator relatively to a very special case. I have to admit that I do not use 1:1e7 every day :-) Wouldn't it be more appropriate to define a a:b operator numeric (that is preserving the initial class of a and b) and in specific case that need optimization, chang

[R] Within and Between matrix

2007-12-21 Thread cgenolin
Hi the list... I am working on cluster analysis, more precisely on Calinski and Harabasz criterion ( C(g)=Trace(between)/Trace(Within)*(n-g)/(g-1)) ) Is there a package for calculating within and between matrix? Morever, when we are using matrix with missing value, how do they handle it? On a mo

Re: [R] clean programming

2007-12-18 Thread cgenolin
Gabor Grothendieck <[EMAIL PROTECTED]> a écrit : > Its a FAQ Oups... Sorry for that. Just to close the topic : cleanProg <- function(name,tolerance){ if(length(findGlobals(get(name),FALSE)$variables) > tolerance){ cat("More than",tolerance,"global variable(s) in ",name,"\a\n") } } cleanProg

[R] clean programming

2007-12-16 Thread cgenolin
Hello the list, I am trying to write a "cleanProgramming" function to test the procedure I use. For example, I want to be sure that I am not using globals variables. The function "findGlobals" detect that. To list the globals used in function "fun", the syntax is : "findGlobals(fun,FALSE)$vari

Re: [R] Clean programming with R

2007-11-25 Thread cgenolin
>> library(codetools) >> findGlobals(power) Thanks for your answer. In addition, findGlobals(power,FALSE) gives the list of the globals variables alone : > findGlobals(power,F) $functions [1] "^" "{" "<-" "return" $variables [1] "pp" -