This is my first post using Markdown

This is my first post. I’m using Markdown to see if it will work properly.

Coding

How do I do code chunks?

x <- rnorm(1000)

Figures

What about figures that might be produced from code chunks? Can I use knitr with markdown to export a post that I can just upload into WordPress?

Advertisements

5 thoughts on “This is my first post using Markdown

  1. dankelleyns

    Any chance you could post a comment that contains the markdown code that created the post? That would help readers to emulate your method.

    Reply
  2. clarkrichards Post author

    Good idea! Here it is. Note that I’ve enabled Markdown recognition for comments, so I’ve wrapped the whole comment in code tags to make the Markdown display without formatting:

    This is my first post. I'm using [Markdown][1] to see if it will work properly.
    
    # Coding
    
    How do I do code chunks?
    
    ```R
    x &lt;- rnorm(1000)
    ```
    
    ## Figures
    
    What about figures that might be produced from code chunks? Can I use `knitr` with markdown to export a post that I can just upload into WordPress?
    
    [1]: http://daringfireball.net/projects/markdown/
    
    Reply
    1. clarkrichards Post author

      For some reason it keeps replacing the “right arrow” symbol with the HTML code in the above comment.

      Reply
  3. dankelleyns

    And you just insert that stuff, or do you have to run things through R first? (I ask because I tried it and got myself pretty mixed up and then just went back to doing it the brute-force way.)

    Reply
  4. clarkrichards Post author

    Depends on what you want to show. For the example in this post, I just composed Markdown right in the Post editor (using the “text” tab).

    For the other post [here](https://codedocean.wordpress.com/2014/01/14/using-rmarkdown-with-knitr-to-compose-wordpress-posts/), I wrote an `.Rmd` that I then ran through knitr on my machine, and then just pasted the `.md` source produced by knitr into the post editor. After pasting, I also had to upload the images that were produced and manually update the image links, but at least everything was already there so the “brute force” required was pretty minimal.

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s