sortit: Sorting a dataset

Description Usage Arguments Examples

Description

Takes in any data.frame and given input and assigns row weights. On the animals dataset, it is a bit pointless. I imagine this will be useful in finding a large homogeneous set of individuals which might be useful in finding a market to sell something to. For example, we select customers which bought "X" and the algorithm tries to find a large group with similar characteristics. The "weights" are a bit arbitrary at this moment. Say one column has 100 dogs and 50 cats, each dog row will receive 100 points. The rows which have the highest "sums" for each column overall will go towards the top. As such, there might be usefulness for this function with some critical thought and improvement.

Usage

1
2
3
4
sortit(dataFrame = "Where data is stored",
  columnNumber = "Column number which holds category to sort by",
  categoryName = "Name of category to sort by",
  columnNumbersBeSorted = "Rows to be sorted, list as vector i.e., c(4,5,7,9)")

Arguments

dataFrame

A dataframe

columnNumber

Column with variable to be sorted

categoryName

Name of variable in columnNumber

columnNumbersBeSorted

Column numbers which hold data to be sorted

Examples

1
2
# This might take a moment to run.
forLoopAnimals <- sortit(animals, 4, "Euthanasia", c(5, 6, 7, 8, 9))

fdrennan/fdRenn documentation built on May 16, 2019, 12:12 p.m.