kobekko94 / Yusuke-Flexdashboard-Practice

0 stars 0 forks source link

Datasets don't seem to be correctly specified #2

Open davclark opened 6 years ago

davclark commented 6 years ago

Quite simply, the dashboard doesn't run for me. Please ensure I have the latest version. If you are stuck, please leave maybe 15 minutes (or more!) at the end of a work session to document where you are and what your next steps are in this issue tracker.

For example, you could have made an issue with this very same title! It's also useful to include the error output, like so (include it as a "code block" - ask if that's not clear, but you can make something a code block with the "<>" button above):

Error in yaml::yaml.load(string, ...) : 
Scanner error: while scanning a simple key at line 7, column 5could not find expected ':' at line 8, column 5

Makes sense to me, the datasets are not well-specified YAML, here's the header - line 8 is the first line after dataset::

---
title: "Yusuke's First FD"
output: 
  flexdashboard::flex_dashboard:
    orientation: columns
    vertical_layout: fill
    dataset: 
    Bundesliga Transfer Sums
    Bundesliga Final Standings
    url: https://cran.r-project.org/web/packages/SportsAnalytics/SportsAnalytics.pdf
---
davclark commented 6 years ago

FYI - I know the answer to this one. If you're stuck, just ask.

davclark commented 6 years ago

This becomes valid YAML when you put a - before each of the datasets. This makes them elements in a list.

However, for now it is not clear that you need to do this in the header. It would help me help you if you provide a pointer. This is a decent overview of how you set up an RStudio YAML file. I can't find anything specific anywhere about a dataset argument, so I guess it was just a generic parameter in some script you were looking at.

In other words, you can probably just delete that from the YAML header. Same with the URL for the SportsAnalytics doc.

That said, looking at the PDF, those datasets are described there, and you are adding spaces. You can not add or remove characters - it changes the interpretation of what you're writing! Spaces in particular change text from a single token (e.g., a variable or name) to multiple words.

kobekko94 commented 6 years ago

Thanks, Dav. I simply thought it would be helpful to include some relevant information about the flexdashboard in the header (e.g. file name of the dataset being used and source of the dataset), but I guess that's not considered necessary.

davclark commented 6 years ago

That IS a good idea, it's just that the YAML header is where you tell RStudio about things, not yourself or another person. So, you could put that information in plain text in the body of the document, or you could put it in comments in your code (and these wouldn't show up in the final version of the rendered document / dashboard).

kobekko94 commented 6 years ago

For the past hour or so, I've been trying to make a time-spendings ggplot using "BundesligaTransferSums" in the package "SportsAnalytics", but I'm utterly lost hahaha. I know how to load files, but I have no clue how to do so with data in packages.

In either case, I want to make some kind of output so I'll just shift to data that's available from the "SZIV-deidentified" repository.