Posts

Final Project

 Greetings Professor, In this final project, I created a package named "myfinalproject" with different functions, documents and sub-documents by using simple and easy functions. These days, I am into music so, I created a "dataset" based on my music interest and used some functions to that dataset which I learned in my R Programming class. I used very simple functions in my package. ->As first step, I created a new package "myfinalproject" and did all my functions in sub-files created by using "use_r()" function. I created my sub-files called 'my_project.R', 'dataset_songs.R', 'simple_math.R'. Description of my package: Package: myfinalproject Type: Package Title: This package creates the functions of the numeric and charateric summary to the vector and created a dataset Version: 0.1.0.9000 Author: Jahnavi Maintainer: The package maintainer <jmandhadapu@usf.edu> Description: Using different functions to create a v...

Markdown(Assignment 12)

Image
 Greetings Professor, In this assignment #12, I learned how to create a Markdown file and how can I write my code in my created Markdown file by using HTML. I wrote the code by using dataset called "airquality" and I used different functions to that dataset. At first I created a Markdown Document titled "Bangtan" as an example file. And then I created a file, loaded a dataset and used different functions to that dataset. -> I used library() and datasets() to load my dataset: ```{r} library(datasets) data("airquality") summary("airquality") ``` -> I used head command to get the rows of the dataset: ```{r} head(airquality) ``` -> I used plot() to get the pairs of plots of the dataset: ```{r} pairs(airquality) ``` ->I used summary() to get the summary of the dataset: ```{r} summary(airquality) ``` The most interesting part and useful part in this markdown file was the automatic generation of the output given in the code block. Overall, I...

Debugging and Defensive Programming of R(Assignment 11)

Image
 Greetings Professor, In this assignment #11, I learned how to debug the code and to find the errors by using debugging function debug(). In this assignment, by using the given code I have to debug and fix the code in order to run the program. At first in the given code, by trying to run the code the function had trouble in compiling due to an unexpected error. The error is return() is written within in the same line as the for() loop created. By moving the return() function to the next line removed this error.  Next is to start the debugging process by using debug() function. In order to accomplish this, I created a matrix 'a' and using it as an input, I ran the program line by line until the next error popped. In this the function tukey.outlier() had not been defined to preventing the tukey_multiple() from running smoothly. As this module focuses on make code run, the tukey.outlier() was excluded in the repetition and tested the code. By doing this the tukey_multiple() was a...

Building your own R Package (Assignment 10)

 Greetings Professor, In this assignment #10, I learned how to create our own R package and creating a description file in R. To create a package I used the description: 1. Package name 2. Title 3. Version 4. Authors 5. Description 6. Depends 7. License 8. LazyData I created my own package by using these information in the word and posted in my GitHub Repository. The information I put in for the package is as follows: Package: Bantan Type: Package Title: Simple math calculation Version: 0.1.0 Author: Jahnavi Mandhadapu Maintainer: Jahnavi Mandhadapu <jmandhadapu@usf.edu> Description: This R package contains multiple functions to implement mathematical operations and statistical functions. Depends: R(>=3.1.2) License: CC0 Encoding: UTF-8 LazyData: true At first I installed the packages roxygen2 and devtools for building my package. I created my Package as 'Bantan' and it contains functions for math functions and calculations. The version I used 0.1.0...

Visualization in R(Assignment 9)

Image
 Greetings Professor, In this assignment#9, I learned about how visualize the data in R Programming by using three different ways like Basic Graphs, Lattice and ggplot2 from RStudio.  At first we have to download the dataset(USConsumption1950) from the web or internet and import the dataset into the RStudio by using import dataset. Then for the visualization of Basic Graphs I used plot() to the dataset.  > plot(USConsump1950) >plot(USConsump1950, main="My Scatterplot") And for the aesthetic and elegant visualization of dataset I use "lattice" method.  > library(lattice) >splom(USConsump1950[,c("income","expenditure")], col="blue",main="Scatter Plot Matrix of income and expenditure") >splom(USConsump1950[,c("income","expenditure")], col="red",main="Scatter Plot Matrix of income and expenditure") And for the creation of the graphical plots visualization of dataset I used ...

Input/Output, String Manipulation and plyr package(Assignment 8)

Image
 Greetings Professor, In this assignment #8, I learnt many ways to process data and also found about the file.choose() function as it allows us to select the file and analyze the data without required location. In this assignment, I have to read and analyze the given dataset. At first I installed the required packages and libraries by using the code: > install.packages("pryr") > require(pryr) >require(ISLR) >require(boot) >install.packages("plyr") >library(data.table) >library(plyr) And now to calculate the 'mean' for the category "Sex" I used the code: And then I given the dataset into R and to view the data by using code: > Assignment.6.Dataset.1 <- read.csv("C:/Users/chara/Downloads/Assignment 6 Dataset-1.txt") > View(Assignment.6.Dataset.1) And now to calculate the 'mean' for the category "Sex" I used the code:  > x = ddply(Assignment.6.Dataset.1, "Sex", transform, Grade.A...

R Object: S3 vs S4 (Assignment 7)

Image
Greetings Professor, In this assignment #7, I used the Object Oriented Systems S3 and S4 for completing this assignment. I created a new dataset by taking your example as an reference. And also answered the questions for the datasets S3 and S4. 1.S3 implements a generic function OO and it is different from many other programming languages like Java, C++, C, these implements message-passing  using OO. In the other programming languages, by calling methods to the objects and these objects determines which has to be called. This process is called "method call". But S3 is totally different by calling the methods via a special type of function called a 'generic function' and this decides which function has be to called. S4 and S3 works similarly by few differences. S4 have special functions to call or to define the generic functions and methods. And also it can pick methods based on number of arguments.  2. To determine the  base type(like integer or list) of an object ...