Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: lexical error: invalid char in json text. #1

Open
Tom1316 opened this issue Jun 24, 2021 · 0 comments
Open

Error: lexical error: invalid char in json text. #1

Tom1316 opened this issue Jun 24, 2021 · 0 comments

Comments

@Tom1316
Copy link

Tom1316 commented Jun 24, 2021

I'm following the script to tidy JSON Twitter data:

Load library

library(tidytweetjson)

You need to designate a directory path where you saved the list of JSON files.

dirpath <- tcltk::tk_choose.dir()

Parallel processing

n_cores <- availableCores() - 1

plan(multiprocess, # multicore, if supported, otherwise multisession
workers = n_cores) # the maximum number of workers

Assign the parsed result to the df_all object

df_all <- jsonl_to_df_all(dirpath)

However, this returns an error reference certain characters that I assume are emojis and other UTF code:

Error: lexical error: invalid char in json text.
ÿþ{
(right here) ------^
In addition: There were 50 or more warnings (use warnings() to see the first 50)

As I can't load the JSON to clean it, do you have any advice for what to do?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant