caichinger
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    --- title: APGCB23PDB-QA tags: APGCB23PDB --- # Questions & Answers You are invited to use this document to ask questions. We will address them during the workshops. Prologue: * There are no stupid questions. * The more specific the question, the more specific the answer (usually). * This is a living document. * Please use the template below. Ideas: * Why is ... the case? * How would you approach ...? * How to do ... in R/Python/*? * How does ... work in R/Python/*? **Please take a look at https://stackoverflow.com/help/how-to-ask** **If you do not find your question here, it may already have been integrated into the course notes.** --- ## [ ] Copy-paste and insert your question here. You can provide more details below. Try to be as specific as possible. See also https://stackoverflow.com/help/how-to-ask. **Name (optional):** ... **Question:** ... **Discussion:** ... **Answer:** ... --- **Name (optional): David Böhm **Question:** Ich verwende RStudio mit Rmarkdown, um den Bericht zu erstellen. Wie kann ich im Bericht Variablen etc. einbauen, die ich in meinem RStudio Environment berechnet habe, z.B. den Maximalwert einer Zeitreihe etc.? Wie kann ich Tabellen einfügen, die ich zuvor über das RSkript erstellt hab? **Discussion:** ... **Answer:** ... Claus R Markdown ist eine Möglichkeit [Literate Programming](https://en.wikipedia.org/wiki/Literate_programming) umzusetzen. Die zentrale Idee dabei ist, dass (ich zitiere hier den R Markdown Slogan) > R Markdown documents are fully reproducible. > Use a productive notebook interface to weave together narrative text > and code to produce elegantly formatted output. Das heißt insbesondere, dass der Code den DU ausführen möchtest, IM Notebook (Rmd-File) steht (bzw. stehen muss). Die enge Verschränkung von Code (=Weg) und Ergebnis (=Ziel) und Diskussion ist in einem Dokument ist in meinen Augen der große Mehrwert. Falls du also Code interaktiv in der Console tippst, dann wandert der einfach in's Dokument. R Markdown IST (wird;) dein RSkript. Der Unterschied ist lediglich die verwendete Auszeichnungssprache. Bei R Markdown ist alles standardmäßig Markdown, es sei denn, du markierst eine Stelle als Code (R, Python, SQL, ...). Im RSkript ist alles standardmäßig R. Die Code Blöcke im R Markdown kannst du weitehrin interkativ ausführen. Mein Vorschlag: 1. Erstelle ein R Markdown 1. Spiele damit ein bisschen herum 1. Passe das Dokument schrittweise an unser Projekt an Ich finde die [Doku](https://rmarkdown.rstudio.com/lesson-1.html) ganz gut. Hilft dir das? Antwort David: Vielen Dank, die Antwort hilft. Zusatzinfo: man mit dem Befehl "source" auch aus anderen R-Skripten Code-Teile ausführen. --- **Name (optional): Teresa** :heart: :cherry_blossom: **Question:** Woran könnte es liegen, dass sich in RStudio keine (erforderlichen) Packages in ein Environment installieren lassen? Auch ein Forcen der Download-Methode innerhalb von renv mit *Sys.setenv(RENV_DOWNLOAD_METHOD = getOption("download.file.method"))* hilft nicht. Die Installation läuft nur mit *utils::install.packages("packagename")* durch, allerdings wird das Package dann irgendwo hininstalliert und nicht ins Environment. (Komischerweise taucht der Packageordner aber im von renv erstellten "renv-Ordner" auf, aber nicht im Lockfile :broken_heart:) **Discussion:** ... **Answer:** :mag_right: Claus Ich fürchte ich verstehe die Frage nicht ganz. Was tust du genau, wenn es nicht funktioniert und was für eine Meldung erhältst du dann? Wenn du im RStudio GUI ein Package installierst, wird letzten Endes der Befehl `install.packages("packagename")` aufgerufen. D.h. es spricht nichts dagegen, direkt über die R Konsole `install.packages("packagename")` auszuführen. Wenn du im RStudio per GUI ein Package installierst, dann hast du im Kontextmenü den Punkt "Install to Library:", hier sollte das renv Environment stehen. Was steht da bei dir? (renv Environment natürlich nur, wenn auch initialisiert...) Im [Lockfile steht das Package erst, wenn es auch verwendet wird](https://rstudio.github.io/renv/articles/faq.html). Grundsätzlich: * Es gibt einen Ordner, da liegt Zeug drinnen, unter anderem dein Environment. Das ist per se nichts besonderes. * ABER: Wenn du in diesem Ordner arbeitest und der Ordner dein Projekt ist, dann macht es Sinn, auch das Working Directory von RStudio dort hin zu legen. Ich kann mir vorstellen, dass (nicht nur aber auch) beim Ausprobieren Pfade durcheinander gekommen sind. Um auf Nummer sicher zu gehen, empfehle ich, mit RStudio ein neues Projekt anzulegen, dort gleich beim Erstellen des Projekts im Kontextmenü "renv" anzuhaken und dann neu zu probieren. Was passiert dann? Grundsätzlich: Siehe auch * `getwd()` * `setwd()` Danke, ist für mich verständlich und erledigt :) --- **Name (optional): Veronica** :hatching_chick: :tulip: **Question:** Wie kann ich kontrollieren, wo renv das lock File hinspeichert? **Discussion:** Ich habe mehrmals *renv::init* und *renv::snapshot* probiert und es wurde manchmal außerhalb meides wd gespeichert. :confused: **Answer:** ... Claus Kann es sein, dass beim Ausprobieren Pfade durcheinander gekommen sind? Grundsätzlich braucht es um renv zu verwenden ja nur eine R Session. Die kann überall (=irgendein Ordner) stattfinden. Wenn man die Befehle ausführt, werden sie dann relativ zur aktuellen Position interpretiert, da kann also schon was schief gehen. Wie oben: Um auf Nummer sicher zu gehen, empfehle ich, mit RStudio ein neues Projekt anzulegen, dort gleich beim Erstellen des Projekts im Kontextmenü "renv" anzuhaken und dann neu zu probieren. Ist das Verhalten dann konsistent? Siehe auch [diese Diskussion](https://github.com/rstudio/renv/issues/472). --- **Name: Claus** **Question:** Wie kann ich den Bericht "per Knopfdruck" erzeugen? **Discussion:** Es soll einen Befehl, ein Kommando geben, um den Bericht zu erstellen - ohne Umweg über ein GUI wie R Studio. **Answer:** ... Teilantwort von Claus mit Einladung zur Ergänzung ;) Angenommen wir bauen den Bericht mit R Markdown: * Wir könnten ein Batch Skript schreiben * Wir brauchen `rmarkdown` und `render()` * Die renv-Umgebung ist Projekt-lokal, ebenso wie unser unser R Markdown Bericht, d.h. wir könnten davon ausgehen, dass wir `render()` von dort aus aufrufen Siehe auch [renv Doku zum Thema `activate`](https://rstudio.github.io/renv/reference/activate.html). Also, wie machen wir das? **Name: David** **Question:** Wie kann ich Daten oder Informationen von einem *.R- an ein *.rmd-File übergeben? **Discussion:** Mein Ansatz wäre, im *R-File in einer Schleife über alle Input-Dateien die Grafiken zu erzeugen und dann RMarkdown aufzurufen. Aber wie bekomm ich die Info in das *.rmd-File rüber, welche Grafiken in den jeweiligen Bericht einzufügen sind? Wenn ich die Grafiken direkt im *.rmd-File erzeuge, wie bekomm ich die aktuell zu verarbeitenden Input-Daten in das *.rmd-File? **Answer:** ...

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully