Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 206316

Removing rows of character strings that are subsets of a larger character string

$
0
0

I'm using the below codes to create association rules for a project;

RawData_Kicks_Rules <- apriori(RawData_Kicks_ALLKICKS, parameter = list(supp = 0.005, conf = 0.5, minlen=3, maxlen=9))

RawData_Limiter <- which(colSums(is.subset(RawData_Kicks_Rules,RawData_Kicks_Rules))>1)

RawData_Kicks_Rules.sub <-RawData_Kicks_Rules[-RawData_Limiter]

The goal from the last two lines of code is to identify and remove any rules that are a part of a larger existing rule. For example;

{Disposal Source=Free Kick,Kick Target=Open,Direction=Sideward} => {Kick Distance=0-20}

{Disposal Source=Free Kick,Kick Target=Open,Direction=Sideward,Disposal Pressure=None} => {Kick Distance=0-20}

In this output, ideally the first rule would have been removed since it is already a part of the the second rule.

Any help on this would be appreciated.


Viewing all articles
Browse latest Browse all 206316

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>