Posts

R secure coding

Secure Programming is an important part of a software developers job and for my BMI reader I've updated and working on more secure programming paradigms or methods not limited to integrating packages like openssl and auditor. Meanwhile I've already included secure coding packages that R offers like testthat ().  gsub () is a secure programming tool in R that helps perform crucial data security and sanitization functions  w1 = 0; w2 = 0; w3 = 0; w4 = 0; w5 = 0; w6= 0; h=0; avgw = 0; SP = 0; DP = 0; PP=0; h = readline("Enter your height value: ");  w1 = readline("Enter first Weight value: "); w2 = readline("Enter second Weight value: "); w3 = readline("Enter third Weight value: "); w4 = readline("Enter fourth Weight value: "); w5 = readline("Enter fifth weight value: ");w6 = readline("Enter sixth Weight value: ");  w1 = as.numeric(w1); w2 = as.numeric(w2); w3 = as.numeric(w3); w4 = as.numeric(w4); w5 = as.numer...

Final Project-R Package

Image
Introduction  BMI/BP Calculator My biological father suffered a stroke 4 years ago , however, I am not here to lament on his medical condition but to provide a solution, to be more precise, a preventative measure for physical trainers ( which I believe play a important role in professional spheres) or any for that matter. This tool can help someone quickly figure out the next best course of actions regarding there medical health, and body weight, if there are any concerns to report. The calculator output the value of your cardiac output, which is the volumetric flow rate, Q . The optimum value is 40 L/m. Recording this value we can calculate Mean Arterial Pressure (MAP).  MAP is the product of cardiac output and total  peripheral vascular resistance . Importantly, both of these parameters are under the control of the arterial baroreflex and autonomic nervous system. Since cardiac output is the product of heart rate and stroke volume, changes in either of these parameter...

Visualization in R

Image
Basic Graph                                                                Romar Wallen For my module 8 visualization I chose the Dow Jones stock market file since I have very little knowledge of it and I'd like to see what the value are and how the values are affected by time. I used this command, DJFranses <- DJFranses[, -1], to remove the first and additional column. This will remove a third element that can issues when running the command for the 2-D graph. running the code below creates a basic visualization of the DJFranses stock market over the 15 year period. plot (DJFranses$time, DJFranses$value, cex = 3, pch = 20, main = "Dow index time series data", xlab="Time", ylab = "Stock Value") Lattice   after loading the library(lattice) into the interface I was able to pl...

R Mark down

Image
  R Mark down file was created by clicking the new R markdown file button . The result  of pressing Knit is discussed and explained. After pressing knit this was the result plot and table of values. When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this: ```{r cars} summary(cars) ``` ## Including Plots You can also embed plots, for example: ```{r pressure, echo=FALSE} plot(pressure) ``` Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot.

Mod 11 debugging

 Debugging this R program. Steps taken. running the program. The R programming environment output an Error message. The error as seen below.  Reformating the program using an editor that can really help readability and run time. To correct the error. reformatting of key words, Correct spacing and alignment of iterations statements, for loops, and output: return helped the program to compile smoothly without error > 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) } Error: unexpected symbol in: " for (i in 1:nrow(x)) { outlier.vec[i] <- all(outliers[i,]) } return" > tukey_multiple <- function(x) { + + > tukey_multiple <- function(x) + + { + + ou...

R package

 Package: fprojromarW Title: bmi calculator Version: 0.0.0.1 Authors@R:Romar Wallen Description: The bmi calculator will take 6 values of 1 mass and calculate average body mass index and plot a data table and graph License: `use_mit_license()` Encoding: UTF-8 Roxygen: list(markdown = TRUE) https://github.com/wallenr8/rw10-R/blob/dc89539a200e98b722cc1b55345a2d2f216442dc/mod10R

5 Doing Math

  A <- matrix(1:100, nrow=10) > B <- matrix(1:1000, nrow=10) > det(A) [1] 0 > det(B) Error in determinant.matrix(x, logarithm = TRUE, ...) : 'x' must be a square matrix Since the matrix has 1000 values with only 10 rows, that means there’s 100 columns. This forms a non-square matrix, which does not have a determinant. Because of this, there is no inverse for matrix B.