[Rd] citation() chops "Roeland " (PR#7797)

Friedrich.Leisch at tuwien.ac.at Friedrich.Leisch at tuwien.ac.at
Mon Apr 18 11:30:12 CEST 2005


>>>>> On 18 Apr 2005 11:18:03 +0200,
>>>>> Peter Dalgaard (PD) wrote:

  > jari.oksanen at oulu.fi writes:
  >> Full_Name: Jari Oksanen
  >> Version: 2.0.1, 2.1.0 beta (2005-04-17)
  >> OS: Linux
  >> Submission from: (NULL) (130.231.102.145)
  >> 
  >> 
  >> If name ends with "and", such as "Roeland Lastname", citation() will chop "and"
  >> as a separate word giving "Roel and Lastname". This is the case in the upcoming
  >> release of vegan (1.6-8) just submitted to CRAN. Basically, this seems to happen
  >> in utils:::as.personList.default
  >> 
  >> > unlist(as.personList("Roeland Lastname"))
  >> name.first name.middle   name.last  name.first name.middle   name.last
  >> ""          ""      "Roel"          ""          ""  "Lastname"
  >> 
  >> and the culprit line seems to be:
  >> 
  >> x <- unlist(strsplit(x, "[[:space:]]?(,|and)[[:space:]]+"))
  >> 
  >> Fortunately, persons like Anders Andtfolk and Mandalay Grandjean are not
  >> chopped, because they don't have space after "and".

  > I'm sure it'll annoy Anders|George Sand, Bertrand Russell, Inge
  > Helland, et al., but it hardly counts as release-critical, nor trivial
  > enough to slip in during code freeze, especially as regular
  > expressions are involved (does one *ever* get them right on the first
  > try?)

Certainly not release critical ... especially as the conversion
doesn't claim to work in all cases and is there only for convenience:

	person("Roeland", "Lastname")

does the right thing, so one can write a correct CITATION file.

unlist(strsplit(x, "[[:space:]]?(,|[[:space:]]and)[[:space:]]+"))


should do the trick, I'll put it into the patched branch after
release.

.f



More information about the R-devel mailing list