Posts

PACKAGE "ACCURACY"

     Introduction:    ✔  Diagnostic tests play a very crucial role in contemporary medical practice as it allows the medical practitioner to rule out the disease and diagnose disease in patients who have an illness.  Clinicians need insight into the possibility that an individual has a condition to arrive at therapeutic choices and give personalized treatment. This requires integrating knowledge of preliminary chance with diagnostic tests.   ✔ In order to decide on possibilities for therapy, medical diagnostics are frequently used for medical systems; moreover, numerous of these strategies need to be more accurate.  Documentation must be utilized to inform the use of evaluations for diagnosis in healthcare situations.  But regrettably, several clinicians conduct diagnostic tests without incorporating the supporting data.   ✔  Sensitivity and specificity are very crucial indicators for the accuracy of the diagnost...

R Markdown

Image
✔ R Markdown  is a file format for making dynamic documents with  R . An  R Markdown  document is written in  markdown  (an easy-to-write plain text format) and contains chunks of embedded  R  code.  Markdown  is a simple formatting syntax for authoring HTML, PRESENTATIONS, PDF, and MS Word documents. ✔ It has three types of content which include text, code chunks and  YAML metadata which build Rmarkdown.  ✔ YAML metadata consists of information about the title, author, date, and output. It starts and ends with three dashes (---) .  ✔ Code chunks can be run without interference from the text. Multiple code chunks of different programming languages like Python and SQL can also be included in the same document.  A single code can also be run and output can be viewed for the corresponding code in the R console. A code should start with  ```{r}  and ends with  ``` , so that code is isolated from text and...

'DEBUGGING' in R

Image
The code below contains a 'deliberate' bug that must be rectified. tukey_multiple <- function(x) {   outliers <- array(TRUE,dim=dim(x))   for (j in 1:ncol(x))   {     outliers[,j] <- outliers[,j] && tukey.outlier(x[,j])   }   outlier.vec <- vector(length=nrow(x))   for (i in 1:nrow(x))   { outlier.vec[i] <- all(outliers[i,]) } return(outlier.vec) } When the above code is implemented, it will result in the following error: Error: unexpected symbol in: " for (i in 1:nrow(x)) { outlier.vec[i] <- all(outliers[i,]) } return" The function 'traceback' prints the list of functions that were called before the error occurred. The function 'source', which reads and executes the code, can be used to find the exact location of the error, which will help to rectify the error. So, when the 'source' function is implemented, it gives the location of the error just before ' return' . > traceback("tukey_multipl...

Building 'PACKAGE' and 'DESCRIPTION' file in R

Image
Package in R is a structured, standardized unit consisting of 1. R code 2. Documentation 3. Data 4. External code Creating a package is initiated by generating a new blank project in R. Installing ' devtools ' and ' roxygen ' which help in creating packages and can be done by the following code: install.packages(“devtools”) install.packages(“roxygen2”) library(devtools) library(roxygen2) package.skeleton() It can also be installed directly by implementing code   devtools::install_github("hadley/devtools") It creates new files: Data, folder  DESCRIPTION, information file  Man, help folder R folder contains the . R files for functions  And “read-and-delete-me” file The Description consists of  fundamental information regarding the package in the following sequence: The important and required fields are ‘Package’, ‘Version’, ‘License’, ‘Description’, ‘Title’, ‘Author’, and ‘Maintainer’ and other fields are optional. Package: Veda Title: Fun...