[R] [bug] Follow up: paste doesn't...

Michaell Taylor pols1oh at bestweb.net
Thu Dec 6 14:48:21 CET 2001


Bingo.  The object did come from a stata dataset originally, though it was 
transformed a few ways since being read in.

Saving it as an R object and reloading fixed the problem.  There must be a 
glitch in the foreign library.

Thanks to Ott Toomet and Peter Dalgaard for the assistance.

Ott Toomet wrote:
> Hi,
>
> My knowledge about R is somewhat limited but I had a bit similar problem
> with paste a month or so ago (you can search the topic ,,bug and paste'' or
> something similar in the archive).
>
> That time the problem seemed to be that I had read my data in as stata-file
> using read.dta, and seemed that it was a kind of bug in that function.  The
> result was that the variables was stored into memory not correctly, an
> error which did not affect print() but did affect paste() (or have I
> misunderstood something?).  The problem vanished if I saved the data with
> save() and read it again with load().
>
> You did not explained how did you get your data but perhaps it helps.
>
> Sincerely,
>
> Ott Toomet
> ---------------------------------------------------
>
> On Wed, 5 Dec 2001, Michaell Taylor wrote:
> > Sorry to be posting another question, but my learning curve is starting
> > to flatten some now.
> >
> > What am I missing here?
> >
> > > temp _ name[reis==toupper(location[order(Vgrablow2)][N])]
> > > temp
> >
> > [1] "Lawton"
> >
> > > paste(temp,g)
> >
> > [1] "Lawton"                    # WHERE IS THE SECOND ELEMENT?
> >
> > > g
> >
> > [1] 0.29
> >
> > > a _ "Lawton"
> > > paste(a,g)
> >
> > [1] "Lawton 0.29"           # THIS WORKS (SECOND ELEMENT EXISTS ALSO)
> >
> > > mode(a)
> >
> > [1] "character"
> >
> > > mode(temp)
> >
> > [1] "character"  		# TEMP AND A ARE BOTH CHARACTERS
> >
> > >  paste(temp,g,sep="---")
> >
> > [1] "Lawton"		# DOESN'T EVEN GIVE THE SEPERATOR
> >
> > >  paste(a,g,sep="---")
> >
> > [1] "Lawton---0.29"
> >
> > extraneous info:
> > > mode(reis)
> >
> > [1] "character"
> >
> > > mode(location)
> >
> > [1] "character"
> >
> >
> > Michaell Taylor
> > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> >.-.-.- r-help mailing list -- Read
> > http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or
> > "[un]subscribe"
> > (in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
> > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> >._._._

-- 
=========================================
Michaell Taylor, PhD
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list