FAQ: How to make your code look nice? Markdown Formatting


#1

Code Chunks

You type in community:

``` r
 #> A code chunk   
 library(foo)
```

You get:

    #> A code chunk   
    library(foo)
  • This is easier to read.
  • It also creates a clear chunk of code for others can copy and paste into their own R environment.

Inline Code

Type this:

I really wanted you to see `this_code_here`

See this:

I really wanted you to see this_code_here


Quote Snippets

If you highlight the content and click quote it will automatically populate the reply with the formatted code:

[quote="stephhazlitt, post:5, topic:6246, full:true"]
How do you insert a quote from the thread above (or elsewhere) that appears as a nicely formatted indented box in a reply?
[/quote]

You can also select text and click the quote button (highlighted below):

Using > also works:

This is a quote.

from ⇩

> This is a quote.

Hide/Show Folding Spoilers

Example text of what's shown - click to see what's hidden

Example spoiler text

[details = Example text of what's shown - click to see what's hidden]
Example spoiler text
[/details]

Pixelate Spoiler Hider

There is and images below that will be pixelated until you click on it.

[spoiler]
```
print("Joe Cheng is photogenic")

```
![image|256x250](upload://2ZcnTcOclyi2ErordryDHkhojWL.jpg)
[/spoiler]

Will appear as:

print("Joe Cheng is photogenic")



More Markdown Formatting Tips

For more markdown formatting options - including bold, italics, tables, etc. http://commonmark.org/help/
image



Add a Zoom on my plot
Error sourcing while creating Shiny app
How to upgrade a package when using packrat
How to Ignore one of the factors in a Column
Document term matrix in XGBoost classifier
Connecting To A SQL Server
Create Volcano Plot
How to save SAS data into RData format
Checking is.null in a case_when statement
Problem with source_python using pulp in Windows
Suddelny, base solve function does not work on RStudio
Error during deploy shiny app
Multi-column-type Summarise
Curl error 18 occurred
Error in file.choose() file choice cancelled
Ggplot troubleshoot: Error: Aesthetics must be either length 1 or the same as the data (24): x, y, fill
Problem in 'matplot' function
Displaying information on click in timevis.r
Help with function convert.inp in RMark
“edit” and “read.table” on R for Mac
Fatal Error when running Keras/Tensorflow with GPU
Graph with errobar using percentile function
Error in gzfile(path.expand(tarfile), "rb") : cannot open the connection In addition: Warning message: In gzfile(path.expand(tarfile), "rb") : cannot open compressed file 'NA', probable reason 'Permission denied'
Error Preventing Knitting
How to average/mean variables in R based on the level of another variable (and save this as a new variable)?
How to customise colours to specific things
Cannot export a raster image after using the random forest classification
ANOVA Results and Interaction Plot
Error: cannot find function trim
Show matched and unmatched results from vector in data table
Ggplot adding points in large dataset, looks terrible
Shiny app r Programming
Problem with Histogram
Using www folder: Save and display pdf
Track down error in R
Problems with loading ggplot2
FAQ: What's a reproducible example (`reprex`) and how do I do one?
Create plots using multpile dataframes
If/Else logic for fixing ZipCodes
How to give admininstrative rights while running R script from terminal in Linux?
Need help in shiny apps for disable shiny main apps window or disable the close button
Maptile fetched in RStudio Desktop but not RStudio Server
R : dynamic plot value and x axis value for line chart
#3

#4

#5

How do you insert a quote from the thread above (or elsewhere) that appears as a nicely formatted indented box in a reply?


#6

If you highlight the content and click quote it will automatically populate the reply with the formatted code:

[quote="stephhazlitt, post:5, topic:6246, full:true"]
How do you insert a quote from the thread above (or elsewhere) that appears as a nicely formatted indented box in a reply?
[/quote]

You can also select text and click the quote button (highlighted below):

Using > also works:

This is a quote.

from ⇩

> This is a quote.