[R] package memisc: recode examples
Eik Vettorazzi
E.Vettorazzi at uke.de
Tue Jul 24 14:18:05 CEST 2012
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
More information about the R-help
mailing list