Hi Eik,

thank you very much for your reply! It now is working thank's your
explanations:

I didn't write my own recode function but I loaded the package car after
memisc.

I now tried

find("recode",mode="function")

and got

[1] "package:car"    "package:memisc"

as an output. So this means that the first mentioned package is the one
which is used by R. I also tried loading the packages again by closing R
and opending it again  - first memisc, afterwards car - and got a warning
message, which said:

##

Lade nötiges 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 ( I would think this means "recode wird vom
memisc package verdeckt" - I would interpret this as the memisc package
still being the package in use)

Another thing which by mistake I actually wrote a bit differently than it
is written in the memisc manual  is that I used = instead of <- when using
the recode function which caused the error message:

invalid recoding request

I suppose this means that it is not always possible to excange an <- for an
=, maybe only in the base version?

(the code in the manual is actually:
memisc::recode(f,
  "A"<-c("a","b"),
  "B"<-c("c","d"),otherwise="copy"
  )
)

Thank's very much again for your help!

Marion



2012/7/24 Eik Vettorazzi <E.Vettorazzi@uke.de>

> 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@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
>
>

	[[alternative HTML version deleted]]

