After doing some research on how to do this, I've come across a Stackflow post with this exact subject, the most up-voted answer seemed straight forward.
The logo Insert_my_logo_here.png is located inside the project folder and I get an error stating:
Line 10 Error in if (fileSize <= 0) {: missing value where TRUE/ FALSE needed Calls: < Anonymous >... < Anonymous > -> < Anonymous > -> tag < Anonymous > ->
Below is my header, the rest of my code works fine and I'm able to compile / knit to a html file. My logo is called LFC_logo.jpg and is located in the project folder.
The code file.path(R.home("doc"), "html", "logo.png") was used in the example because it will always point to the R logo that comes when you install R on your computer. To make it work for your case, you need to have the file path to the image within your project, which will be different.
Same error as before, even after adusting the file path to the projects. I also tried instead of getwd() , writing the full file path: "C:/Users/name/project_folder"
Line 10 Error in if (fileSize <= 0) {: missing value where TRUE/ FALSE needed Calls: < Anonymous >... < Anonymous > -> < Anonymous > -> tag < Anonymous > ->
The issue with the above is that the logo is huge and overlaying the rest of the report, is there a way to adjust the size for the above code?
I also found the alternative, but for the below I don't know how to adjust the position. The size of the logo is perfect but it is placed below the YAML header, I would like it to be at the top right corner "in" the YAML header...
The goal is to have the logo at the top right corner, the 400px size is fine, I just need to figure how to adjust the position of the image.
Do I need to use different codes if the output changes? I currently output the report as html, but be requested to hand it in in pdf, from what I've been reading online the answer is yes...?
Once again, thank you for your time and assistance!