Code Monkey home page Code Monkey logo

markdownreports's People

Contributors

vertesy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

markdownreports's Issues

NewReport() function

  • When you want a new report only, but everything the same. (currently you rerun the setup+... function)
  • (If you only want to change OutDir, simply set it)
  • Add an option to setup_MarkdownReports() when you don't want any report file (but set all other variables) sth like: setup_MarkdownReports(, title = NULL)

Some warnings at installation - Probably caused by Roxygen: unknown macro '\item' ; unexpected section header; unexpected END_OF_INPUT '

During startup - Warning messages:
1: Setting LC_CTYPE failed, using "C" 
2: Setting LC_TIME failed, using "C" 
3: Setting LC_MESSAGES failed, using "C" 
4: Setting LC_MONETARY failed, using "C" 
* installing *source* package 'MarkdownReports' ...
** R
** preparing package for lazy loading
** help
Warning: /Users/.../MarkdownReports/MarkdownReports/man/MarkDown_Table_writer_DF_RowColNames.Rd:17: unknown macro '\item'
Warning: /Users/.../MarkdownReports/MarkdownReports/man/MarkDown_Table_writer_DF_RowColNames.Rd:19: unexpected section header '\description'
Warning: /Users/.../MarkdownReports/MarkdownReports/man/MarkDown_Table_writer_DF_RowColNames.Rd:22: unexpected section header '\examples'
Warning: /Users/.../MarkdownReports/MarkdownReports/man/MarkDown_Table_writer_DF_RowColNames.Rd:26: unexpected END_OF_INPUT '
'
Warning: /Users/.../MarkdownReports/MarkdownReports/man/MarkDown_Table_writer_NamedVector.Rd:17: unknown macro '\item'
Warning: /Users/.../MarkdownReports/MarkdownReports/man/MarkDown_Table_writer_NamedVector.Rd:19: unexpected section header '\description'
Warning: /Users/.../MarkdownReports/MarkdownReports/man/MarkDown_Table_writer_NamedVector.Rd:22: unexpected section header '\examples'
Warning: /Users/.../MarkdownReports/MarkdownReports/man/MarkDown_Table_writer_NamedVector.Rd:26: unexpected END_OF_INPUT '
'
*** installing help indices
** building package indices
** testing if installed package can be loaded
During startup - Warning messages:
1: Setting LC_CTYPE failed, using "C" 
2: Setting LC_TIME failed, using "C" 
3: Setting LC_MESSAGES failed, using "C" 
4: Setting LC_MONETARY failed, using "C" 
* DONE (MarkdownReports)
Reloading installed MarkdownReports

Attaching package: 'MarkdownReports'

Note the modification date of the files read in (especially for metadata).

Add it to the read.simple.* functions


read.simple.* (..., ReportFileModification = F, ...)

if(ReportFileModification) {
       llogit(paste0("*" , paste(fname, file.info("Your_file")$mtime, sep="\t"), "*") )
}

Where to report?

  • At the end, in one table?
  • When the file is read in? -> I go for this, easier implementation.

Upgrade Wiki

  • Add install & usage site
  • Add Function Overview site

Add SUM column to MarkDown_Table_writer_NamedVector()

MarkDown_Table_writer_NamedVector()

  MarkDown_Table_writer_NamedVector( ..., AppendSUMcolumn =F)
  • SUM column

MarkDown_Table_writer_DF_RowColNames()

  MarkDown_Table_writer_DF_RowColNames ( ..., AppendSUMcolumn =F, AppendSUMrow =F)
  • SUM column
  • SUM row

Better way to set OutDir

Would be to use the scriptname without the extension by default

kollapse(ProjectDir, "/", gsub(x = scriptname, pattern = ".r$", replacement = "", ignore.case = T))

But where should ProjectDir come from?

Maybe:

if (exists(ProjectDir)) {
  OutDir = kollapse(ProjectDir, "/", gsub(x = scriptname, pattern = ".r$", replacement = "", ignore.case = T)) 
  any_print("OutDir is defined inside the ProjectDir: ", OutDir)
} else {
  OutDir = kollapse(getwd(), "/", gsub(x = scriptname, pattern = ".r$", replacement = "", ignore.case = T)) 
  any_print("OutDir is defined in your current working dir: ", OutDir)
}

More consise naming of functions and paramters

Functions

  • Consistent names for Internal Functions ww.functionname
  • Rename functions to md_ ...
    • only possible in v.3 for compatibility reasons

Function Parameters

  • scriptname instead of fname
  • xlab, ylab, col should be the same
    • only possible in v.3 for compatibility reasons

Background Variables

  • Consistent names for Background Variables: b.varname

Else

  • Explain in the wiki

rename functions to md_ ...

  • rename functions to md_ ...

md_table.. is shorter

  • explain in the wiki

!!! Will be incompatible with previous script versions !!!

Explain the GitHub workflow

  • link to a png file that needs to be uploaded to GitHub-wiki under Reports/Folder-of-the-report/

Once you are satisfied with the layout of your report:

  1. Revise your report once more to check if its understandable for others, axes labels, legends are correct, etc...
  2. Copy the .md and all .pdf files in the subfolder autogenerated with the time stamp trailing its name
  3. Convert all pdf files into .png (GitHub cannot display .pdf at the moment)
  4. Copy the folder to your GitHub-wiki folder under Reports/
  5. Remove the timestamp from the foldername
  6. Upload to / Sync your github.wiki-s own repository (it is separate from your code repo)

If Images are not displayed, probably the link to them is not correct.

Check the .md file if the links are correct. Should look similar to this

   ![](Reports/YOURANALYSIS/YOURPLOT.png)

wvenn() function

Seems that there is no ideal package


create_set_OutDir("/Users/abelvertesy/Downloads/VennDiagram")
setwd(OutDir)
getwd()

install.packages("VennDiagram")
require("VennDiagram")

aaa =  list(
    a = c(1:4),
    b = c(1:7),
    a = c(4:11)
)

venn.diagram(aaa, imagetype = "png", filename = kollapse(substitute(aaa), ".png"))

Add A4 as a possible default output size for plots

You should default it in setup_MarkdownReports() and use the here defined global variable in the other functions.

Use theses as a start:

pdfA4plot_on <- function (pname = date(), ..., w = 8.27, h = 11.69, rows = 4, cols = 3, title = paste0(basename(fname), " by ", scriptname)) { # Print (multiple) plots to an (A4) pdf.
  assign("mfrow_default", par("mfrow"), fname, envir = .GlobalEnv)
  fname = kollapse(OutDir,"/" , pname, ".pdf")
  pdf(fname,width=w, height=h, title = title)
  par(mfrow = c(rows, cols))
  any_print(" ----  Don't forget to call the pair of this function to finish the pdf: pdfA4plot_off ()")
}

pdfA4plot_off <- function () {
  if (exists("mfrow_default")) {
    x = mfrow_default
  } else { x =  c(1,1)}
  par(mfrow = x)
  try(dev.off()) # close pdf
  oo();
}

Function to store parameters in a list

Make a function p that stores parameters in a list param as well as assign it globally.

p(threshold = 50) 
param$threshold
> 50

... and then log_settings_MarkDown can be called empty

 log_settings_MarkDown()
  1. The function should check if
    • param exists
    • the name in param exists.

wbarplot(): cannot define ylim

Error in barplot.default(variable, ..., names.arg = xlb, main = main,  : 
  formal argument "ylim" matched by multiple actual arguments
Called from: barplot.default(variable, ..., names.arg = xlb, main = main, 
    sub = subtitle, col = col, las = 2, cex.names = cexNsize, 
    ylim = ylim)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.