prevent r-markdown from unfolding code/function
did you try this answer ?
I tried to reproduce your problem in my RStudio v1.2.5033 and it worked for me.
Tools > Global Options > R Markdown > Uncheck: Show output inline for all R Markdown Documents.
That should disable inline code chunk output when you're editing R Markdown documents.
Does that get you what you're asking?
How to show code but hide output in RMarkdown?
As @ J_F answered in the comments, using {r echo = T, results = 'hide'}
.
I wanted to expand on their answer - there are great resources you can access to determine all possible options for your chunk and output display - I keep a printed copy at my desk!
You can find them either on the RStudio Website under Cheatsheets (look for the R Markdown cheatsheet and R Markdown Reference Guide) or, in RStudio, navigate to the "Help" tab, choose "Cheatsheets", and look for the same documents there.
Finally to set default chunk options, you can run (in your first chunk) something like the following code if you want most chunks to have the same behavior:
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = T,
results = "hide")
```
Later, you can modify the behavior of individual chunks like this, which will replace the default value for just the results option.
```{r analysis, results="markup"}
# code here
```
Related Topics
Simplest Way to Get Rbind to Ignore Column Names
Calculate Cumulative Average (Mean)
Create Categorical Variable in R Based on Range
Specification of First and Last Tick Marks with Scale_X_Date
Longest Common Substring in R Finding Non-Contiguous Matches Between the Two Strings
Issue with Geom_Text When Using Position_Dodge
Meaning of Ddply Error: 'Names' Attribute [9] Must Be the Same Length as the Vector [1]
Define $ Right Parameter with a Variable in R
R Shiny: Reactivevalues VS Reactive
Using Lists Inside Data.Table Columns
How to Update R Packages in Default Library on Windows 7
Perform a Semi-Join with Data.Table
How to Round Up to the Nearest 10 (Or 100 or X)
List Distinct Values in a Vector in R
Gsub() in R Is Not Replacing '.' (Dot)
Function to Calculate Geospatial Distance Between Two Points (Lat,Long) Using R