0
I am working with a text taken from the Gutemberg project. It is a book. I need to mark the beginning of each chapter on a regular basis. In the current format, they are identified only with uppercase Roman numerals. For example:
I Introduction
II Trabalho
I needed him to turn into:
Chapter 2 - Work
Chapter 1 - Introduction
In total there are 160 chapters
I put together a list of Roman numbers from 1 to 160 to be replaced in the text by another list, which would read Chapter 1...Chapter n. But I could not find a role in the R that would help me to make such a replacement
Any tips on how to proceed?
grateful
What is the book? Not all books of the Gutenberg project have chapters numbered with Roman numerals.
– Rui Barradas
That’s why I made the list. It’s Dom Casmurro. I want to replace the regular expression so I can search the text Thanks @Ruibarradas!
– user135517
can you edit the question with a reproducible example? For me, it was not clear.
– Guilherme Parreira
It would be great if you edited the question to make it clear. Anyway, there are functions in the R, like the
roman2int
packagegtools
that convert Roman numerals to integers.– José
Hello I already made the edition! Thank you!
– user135517