Help with creation file Rmarkdown

Hi Guys.

I am trying to create a PDF file, but when I create the PDF file, appears an error because it says that the object (that I called: proyecto), does not found.

error in table(proyecto$edad): objeto "proyecto" no encontrado Calls: ... withvisible -> eval_with_user-Handlers -> eval -> eval -> table ejecutacion interrumpida.

Rmarkdown documents are knitted into clean/empty environments; Therefore, in your Rmarkdown code, what code have you written that is responsible for providing poyecto ?

I haven´t run any code.

I don't know how to understand your statement ?
your rmarkdown file is empty ? containing no code ?

Es decir, inicié cargando un archivo en Excel (que llamé proyecto). Luego, ejecuté markdown.

Lo primero que puse fue lo siguiente:

absolutas <- table(proyecto$Nota)

y de una vez me apareció el error.

If your excel file isnt brought into your code in the rmarkdown, directly or indirectly, you wont be able to use it there.
If you used the Rstudio interface to write code to read it in for you. you could choose to copy that code into your rmarkdown document.

Ok! I did.

But now appears that:

dataset <- read_excel(NULL)
Error: path must be a string

no, I was just showing you were to look on the screen for the code that appears when you import, I was suggesting you copy the code the import provided you
On my computer I imported nothing, so the code in the screenshot I shared has no excel loaded.
read_excel needs a string path to where on your computer the excel file is.

Ah! Ok.

I did this:

dataset <- read_excel("proyecto.xlsx")

and It appears:

But, now, when I run knit function;

Still appears:

then you called it 'dataset' and not 'proyecto'
The arrow <- says to do the thing on the right and make the result be kept in the name on the left.
so, either rename dataset to proyecto or poyectro$Nota to dataset$Nota

1 Like

OMG!! Than you so much!! I spent three days trying to solve it.

I am starting in R.

I do appreciate your help.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.