I cannot convert my project to html format

I am an inexperienced user with R, in hopes of becoming proficient some day. I'm working on a project and lack adequate assistance from my professor. I'm sure some of you have been in my position once or twice- so hopefully you can relate. If i can provide any other information so i may receive the correct steps in order to accomplish my goal (project-> html).
Any help is greatly appreciated (#finals)
Screen Shot 2020-12-11 at 7.26.24 PM 2|690x388

The error message tells us that it can't find the file visitorsA2.csv, so my first question is, if this file is in the working directory of your project?

So for my class (Blackboard) where we can access assignments, she provides the scripts which is then downloaded and opened automatically in RStudio. May I ask how I could add it to my working directory?
Because it is already in my environment (the data set), I assumed it already was in my Directory and thought it may have been a package issue or I was missing one.

Exactly which files are provided through your class Blackboard?

When you are using R scripts you need to tell R where to look for files that you want to import. This can be done by using the command setwd("some-path") in the R console, replacing "some-path" with the path to your working directory. It can also be done, by navigating to the files pane in the lower right panel, finding the directory in which your .csv file is saved and pressing the "gear" button more -> Set As Working Directory.

Hope this helps :slight_smile:

ahh excuse my lack of specificity, "Blackboard" is the platform in which we are assigned homework and submit homework. Im in an, "Intro to Data Analytics" class.

I will try and mess around with it and ill let you know how it goes!
I appreciate your willingness to provide some direction there for me, Mr. Dernild.

Ahh that's funny we use a platform called Blackboard as well at my Uni :sweat_smile:

And no worries, if you have any more issues feel free to reach out to me :blush:

Do you use a Mac by any chance?

No, I'm running Ubuntu 20.04, why do you ask? :slight_smile:

I was just curious. Im using an Apple Mac. I know its not recommended but its what i have.
Also i have another question that you might know!
how do I make RStudio my main application instead of R. When i try opening my assignment it open the R console and I think that is my issue.

Mac should be fine as well, remember it is a Unix based system just like Linux though it's much more closed than Linux. I have seen professionals in the field working with both Windows, Mac and Linux, so really it should come down to your personal preference :slight_smile:

I'm not sure how to change standard applications on Mac, but you could probably find this on Google.

As the final line of your assignment states, when opening the .rmd you need the other files as well. What you should do is to download all the attached files and put them in a folder e.g., "~/knitr_tutorial". When opening the .rmd file set the working directory to this path.

To add to this the .RData file is a saved R environment in which the data already is loaded. What you want to do when working with R Markdown is to import this data anew. That is what this line in your .rmd file does:

visitorsA2 <- read.csv("visitorsA2.csv", header = TRUE)

It tries to find visitorsA2.csv in your specified working directory and if it isn't there, it returns an error.

Hope this helps :slight_smile:

2 Likes

My guy, I appreciate you!
Ich schätze Sie

Anytime :wink:

If you don't have more questions, please mark one of my answers as a solution. This way it's easier for other in the community to see which issues have been resolved and which still needs answers :slight_smile:

Happy coding :smiley:

1 Like

Blockquote
I am using Github Pages to save my html work; after creating a github account, you must create a repository,
and inside this repository it is recommended to have one "docs" folder. Put all your html files inside "docs" and take care to name the first file as "index.html", it is one requirement of github pages.
After, go to "settings" / "github pages" and assure you are pointing to the "docs" folder.
In a few minutes it will come one message inside Github Pages showing the link where the html is published; just clic on it or copy and paste the link into your browser.
Inside RStudio, In order to generate the html, I have used the command
bookdown::serve_book() (of course after assuring the "bookdown" packet installation.
Another option: before beginning to generate your html files, create one bookdown project and use
the commands build book/html (hope to have helped)

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.