« first day (1929 days earlier)      last day (1368 days later) » 

8:50 AM
> unique(x$col1)
[1] "Polish Academy of Sciences - Institute of Nature Conservation, Poland"
> unique(x$col1) == "Polish Academy of Sciences - Institute of Nature Conservation, Poland"
[1] FALSE
And how is your Sunday morning going? :)
> charToRaw(cp)
 [1] 50 6f 6c 69 73 68 20 41 63 61 64 65 6d 79 20 6f 66 20 53 63 69 65 6e 63 65 73 20 2d 20 49 6e 73 74 69 74 75 74 65 20 6f 66 20 4e 61 74 75 72 65 20 43 6f 6e 73 65 72 76 61 74
[59] 69 6f 6e 2c 20 50 6f 6c 61 6e 64
> charToRaw(unique(x$col1))
 [1] 50 6f 6c 69 73 68 20 41 63 61 64 65 6d 79 20 6f 66 20 53 63 69 65 6e 63 65 73 c2 a0 2d 20 49 6e 73 74 69 74 75 74 65 20 6f 66 20 4e 61 74 75 72 65 20 43 6f 6e 73 65 72 76 61
[59] 74 69 6f 6e 2c 20 50 6f 6c 61 6e 64
x is from a database where cp is a copy/paste of that string.
 
9:06 AM
@RomanLuštrik try str(unique(x$col1))
maybe it's not a character
maybe it's some illusive print method
 
@DavidArenburg Nope, prints just fine. It would seem - is encoded differently on my system compared to what it's written in the database.
Note that on my system (cp), the dash is written as 2d, but the database has c2 a0 in its place. Everything else appears to be identical.
 
ok, that make sense
 
I'm pretty sure that if I were to check this on the byte level I would see a difference in those bits.
 
9:36 AM
20 2d 20 = space hyphen space
c2 a0 2d 20 = non-break space hyphen space
So R is somehow converting that non-break space in to regular space
 
 
1 hour later…
10:44 AM
One possible solution with non-breaking spaces: blog.tonytsai.name/blog/…
 

« first day (1929 days earlier)      last day (1368 days later) »