Error when I press knit in RMD although the chunks are run successfully

##setting up my environment
note: setting up my environment by installing 'ggplot2' and 'palmerpenguins'

library(ggplot2)

library(palmerpenguins)

data(penguins)

View(penguins)

##penguins data in plot
###presenting the relation between the body mass and flipper length

ggplot(data = penguins) +

  geom_point(mapping = aes(x = flipper_length_mm, y = body_mass_g))

I have to admit I don't see a problem but Ican not tell from the screenshot exactly where the error is occuring

Does

View(penguins)

work okay?

My version of your code seems to work well.

library(ggplot2)
library(palmerpenguins)
View(penguins)
ggplot(data = penguins) + 
     geom_point(mapping = aes(x = flipper_length_mm, y = body_mass_g))

You can't use View() in a knitted document, remove that command from your code.