====== Companion plants ====== [[https://raw.githubusercontent.com/bavla/Nets/master/data/mix/companionPlants.paj|companionPlants.paj / Bavla]] The data are from [[https://www.kaggle.com/datasets/aramacus/companion-plants|Kaggle]]. The original file ''companion_plants.csv'' contains the line ''378 yarrow,helps,"""",herbs'' I searched on Google. The answer was that yarrow helps rosemary, basil, lavender, thyme, oregano. I entered the corresponding lines and saved the data to ''companionPlants.csv'' > setwd("C:/Users/vlado/DL/data/kaggle/companionPlants") > source("https://raw.githubusercontent.com/bavla/Rnet/master/R/Pajek.R") > CP <- read.csv("companionPlants.csv") > dim(CP) > head(CP) > S <- factor(CP$Source.Node) > D <- factor(CP$Destination.Node) > L <- union(levels(D),levels(S)) > S <- factor(CP$Source.Node,levels=L) > D <- factor(CP$Destination.Node,levels=L) > R <- factor(CP$Link) > uvFac2net(S,D,r=R,Net="companionPlants.net") > N <- rep("?",length(L)) > for(i in 1:length(S)) N[S[i]] <- CP$Source.Type[i] > T <- factor(N) > TL <- levels(T) > paste(paste(1:length(TL),TL,sep=": "),collapse=", ") [1] "1: ?, 2: flowers, 3: fruits, 4: herbs, 5: vegetables" > vector2clu(T,Clu="companionPlants.clu") ===== To do ===== Compare with: - https://en.wikipedia.org/wiki/List_of_companion_plants - https://github.com/GenevieveMilliken/companion_plants - https://github.com/alecsharpie/companion_planting_dataset - https://towardsdatascience.com/maintain-a-companion-plant-knowledge-graph-in-google-sheets-and-neo4j-4142c0a5065b - https://github.com/dgg32/companion_plants_2