Execution Halted in RMarkdown File

Please ask your questions about Quarto or R Markdown here.
I keep getting this message when I knit my Markdown file:

Quitting from Bellabeat-Capstone-Project.Rmd:57-67 [Importing data frames]
Execution halted

I have pasted the lines 57-67 below.

At first the Error message I got was: error: ! object 'dailyActivity_merged' not found Backtrace: ▆ 1. └─janitor::clean_names(dailyActivity_merged) Quitting from Bellabeat-Capstone-Project.Rmd:61-70 [Clean Names] Execution halted

Now execution is just halted

the 'path_to_file' insertion is from a previous user who faced a similar problem and he inserted 'path_to_file' which worked. I just don't know where he inserted it.
And I can't find the post

dailyActivity_merged <-path_to_file, read_csv('/cloud/project/mturkfitbit_export_4.12.16-5.12.16/Fitabase Data 4.12.16-5.12.16_dailyActivity_merged.csv)

dailyIntensities_merged <- path_to_file,  read_csv('/cloud/project/mturkfitbit_export_4.12.16-5.12.16/Fitabase Data 4.12.16-5.12.16_dailyIntensities_merged.csv)

dailySteps_merged <- path_to_file, read_csv('/cloud/project/mturkfitbit_export_4.12.16-5.12.16/Fitabase Data 4.12.16-5.12.16_dailySteps_merged.csv)

dailyCalories_merged <- path_to_file, read_csv('/cloud/project/mturkfitbit_export_4.12.16-5.12.16/Fitabase Data 4.12.16-5.12.16_dailyCalories_merged.csv)

sleepDay_merged <- path_to_file, read_csv('/cloud/project/mturkfitbit_export_4.12.16-5.12.16/Fitabase Data 4.12.16-5.12.16_sleepDay_merged.csv)

Hi, welcome to the forum.

It looks like you are missing that file dailyActivity_merged but there is not enough information that I, at least, can even make a guess why. That path_to_file looks suspicious and I think you have the syntax wrong.

It looks like you are trying to read in a .csv file and either the file does not exist or your path is incorrect.

What we need is a good bit of your actual Rmarkdown code. We don't need to see any of the actual text body. You can just throw in some random text as filler if you want between the code sections

What we need is the YAML (header information) and any R sections up to the R section where you are getting the error.

Copy the code and paste it here between

```

```

This should give us a nicely formatted output to work with.

Just for general information this may be helpfull though I am not sure it is directly applicable here https://forum.posit.co/t/faq-how-to-do-a-minimal-reproducible-example-reprex-for-beginners/23061

Thank you!

I have copied and pasted the YAML and all of the R code up to the point where I'm getting the error.

You're correct. The path_to_file is suspicious and I have the syntax all wrong.

I have also just run out of my compute hours so I'm unable to do a reprex.

Thank you once again,
Pula

| jrkrideau
July 23 |

  • | - |

Hi, welcome to the forum.

It looks like you are missing that file dailyActivity_merged but there is not enough information that I, at least, can even make a guess why. That path_to_file looks suspicious and I think you have the syntax wrong.

It looks like you are trying to read in a .csv file and either the file does not exist or your path is incorrect.

What we need is a good bit of your actual Rmarkdown code. We don't need to see any of the actual text body. You can just throw in some random text as filler if you want between the code sections

What we need is the YAML (header information) and any R sections up to the R section where you are getting the error.

Copy the code and paste it here between


title: "Bellabeat Capstone Project"
author: "Pula"
date: "2025-07-15"
output: html_document

knitr::opts_chunk$set(echo = TRUE)

Introduction to Bellabeat

Bellabeat is a tech-driven wellness company for women.

install.packages("tidyverse")
install.packages("here")
install.packages("skimr")
install.packages("janitor")
install.packages("dplyr")
install.packages("ggplot2")
install.packages("lubridate")
install.packages("readr")

library(tidyverse)
library(here)
library(skimr)
library(dplyr)
library(ggplot2)
library(lubridate)
library(readr)

Ah, thanks.
Yes, a little bit of a mess but nothing serious.

Problem 1 Do not install packages in an Rmarkdown document. Everything should be installed in the normal RStudio environment beforehand.

install.packages("tidyverse")
install.packages("here")
install.packages("skimr")
install.packages("janitor")
install.packages("dplyr")
install.packages("ggplot2")
install.packages("lubridate")
install.packages("readr")

library(tidyverse)
library(here)
library(skimr)
library(dplyr)
library(ggplot2)
library(lubridate)
library(readr)

Should be

library(tidyverse)
library(here)
library(skimr)
library(dplyr)
library(ggplot2)
library(lubridate)
library(readr)

Problem 2 You are missing the package {janitor} which gives you the function clean_names()

clean_names(dailyActivity_merged)

Style Issue: You do not need to load all those libraries The {tidyverse} package contains

library(dplyr)
library(ggplot2)
library(lubridate)
library(readr)

so including them all is redundant. This should be all you need

library(tidyverse)
library(here)
library(skimr)
library(janitor)
```.

This below should do what you want.  


title: "Bellabeat Capstone Project"
author: "Pula"
date: "2025-07-15"
output: html_document


```{r include =  FALSE}

library(tidyverse)
library(here)
library(skimr)
library(janitor)





```{r echo = FALSE}

dailyActivity_merged <-  read_csv('/cloud/project/mturkfitbit_export_4.12.16-5.12.16/Fitabase Data  4.12.16-5.12.16_dailyActivity_merged.csv') |> clean_names()

Notes

I dropped this simply because I don't like it. I find it is better to decide if you want to see the code or not in each R-section.

knitr::opts_chunk$set(echo = TRUE)

I prefer

{r echo = TRUE} or {r echo = FALSE} and so on in each section.

About the clean_names() function. I just chained it with the read_csv() function as it's tidier and saves a bit of typing.
Functionally

dat1 <- read_csv("eng.csv") |> clean_names()

is the same as

dat1 <- read_csv("eng.csv")
dat1 <- clean_names(dat1)

Forgot.
|> is cntl + shift + m if you want a shortcut.

Thank you!

I have to wait until my posit compute hours refresh on Aug 7th to try your suggestions out.

-Pula

Okay, good luck. If you have any questions just ask.