install.packages("tidyverse")
plot(1:10)
# Create data
data <- data.frame(
name=c("A","B","C","D","E") ,
value=c(3,12,5,18,45)
)
# Barplot
ggplot(data, aes(x=name, y=value)) +
geom_bar(stat = "identity", width=0.2)
ggplot(mpg, aes(displ, hwy, colour = class)) +
geom_point()
library(ggplot2)
ggplot(mpg, aes(displ, hwy, colour = class)) +
geom_point()
read.csv?
asdf
help("read.csv")
read.csv("Data/friends.csv")
set.seed(123)
set.seed?
?set.seed
help("set.seed")
x <- rnorm(10000, mean = 0, sd = 1)
x_gof <- gof_fit(x, "norm", "chisq")
#time after memoryization (s)
t = c(1,3,6,9,12,18)
#proportion (out of 100) of correct recall
y = c(.94,.77,.40,.26,.24,.16)
#number of observed correct recalls (out of 100)
obs = y * 100
plot(y)
install.packages("tidyverse")
install.packages("mlbench")
library(mlbench)
data("PimaIndiansDiabetes", package = "mlbench")
View(PimaIndiansDiabetes)
View(PimaIndiansDiabetes)
require(tidyverse)
data()
view(starwars)
detach("package:mlbench", unload = TRUE)
detach("package:purrr", unload = TRUE)
detach("package:readr", unload = TRUE)
detach("package:stringr", unload = TRUE)
detach("package:tibble", unload = TRUE)
detach("package:tidyr", unload = TRUE)
tidyverse_update()
install.packages(c("broom", "ggplot2", "jsonlite", "pillar", "purrr", "ragg",
"rlang"))
library(tidyverse)
data()
BOD
?BOD
BOD
show(BOD)
show(BOD)
ggplot(data = BOD,
mapping = aes(x = Time,
y = demand))
geom_point()
ggplot(data = BOD,
mapping = aes(x = Time,
y = demand))+
geom_point()
geom_point(size = 5)
geom_point(size = 5)
ggplot(data = BOD,
mapping = aes(x = Time,
y = demand))+
geom_point(size = 100)
ggplot(data = BOD,
mapping = aes(x = Time,
y = demand))+
geom_point(size = 5)
ggplot(data = BOD,
mapping = aes(x = Time,
y = demand))+
geom_point(size = 5)+
geom_abline()
ggplot(data = BOD,
mapping = aes(x = Time,
y = demand))+
geom_point(size = 5)+
geom_line(colour = "red")
###
ggplot(BOD, aes(Time, demand))
ggplot(BOD, aes(Time, demand))+
geom_point(size = 3)+
geom_line(colour = "red")
###
CO2
View(CO2)
?CO2
names(CO2)
names(CO2)
CO2 %>% #cntrl shift M
ggplot(aes(conc, uptake,
colour = Treatment))+
geom_point()
CO2 %>% #cntrl shift M
ggplot(aes(conc, uptake,
))+
geom_point(colour = Treatment)
ggplot(aes(conc, uptake,
colour = Treatment))+
geom_point()
ggplot(aes(conc, uptake,
colour = Treatment))+
geom_point()
CO2 %>% #cntrl shift M
ggplot(aes(conc, uptake,
colour = Treatment))+
geom_point()
CO2 %>% #cntrl shift M
ggplot(aes(conc, uptake,
colour = Treatment))+
geom_point(size = 3, alpha = 0.5)+
geom_smooth()
CO2 %>% #cntrl shift M
ggplot(aes(conc, uptake,
colour = Treatment))+
geom_point(size = 3, alpha = 0.5)+
geom_smooth(method = lm, se = F)
facet_wrap()
facet_wrap(~Type)
CO2 %>% #cntrl shift M
ggplot(aes(conc, uptake,
colour = Treatment))+
geom_point(size = 3, alpha = 0.5)+
geom_smooth(method = lm, se = F)
facet_wrap(~Type)
CO2 %>% #cntrl shift M
ggplot(aes(conc, uptake,
colour = Treatment))+
geom_point(size = 3, alpha = 0.5)+
geom_smooth(method = lm, se = F)+
facet_wrap(~Type)
CO2 %>% #cntrl shift M
ggplot(aes(conc, uptake,
colour = Treatment))+
geom_point(size = 3, alpha = 0.5)+
geom_smooth(method = lm, se = F)+
facet_wrap(~Type)+
labs(Title = "Concentration of C02")+
theme_bw()
CO2 %>%
ggplot(aes(Treatment, update))+
geom_boxplot()
View(CO2)
CO2 %>%
ggplot(aes(Treatment, uptake))+
geom_boxplot()
CO2 %>%
ggplot(aes(Treatment, uptake))+
geom_boxplot()+
geom_point()
CO2 %>%
ggplot(aes(Treatment, uptake))+
geom_boxplot()+
geom_point(aes(size = conc,
colour = Plant))
CO2 %>%
ggplot(aes(Treatment, uptake, size = conc,
colour = Plant))+
geom_boxplot()+
#  geom_point(aes(size = conc,
colour = Plant))
CO2 %>%
ggplot(aes(Treatment, uptake, size = conc,
colour = Plant))+
geom_boxplot()+
#  geom_point(aes(size = conc,
#                 colour = Plant))
CO2 %>%
ggplot(aes(Treatment, uptake, size = conc,
colour = Plant))+
geom_boxplot()
CO2 %>%
ggplot(aes(Treatment, uptake))+
geom_boxplot()
geom_point(aes(size = conc,
colour = Plant))
CO2 %>%
ggplot(aes(Treatment, uptake))+
geom_boxplot()+
geom_point(aes(size = conc,
colour = Plant))
CO2 %>%
ggplot(aes(Treatment, uptake))+
geom_boxplot()+
geom_point(alpha = 0.5,
aes(size = conc,
colour = Plant))
CO2 %>%
ggplot(aes(Treatment, uptake))+
geom_boxplot()+
geom_point(alpha = 0.5,
aes(size = conc,
colour = Plant))
coord_flip()
coord_flip()+
theme_bw()
CO2 %>% #cntrl shift M
ggplot(aes(conc, uptake,
colour = Treatment))+
geom_point(size = 3, alpha = 0.5)+
geom_smooth(method = lm, se = F)+
facet_wrap(~Type)+
labs(Title = "Concentration of C02")+
theme_bw()
CO2 %>%
ggplot(aes(Treatment, uptake))+
geom_boxplot()+
geom_point(alpha = 0.5,
aes(size = conc,
colour = Plant))
coord_flip()+
theme_bw()
CO2 %>%
ggplot(aes(Treatment, uptake))+
geom_boxplot()+
geom_point(alpha = 0.5,
aes(size = conc,
colour = Plant))+
facet(~Type)+
coord_flip()+
theme_bw()
CO2 %>%
ggplot(aes(Treatment, uptake))+
geom_boxplot()+
geom_point(alpha = 0.5,
aes(size = conc,
colour = Plant))+
facet_wrap(~Type)+
coord_flip()+
theme_bw()
mpg
view(mpg)
mpg %>%
ggplot(aes(displ, cty))+
geom_point()
mpg %>%
ggplot(aes(displ, cty))+
geom_point(colour = drv,
size = trans))
mpg %>%
ggplot(aes(displ, cty))+
geom_point(aes(colour = drv,
size = trans))
mpg %>%
ggplot(aes(displ, cty))+
geom_point(aes(colour = drv,
size = trans),
alpha = 0.5)
size = trans, alpha = 0.5)
mpg %>%
ggplot(aes(displ, cty))+
geom_point(aes(colour = drv,
size = trans, alpha = 0.5))
mpg %>%
ggplot(aes(displ, cty))+
geom_point(aes(colour = drv,
size = trans),
alpha = 0.5)
mpg %>%
ggplot(aes(displ, cty))+
geom_point(aes(colour = drv,
size = trans),
alpha = 0.5)+
geom_smooth(method = lm)
mpg %>%
ggplot(aes(displ, cty))+
geom_point(aes(colour = drv,
size = trans),
alpha = 0.5)+
geom_smooth(method = lm)+
facet_wrap(~year, nrow = 1)
mpg %>%
ggplot(aes(displ, cty))+
geom_point(aes(colour = drv,
size = trans),
alpha = 0.5)+
geom_smooth(method = lm)+
facet_wrap(~year)
mpg %>%
ggplot(aes(displ, cty))+
geom_point(aes(colour = drv,
size = trans),
alpha = 0.5)+
geom_smooth(method = lm)+
facet_wrap(~year, nrow = 1)
mpg %>%
filter(cty < 25) %>%
ggplot(aes(displ, cty))+
geom_point(aes(colour = drv,
size = trans),
alpha = 0.5)+
geom_smooth(method = lm)+
facet_wrap(~year, nrow = 1)
> library(limma)
library(readxl)
control <- read_excel("C:/Users/gcagn/Desktop/dates/2025May/KateMcKeever/TPP-Paper2/TPPScript-Paper2/TPP-Paper2-Analysis03/fuzzytest/control/control.xlsx")
View(control)
## control (no crowding agents) data from Crowding TPP experiment
data(control)
## fuzzy k-means with entropy regularization and noise cluster, fixing the number of clusters
clust=FKM.ent.noise(control,k = 18, RS=5,delta=3)
install.packages("fclust")
load(fclust)
library(fclust)
setwd("C:/Users/gcagn/Desktop/dates/2025May/KateMcKeever/TPP-Paper2/TPPScript-Paper2/TPP-Paper2-Analysis03/fuzzytest/control")
## control (no crowding agents) data from Crowding TPP experiment
data(control)
## fuzzy k-means with entropy regularization and noise cluster, fixing the number of clusters
clust=FKM.ent.noise(control,k = 18, RS=5,delta=3)
## fuzzy k-means with entropy regularization and noise cluster, selecting the number of clusters
clust=FKM.ent.noise(butterfly,RS=5,delta=3)
library(fclust)
## control (no crowding agents) data from Crowding TPP experiment
data(control)
## fuzzy k-means with entropy regularization and noise cluster, fixing the number of clusters
clust=FKM.ent.noise(control,k = 18, RS=5,delta=3)
## fuzzy k-means with entropy regularization and noise cluster, selecting the number of clusters
clust=FKM.ent.noise(control,RS=5,delta=3)
library(fclust)
## control (no crowding agents) data from Crowding TPP experiment
data(control)
## fuzzy k-means with entropy regularization and noise cluster, fixing the number of clusters
clust=FKM.ent.noise(control,k = 18, RS=5,delta=3)
## fuzzy k-means with entropy regularization and noise cluster, selecting the number of clusters
clust=FKM.ent.noise(control,RS=5,delta=3)
View(control)
## control (no crowding agents) data from Crowding TPP experiment
load(control)
library(fclust)
## control (no crowding agents) data from Crowding TPP experiment
load(control)
## control (no crowding agents) data from Crowding TPP experiment
# Load the fclust package
library(fclust)
# Load the control dataset
data(control)
# Perform fuzzy k-means with entropy regularization and noise cluster, fixing the number of clusters
clust_fixed <- FKM.ent.noise(control, k = 18, RS = 5, delta = 3)
# Perform fuzzy k-means with entropy regularization and noise cluster, selecting the number of clusters
clust_selected <- FKM.ent.noise(control, RS = 5, delta = 3)
# Print the results
print(clust_fixed)
print(clust_selected)
## control (no crowding agents) data from Crowding TPP experiment
# Load the fclust package
library(fclust)
# Load the control dataset
data(control)
# Perform fuzzy k-means with entropy regularization and noise cluster, fixing the number of clusters
clust_fixed <- FKM.ent.noise(control, k = 18, RS = 5, delta = 3)
# Perform fuzzy k-means with entropy regularization and noise cluster, selecting the number of clusters
clust_selected <- FKM.ent.noise(control, RS = 5, delta = 3)
# Print the results
print(clust_fixed)
print(clust_selected)
write.table(clust_fixed, file = “clust_fixed.txt”, sep = “”)
## control (no crowding agents) data from Crowding TPP experiment
# Load the fclust package
library(fclust)
# Load the control dataset
data(control)
# Perform fuzzy k-means with entropy regularization and noise cluster, fixing the number of clusters
clust_fixed <- FKM.ent.noise(control, k = 18, RS = 5, delta = 3)
# Perform fuzzy k-means with entropy regularization and noise cluster, selecting the number of clusters
clust_selected <- FKM.ent.noise(control, RS = 5, delta = 3)
# Print the results
print(clust_fixed)
print(clust_selected)
write.table(clust_fixed, file = “clust_fixed.txt")
## control (no crowding agents) data from Crowding TPP experiment
# Load the fclust package
library(fclust)
# Load the control dataset
data(control)
# Perform fuzzy k-means with entropy regularization and noise cluster, fixing the number of clusters
clust_fixed <- FKM.ent.noise(control, k = 18, RS = 5, delta = 3)
# Perform fuzzy k-means with entropy regularization and noise cluster, selecting the number of clusters
clust_selected <- FKM.ent.noise(control, RS = 5, delta = 3)
# Print the results
print(clust_fixed)
print(clust_selected)
write.table(clust_fixed, file = "clust_fixed.txt")
## control (no crowding agents) data from Crowding TPP experiment
# Load the fclust package
library(fclust)
# Load the control dataset
data(control)
# Perform fuzzy k-means with entropy regularization and noise cluster, fixing the number of clusters
clust_fixed <- FKM.ent.noise(control, k = 18, RS = 5, delta = 3)
# Perform fuzzy k-means with entropy regularization and noise cluster, selecting the number of clusters
clust_selected <- FKM.ent.noise(control, RS = 5, delta = 3)
#code suggested by ai
# Extract the cluster assignments from the fclust object
cluster_assignments_fixed <- clust_fixed@cluster
## control (no crowding agents) data from Crowding TPP experiment
# Load the fclust package
library(fclust)
# Load the control dataset
data(control)
# Perform fuzzy k-means with entropy regularization and noise cluster, fixing the number of clusters
clust_fixed <- FKM.ent.noise(control, k = 18, RS = 5, delta = 3)
# Perform fuzzy k-means with entropy regularization and noise cluster, selecting the number of clusters
clust_selected <- FKM.ent.noise(control, RS = 5, delta = 3)
# Write the cluster assignments to a text file
write.table(cluster_assignments_fixed, file = "clust_fixed.txt", row.names = FALSE, col.names = FALSE)
## control (no crowding agents) data from Crowding TPP experiment
# Load the fclust package
library(fclust)
# Load the control dataset
data(control)
# Perform fuzzy k-means with entropy regularization and noise cluster, fixing the number of clusters
clust_fixed <- FKM.ent.noise(control, k = 18, RS = 5, delta = 3)
# Perform fuzzy k-means with entropy regularization and noise cluster, selecting the number of clusters
clust_selected <- FKM.ent.noise(control, RS = 5, delta = 3)
# Print the results
print(clust_fixed)
print(clust_selected)
setwd("C:/Users/gcagn/Desktop/dates/2025May/KateMcKeever/TPP-Paper2/TPPScript-Paper2/TPP-Paper2-Analysis03/fuzzytest/control")
setwd("C:/Users/gcagn/Desktop/dates/2025May/KateMcKeever/TPP-Paper2/TPPScript-Paper2/TPP-Paper2-Analysis03/fuzzytest/control")
# Install and load the fclust package
if (!requireNamespace("fclust", quietly = TRUE)) {
install.packages("fclust")
}
library(fclust)
# Read the input file
# Assuming the input file is a CSV file, adjust the read function as needed
input_file <- "C:\Users\gcagn\Desktop\dates\2025May\KateMcKeever\TPP-Paper2\TPPScript-Paper2\TPP-Paper2-Analysis03\fuzzytest\controlc.csv"
setwd("C:/Users/gcagn/Desktop/dates/2025May/KateMcKeever/TPP-Paper2/TPPScript-Paper2/TPP-Paper2-Analysis03/fuzzytest/control")
