1

I'm stuck, I think, trying to use R which I barely learned 5 years ago to read and parse a word document.

I'm looking at the following webpage: https://www.r-bloggers.com/2020/07/how-to-read-and-create-word-documents-in-r/

So I do the following and get no error:

install.packages("officer")
install.packages("dplyr")
library(officer)
library(dplyr)

I then try:

d <- read_docx("file.docx")

and it tells me it could not find the function "read_docx" I thought this function was defined in the library "officer" which it didn't have any problem installing and when I do a ls("packages:officer") I see the function "read_docx" is defined.

Any idea why it doesn't see the function and how I can fix it?

Phil
  • 7,287
  • 3
  • 36
  • 66
elbillaf
  • 1,952
  • 10
  • 37
  • 73
  • You may want to have a look at https://github.com/Azure/Microsoft365R to see if you can use that. – Jochem Mar 23 '23 at 20:22
  • 1
    Try explicitly calling the function, like `d <- officer::read_docx('file.docx')`. If that does not work, the package may not have installed properly. – Seth Mar 23 '23 at 20:26
  • Thank you, Seth! that's weird, but I'm sure there's a good reason for it. Lot to do, but I can't do anything if I can't read it in! – elbillaf Mar 23 '23 at 21:09

0 Answers0