0

I have been attempting to upload a file from tableau directly into my R Markdown knitted HTML document. I used the advised format:

---
title: "MLB More than a Hitter"
author: "T Sullivan"
date: "`r Sys.Date()`"
output:
  html_document: default
  
---
## Objectives for this study

The objective of this study was to analyze batting trend across Maor League Baseball.  

* Objective 1 
* Objective 2


![MLB Hits ratios]("C:\Users\Tom\Downloads\Case_Study1\XYZ_2016-2023_.png")
r2evans
  • 141,215
  • 6
  • 77
  • 149
  • 2
    I'm confused. Your question includes a full URL for an image, and you say when you use an image from google it shows correctly. When you say you "save it into my local drive", how exactly are you referencing it in your document? It would help immensely if you made this reproducible with a minimum reprex, perhaps a simple `.Rmd` document with a header, a sentence, and an image (using your local-path referencing), then describe the directory layout (i.e., where the image is in relation to the `.Rmd` file). – r2evans Aug 18 '23 at 16:14
  • Thank you for responding. I'm am new to the platform and learning daily. – Thomas Sullivan Aug 18 '23 at 18:16
  • Questions on SO (especially in R) do much better if they are reproducible and self-contained. By that I mean including attempted code (please be explicit about non-base packages), sample representative data (perhaps via `dput(head(x))` or building data programmatically (e.g., `data.frame(...)`), possibly stochastically), perhaps actual output (with verbatim errors/warnings) versus intended output. Refs: https://stackoverflow.com/q/5963269, [mcve], and https://stackoverflow.com/tags/r/info. – r2evans Aug 18 '23 at 18:17
  • This was the format I attempted, ![MLB Hits ratios("C:\Users\Tom\Downloads\Case_Study_downloaded_datasets\xyz_2016-2023_.png") – Thomas Sullivan Aug 18 '23 at 18:18
  • Don't use quotes around the path, realize that `![...](..)` is not R code, nor is it at all evaluated by the R parser or intepreter. It is markdown, straight and simple. – r2evans Aug 18 '23 at 18:38

0 Answers0