Companion plants

companionPlants.paj / Bavla

The data are from 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

pajek/nets/mix/comp.txt · Last modified: 2023/02/03 01:43 by vlado
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki