I created a small script to sort the data exactly the way I wanted for my school. I import a dataset from the school which contains students and their grades. I am then grouping by their first and last name so that I get a line of student data with their class names and grades. The summarize function worked perfection on the screen, and then I went to export this data and when I did using write_csv() it just exporting the un-sorted version of the file.
Here's my code:
cnames <- c("cid", "cname", "sid", "fname", "lname", "overall_percent", "overall_grade", "average_points", "weighted_score")
tdata <- read_csv("2020 - 2021 semester 1.csv", col_types = "dccccicii", col_names = cnames)
head(tdata)
fdata <- drop_na(tdata)
ndata <- fdata %>% group_by(fname, lname)
ndata %>%
summarize(Class_name = cname, GPA = overall_percent, Letter_grade = overall_grade)
ndf_data <- as_tibble(ndata) %>%
write_csv("TFLS data from R.csv")
I'm new to R, but love its ability to help me analyze this data, and it's so powerful and easy, but I just don't know why I can't export the sorted dplyr data. My next step will be to try and separate by the names and create reports of each individual student in the list with their grades on a single sheet of paper. Any ideas on packages that could easily handle this?
Thanks for any help with this.