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

Chapter 1 missing introduction on getting self-generated texts into R #75

Open
phish108 opened this issue Apr 14, 2020 · 2 comments
Open

Comments

@phish108
Copy link

Hi David and Julia

Thank you for this nice resource. This year I use it with students for the first time. I encountered one blind spot in chapter 1 on importing self-generated text data into R. I know this is trivial if you know how to think in code and R. For the book's audience this might not be a valid assumption. Therefore, I am missing a section on organizing and reading self-generated textdata into the working environment, in addition to working with Jane Austin's books and the Gutenberg Dataset.

I suggest to my students to organize their texts (e.g. from interviews) into separate text files in a sub-directory before loading them into R. So I would really like to find something around the following boilerplate in the book.

textDirectory <- "my_own_texts"

list.files(textDirectory, "\\.txt$") %>%
    tibble(textfile = . ) %>%
    mutate(textid = rownumber()) %>%
    group_by(textfile) %>%
    mutate(
        text = str_c(textDirectory, textfile, sep = "/") %>% read_file()
    ) %>%
    ungroup() -> text_df

I think that a brief section on this little topic would make a great addition to chapter 1. It would offer readers with beginner's knowledge of working with self-generated unstructured data in R a nice way to put the concepts into practice.

@juliasilge
Copy link
Collaborator

I wonder if we could find a set of files to demonstrate this that could also substitute for the no-longer-functional data problem in #62

@phish108
Copy link
Author

What about a copy of a few Gutenberg Project's books in a separate repo to keep them stable?

For example, 5682 - 5684 are sufficiently hard to read, so better analyse them.

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

2 participants