Posts

Showing posts from March, 2026

Assignment #10: Building Your Own R Package

Project CShel: Biological Optimization through Wardrobe VaShay Carpenter Purpose: A predictive engine for travelers to prevent metabolic inefficiency and heat/cold stress. It translates raw weather data into specific layering and fabric requirements (e.g., Merino base vs. Synthetic shell) to maintain peak cognitive functioning. Key Functions: layer_logic() : Recommends specific fabric combinations based on dew point and wind chill. metabolic_floor() : Calculates the "Danger Zone" for current attire vs. forecasted drops. DESCRIPTION Logic: Imports: ggplot2 (visualizing thermal bands), dplyr (data filtering). Version: 0.0.0.9000 (Dev). License: CC0 (No friction for travelers). Repo Link:  https://github.com/cryo-cell/r-programming-assignments/tree/main/CShell "Modern fashion uses branding as a proxy for status, but the CShell package reclaims the original biological intent of the exterior. By applying social Darwinist methodologies to smart-clothing data, we categ...

Assignment #9: Visualization in R – Base Graphics, Lattice, and ggplot2

Image
 VaShay Carpenter Objectives Compare three visualization systems in R: base graphics, lattice, and ggplot2. Apply each system to the same dataset and observe similarities and differences. Develop clear, reproducible code and articulate your insights. Dataset Choose one dataset from the  Rdatasets collection Links to an external site. . Load it in R with: data("DatasetName", package = "PackageName") head(DatasetName) Tasks Base R Graphics Create at least two plots using base R functions. Examples: # Scatter plot plot(DatasetName$x, DatasetName$y, main = "Base: x vs. y", xlab = "x", ylab = "y") # Histogram hist(DatasetName$z, main = "Base: Distribution of z", xlab = "z") Lattice Graphics Use the lattice package to produce conditioned or multivariate plots. Examples: library(lattice) # Conditional scatter plot (small multiples) xyplot(y ~ x | factor(group), data = DatasetName,...

Module # 8 Input/Output, string manipulation and plyr package

Image
VaShay Carpenter   Please following steps 1-3 Step # 1   Import assignment 6 Data-set to R   Download Import assignment 6 Data-set to R . Then, Run the commend "mean" using Sex as the category (use plyr package for this operation). Last commend in this step:  write the resulting output to a file. >  <- read.table("<FileName>.txt", header = TRUE) >install.packages("pryr") require(pryr) require(ISLR) require(boot) install.packages("plyr") library(data.table) library(plyr) etc #----Read file from computer via prompt Student-assignment-6 < - read.table("<FileName>.txt", header = TRUE) Student-assignment-6 StudentAverage = ddply(Student,"Sex",transform,Grade.Average=mean(Grade)) sex = Student$Sex mean(Sex) Original Dataset Student Averages Step # 2  Convert the data set  to a  dataframe for names whos' name contains the letter i, then create a new data set with those names, Write those names to a file se...

Module # 7 R Object: S3 vs. S4 assignment

Image
Module # 7 assignment VaShay Carpenter Download any type of data (from the web or use datasets package) or create your own set.  Then, on the second step, determine if generic function as discussed in this module can be assigned to your data set, and if not, why? (Example, here is list of data set in R) data("mtcars") head (mtcars, 6) list(mtcars, 6) In third and last step, explore if S3 and S4 can be assigned to your data set.   In your blog, discuss the following questions: How do you tell what OO system (S3 vs. S4) an object is associated with? Using  isS4(obj) . If  TRUE , It is S4. If  is.object(obj)  is  TRUE but  isS4 is  FALSE , it is S3. How do you determine the base type (like integer or list) of an object? You can determine the base type of an object in R using  typeof(x)  or  class(x) For detailed structure, including types of columns, use str(x). The is.type() family (e.g.is.integer()) checks for specific types. ...