Dear people, Yesterday I looked at the recode command in the memisc package and ran the following example stated in the manual: x <- as.item(sample(1:6,20,replace=TRUE), labels=c( a=1, b=2, c=3, d=4, e=5, f=6)) print(x) f <- as.factor(x) f recode(f, "A"=c("a","b"), "B"=c("c","d"),otherwise="copy" ) I also used this command for my dataset and it work - I didn't get an error message. Today I have tried several times running this example, also with my dataset, and always got the same error message (in German): Fehler in recode(f, A = c("a", "b"), B = c("c", "d"), otherwise = "copy") : unbenutzte(s) Argument(e) (A = c("a", "b"), B = c("c", "d"), otherwise "copy") (Error in recode ... unused argument(s) ...) I also couldn't find anything in the internet. I don't understand why this is not working anymore. Does anyone know what the problem is? Thank you very much for your help in advance! Marion [[alternative HTML version deleted]]
Hi Marion, the Hmisc package has also a function called "recode", maybe you loaded this package after memisc so the memisc version was masked (you should have got a warning message about that). Or perhaps you wrote you own recode function? Try find("recode",mode="function") to see all search list entries. You can access the desired function regardless of the place in the search path by memisc::recode(...) hth. Am 24.07.2012 13:53, schrieb Marion Wenty:> Dear people, > > Yesterday I looked at the recode command in the memisc package and ran the > following example stated in the manual: > > x <- as.item(sample(1:6,20,replace=TRUE), > labels=c( a=1, > b=2, > c=3, > d=4, > e=5, > f=6)) > > print(x) > f <- as.factor(x) > f > recode(f, > "A"=c("a","b"), > "B"=c("c","d"),otherwise="copy" > ) > > I also used this command for my dataset and it work - I didn't get an error > message. > > Today I have tried several times running this example, also with my > dataset, and always got the same error message (in German): > > Fehler in recode(f, A = c("a", "b"), B = c("c", "d"), otherwise = "copy") : > unbenutzte(s) Argument(e) (A = c("a", "b"), B = c("c", "d"), otherwise > "copy") > > (Error in recode ... > unused argument(s) ...) > > I also couldn't find anything in the internet. I don't understand why this > is not working anymore. Does anyone know what the problem is? > > Thank you very much for your help in advance! > > Marion > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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 provide commented, minimal, self-contained, reproducible code. >-- Eik Vettorazzi Institut f?r Medizinische Biometrie und Epidemiologie Universit?tsklinikum Hamburg-Eppendorf Martinistr. 52 20246 Hamburg T ++49/40/7410-58243 F ++49/40/7410-57790 -- Pflichtangaben gem?? Gesetz ?ber elektronische Handelsregister und Genossenschaftsregister sowie das Unternehmensregister (EHUG): Universit?tsklinikum Hamburg-Eppendorf; K?rperschaft des ?ffentlichen Rechts; Gerichtsstand: Hamburg Vorstandsmitglieder: Prof. Dr. Guido Sauter (Vertreter des Vorsitzenden), Dr. Alexander Kirstein, Joachim Pr?l?, Prof. Dr. Dr. Uwe Koch-Gromus
Thank you, John, for the clarification! :) I have written to the R core team pointing this out. Marion 2012/7/24 John Kane <jrkrideau@inbox.com>> > > -----Original Message----- > > From: marion.wenty@gmail.com > > Sent: Tue, 24 Jul 2012 15:48:10 +0200 > > To: e.vettorazzi@uke.de > > Subject: Re: [R] package memisc: recode examples > > > I now tried > > > > find("recode",mode="function") > > > > and got > > > > [1] "package:car" "package:memisc" - and got a warning > > message, which said: > > > > ## > > > > Lade nvtiges Paket: nnet > > > > Attache Paket: ?car? > > > > The following object(s) are masked from ?package:memisc?: > > > > recode > > > > ## > > > > I would have interpreted this warning the other way around, but this > > might be a language problem of mine > > So would I and I'm a native English speaker. I just think that some > stats/programmers see the world in a very different way than "real" people. > :) > > ____________________________________________________________ > FREE 3D EARTH SCREENSAVER - Watch the Earth right on your desktop! > Check it out at http://www.inbox.com/earth > > >[[alternative HTML version deleted]]
"The following object(s) are masked from 'package:A'" is equivalent to "The following object(s) from 'package:A' are masked" and perhaps that might be a more universally understood phrasing. I do find this better but I don't see any real need to change the status quo. It becomes fairly obvious after the first few imbroglios. On the other hand as they now teach passive sentence structure is harder to understand that postive, so perhaps: Objects x,yz in package A mask objects x,y z in package B? John Kane Kingston ON Canada> -----Original Message----- > From: ehlers at ucalgary.ca > Sent: Wed, 25 Jul 2012 12:57:33 -0700 > To: marion.wenty at gmail.com > Subject: Re: [R] package memisc: recode examples > > On 2012-07-25 09:29, Marion Wenty wrote: >> Thank you, John, for the clarification! :) >> >> I have written to the R core team pointing this out. >> >> Marion > > I hope that you included the wording of an improved message. > I believe that I speak English reasonably well and I disagree > with John on this. I think that the message is in fact unambiguous. > I don't know what the German message is, but perhaps it is not > unambiguous. Perhaps the translation of "from" to "von" is at > fault, since that is certainly not an unambiguous translation. > > If the intent were to say that the earlier-loaded package (here > 'memisc') is masking a function in the later-loaded package > (here 'car') then the message would say something like > "the following object(s) are masked _by_ package:memisc". I find > it easy to remember that the latest-loaded package is always the > one doing the masking. > > As it is now, when loading package A is followed by loading > package B, the message > "The following object(s) are masked from 'package:A'" > is equivalent to > "The following object(s) from 'package:A' are masked" > and perhaps that might be a more universally understood phrasing. > > Having said that there is, in my opinion, no need to alter the > status quo, I'll nevertheless make the following suggestion. > It may be not too difficult to rewrite the function producing > the messages to say something like: > "Package B is masking:" > "from package:A", function1, function2 > "from package:C", function3 > etc. > > But I confess that I have not looked at the code and hence > have no idea how much effort would be involved. I do feel > that R-Core has more important things to occupy them. > > Peter Ehlers > >> >> 2012/7/24 John Kane <jrkrideau at inbox.com> >> >>> >>>> -----Original Message----- >>>> From: marion.wenty at gmail.com >>>> Sent: Tue, 24 Jul 2012 15:48:10 +0200 >>>> To: e.vettorazzi at uke.de >>>> Subject: Re: [R] package memisc: recode examples >>> >>>> I now tried >>>> >>>> find("recode",mode="function") >>>> >>>> and got >>>> >>>> [1] "package:car" "package:memisc" - and got a warning >>>> message, which said: >>>> >>>> ## >>>> >>>> Lade nvtiges Paket: nnet >>>> >>>> Attache Paket: ?car? >>>> >>>> The following object(s) are masked from ?package:memisc?: >>>> >>>> recode >>>> >>>> ## >>>> >>>> I would have interpreted this warning the other way around, but this >>>> might be a language problem of mine >>> >>> So would I and I'm a native English speaker. I just think that some >>> stats/programmers see the world in a very different way than "real" >>> people. >>> :) >>> >>> ____________________________________________________________ >>> FREE 3D EARTH SCREENSAVER - Watch the Earth right on your desktop! >>> Check it out at http://www.inbox.com/earth >>> >>> >>> >> >> [[alternative HTML version deleted]] >> >> ______________________________________________ >> R-help at 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 provide commented, minimal, self-contained, reproducible code. >>____________________________________________________________ FREE ONLINE PHOTOSHARING - Share your photos online with your friends and family! Visit http://www.inbox.com/photosharing to find out more!