Learn R Programming

bfw (version 0.4.2)

TidyCode: Tidy Code

Description

Small function that clears up messy code

Usage

TidyCode(tidy.code, jags = TRUE)

Arguments

tidy.code

Messy code that needs cleaning

jags

logical, if TRUE run code as JAGS model, Default: TRUE

Value

(Somewhat) tidy code

Examples

Run this code
# NOT RUN {
messy <- "code <- function( x ) {
print (x ) }"
cat(messy)
code <- function( x ) {
print (x ) }
cat ( TidyCode(messy, jags = FALSE) )
code <- function(x) {
   print(x)
}
# }

Run the code above in your browser using DataLab