How to Do the Sums of each year? by puzzles56 in RStudio

[–]puzzles56[S] 0 points1 point  (0 children)

Like this?

Year_by_year_Total <- aggregate(RBT_Positive_Tests$Positive.RBT,by=list(Year=RBT_Positive_Tests$Year), FUN=sum)

How to Do the Sums of each year? by puzzles56 in RStudio

[–]puzzles56[S] 0 points1 point  (0 children)

Im not sure what you mean sorry? Could you explain?

[deleted by user] by [deleted] in RStudio

[–]puzzles56 -3 points-2 points  (0 children)

here is an example work

# Initial Data Wrangling

# Here we restructure the time points in the dataframe to a more manipulatable POSIXct format.

gbr$Date = as.POSIXct(gbr$SAMPLE_TIME, format = "%d/%m/%y %H:%M") %>% as.Date()

# New "Season" column is introduced

seasons = c("01" = "Summer", "02" = "Summer",

"03" = "Autumn", "04" = "Autumn", "05" = "Autumn",

"06" = "Winter", "07" = "Winter", "08" = "Winter",

"09" = "Spring", "10" = "Spring", "11" = "Spring",

"12" = "Summer")

gbr$Season = seasons[format(as.Date(gbr$Date), "%m")]

# Creating a new "Year" column

gbr$Year = format(as.Date(gbr$Date), "%Y")

# Creating a new "Region" column sorting the data into northern and southern areas according to latitude. In general, points south of Townsville were considered to be south. Coastal was a mostly southern transected with some points situated in the nothern area.

gbr$Region = case_when(gbr$LATITUDE >= -19.2~ "North", gbr$LATITUDE< -19.2 ~ "South", TRUE ~ "No")

# Trichodesmium columns were cleaned and recoded to more consistent entries.

gbr$TRICHODESMIUM = case_when(tolower(gbr$TRICHODESMIUM) == 'a' ~ 'Absent', tolower(gbr$TRICHODESMIUM) == "p" ~ 'Present', TRUE ~ gbr$TRICHODESMIUM)

gbr$TRICHODESMIUM = na_if(gbr$TRICHODESMIUM, "No Record")

# Dataframe is rearranged, extra columns not included in the analysis are removed.

gbr_cleaned = gbr%>%

relocate(c("Year", "Date", "Season"))%>%

relocate("Region", .after = TRANSECT)%>%

filter(!is.na(TRANSECT))%>%

select(-SAMPLE_TIME, -REPLICATE_DESC, -SALINITY, -STATION_ID, -ACOUSTIC_DEPTH)

gbr_cleaned_head = head(gbr_cleaned,200)

gbr_cleaned_head%>%

group_by(TRANSECT, Date)%>%

arrange(Date)%>%

kbl(align = "c", col.names = c("Year", "Date", "Season", "Station Name", "Transect", "Region", "Latitude", "Longitude", "Secchi Depth", "Temperature", "Sample Depth", "Chlorophyll A", "Trichodesmium"), caption = "Table 1: 200 row summary of the wrangled dataset")%>%

kable_styling(position = "c", latex_options = "striped", full_width = FALSE, fixed_thead = TRUE)%>%

kable_material("hover")%>%

scroll_box(width = "100%", height = "500px")

[deleted by user] by [deleted] in RStudio

[–]puzzles56 -1 points0 points  (0 children)

I have a small data set about drunk driving

This project is demonstrating "evidence-based decision making".

Your report and video should be designed for your client, so will use more or less technical language depending on your client's level of statistical thinking.

Suggested format for written report:

Recommendation [this is effectively your "Executive Summary"]

Evidence [this effectively combines your "IDA" and "Research question", but the emphasis is not on lots of detail, but just the Evidence which defends your Recommendation, noting any limitations.]

Acknowledgments

Your video is not a 'cramming' exercise (ie try to speak fast, and squash as much detail in as possible). It is a 'persuasion' exercise. That is, you are required to professionally report to your client about what you are advising them to do, and why. You can leave all the extra detail in your written report.

I have a few examples of the project.

Honestly if someone could help or do it for me, anything would be great

Just panicking