0

I'm using lapply() to do http requests for a bunch of id's. Lapply then returns the result as a list of a list of a list structure.

I then apply ldply() to get it into a data frame format. localisedDestinationNameDf <- ldply(localisedDestinationName, data.frame)

This API essentially translates destination names, thus it's encoded in UTF-8 as i need all the special characters for various languages.

Before i manipulate the dataframe with ldply, the characters look as they should, after applying ldply seems to remove the UTF-8 encoding.

 taxonomyDataDf <- ldply(taxonomyData, data.frame)

As an example in taxonomyDataDf we have the string "ピサ (州)", while in taxonomyDataDf the same value is converted into :

 <U+30D4><U+30B5> (<U+5DDE>) 

Can someone help me fix this please?

Tim496
  • 162
  • 3
  • 19
  • 1
    When asking for help, you should include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. But not that `ldply` is from the `plyr` package, not `dplyr`. They are different. – MrFlick Mar 07 '18 at 17:02
  • @MrFlick - my mistake. I've updated the description – Tim496 Mar 07 '18 at 17:22
  • Did you try printing just the column of the data.frame? Most of the time the default print method for data.frames will escape unicode characters but the column itself retains the encoding information. Again, it's very difficult to help without a proper reproducible example to see what's going on. – MrFlick Mar 07 '18 at 17:24

0 Answers0