Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,26 @@ carpentry: 'incubator'
title: 'Building Better Research Software'

# Date the lesson was created (YYYY-MM-DD, this is empty by default)
created: 2023-10-03
created: 2025-09-30

# Comma-separated list of keywords for the lesson
keywords: 'research software, good practices, FAIR, reproducibility, sustainability, open, research, lesson, The Carpentries'

# Life cycle stage of the lesson
# possible values: pre-alpha, alpha, beta, stable
life_cycle: 'beta'
life_cycle: 'pre-alpha'

# License of the lesson
license: 'CC-BY 4.0'

# Link to the source repository for this lesson
source: 'https://github.com/carpentries-incubator/better-research-software'
source: 'https://github.com/carpentries-incubator/better-research-software-r'

# Default branch of your lesson
branch: 'main'

# Who to contact if there are any issues
contact: '[email protected]'
contact: '[email protected]'

# Navigation ------------------------------------------------
#
Expand Down
644 changes: 359 additions & 285 deletions episodes/03-reproducible-dev-environment.md

Large diffs are not rendered by default.

Binary file modified learners/spacewalks.zip
Binary file not shown.

Large diffs are not rendered by default.

72 changes: 72 additions & 0 deletions learners/spacewalks/astronaut-data-analysis-old/code.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#https://data.nasa.gov/Raw-Data/Extra-vehicular-Activity-EVA-US-and-Russia/9kcy-zwvn/about_data

csvfile = '/home/sarah/Projects/ssi-ukrn-fair-course/Extra-vehicular_Activity__EVA__-_US_and_Russia_20240126.csv'
jsonfile= 'file.json'
fieldnames = c("EVA #", "Country", "Crew ", "Vehicle", "Date", "Duration", "Purpose")

df <- read.csv(csvfile)


cat('', file = jsonfile)
for (count in 1:370){
line = df[count,]

#list
l = list()
for (thing in 1:(ncol(line[,1:7])))
#print(thing)
l[[fieldnames[[thing]]]] = line[[thing]]

library(jsonlite)
cat(toJSON(l), file = jsonfile, append = TRUE)
cat('\n', file = jsonfile, append = TRUE)
}


data=list()

for (line in readLines('file.json')){
data <- c(data, list(fromJSON(line)))
}

# this was needed at one point, not now I think
#data[[1]] <- NULL

time <- c()
date = character(0)

library(lubridate)
j=1
for (i in data){
print(data[[j]])
# and this bit
# w.writerow(data[j].values())
if (!is.na(data[[j]]$Duration)){
tt=data[[j]]$Duration
if(tt == ''){
#do nothing
}else{
t=as.POSIXlt(tt,format='%H:%M')
ttt <- as.numeric(as.difftime(hour(t), units = 'hours')+as.difftime(minute(t), units='mins')+as.difftime(second(t), units='secs'))/(60*60)
print(t,ttt)
time <- c(time, ttt)
date <- c(date, data[[j]][["Date"]])
}

}
j = j+1}

length(date)


t=0
for(i in time)
t <- c(t, t[length(t)]+i)

as.numeric(date)


to_plot <- t[2:length(t)]
names(to_plot) <- date

barplot(to_plot)
375 changes: 375 additions & 0 deletions learners/spacewalks/data.json

Large diffs are not rendered by default.

73 changes: 73 additions & 0 deletions learners/spacewalks/my code v2.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# https://data.nasa.gov/resource/eva.json (with modifications)
data_f_file = '/home/sarah/Projects/astronaut-analysis/data.json'
data_t_file = '/home/sarah/Projects/astronaut-analysis/data.csv'
g_file = 'myPlot.png'
fieldnames <- c("EVA #", "Country", "Crew ", "Vehicle", "Date", "Duration", "Purpose")

library(jsonlite)

j_l <- read_json(data_f_file)
data=as.data.frame(j_l[[1]])

for( i in 2:374){
r = j_l[[i]]
print(r)
data =merge(data, as.data.frame(r), all=TRUE)
}
#data.pop(0)
## Comment out this bit if you don't want the spreadsheet
write.csv(data_t_file)



time <- c()
date = Date()

library(lubridate)
j=1
for (i in rownames(data)){
print(data[j, ])
# and this bit
# w.writerow(data[j].values())
if (!is.na(data[j,]$duration)){
tt=data[j,]$duration
if(tt == ''){
#do nothing
}else{
t=as.POSIXlt(tt,format='%H:%M')
ttt <- as.numeric(as.difftime(hour(t), units = 'hours')+as.difftime(minute(t), units='mins')+as.difftime(second(t), units='secs'))/(60*60)
print(t,ttt)
time <- c(time, ttt)
if(!is.na(data[j,]$date)){
date= c(date, as.Date(substr(data[j,'date'], 1, 10), format = '%Y-%m-%d'))
#date.append(data[j]['date'][0:10])

}else{
time <- time[1:length(time) -1]
}
}
}
j = j+1
}

t=0
for(i in time)
t <- c(t, t[length(t)]+i)


df <- data.frame(
date, time
)[order(date, time), ]

date <- df$date
time <- df$time


png(g_file)
plot(date,t[2:length(t)],
xlab = 'Year', ylab= 'Total time spent in space to date (hours)'
)
dev.off()
plot(date,t[2:length(t)],
xlab = 'Year', ylab= 'Total time spent in space to date (hours)'
)
Loading