Title: | Potential for Conflict Index in R |
---|---|
Description: | An R package to calculate, compare, and visualize the Potential for Conflict Index (PCI). |
Authors: | Francesca Palmeira [aut, cre] |
Maintainer: | Francesca Palmeira <[email protected]> |
License: | MIT |
Version: | 0.1.0 |
Built: | 2024-11-24 05:55:21 UTC |
Source: | https://github.com/fblpalmeira/pcir |
This file contains the basic setup and utility functions for the 'pcir' package. The pcir package is designed for calculating, comparing, and visualizing the Potential for Conflict Index (PCI).
- 'counting()': Summarize data by calculating counts, percentages, means, and standard deviations. - 'pci()': Compute the Potential for Conflict Index (PCI) from summary data. - 'bubble()': Create a bubble plot to visualize PCI results.
Useful links:
This function generates a bubble plot to visualize the results of the PCI calculation. It shows the mean action acceptability on the y-axis and the PCI value as the size of the bubbles.
Create a bubble plot to visualize PCI results.
bubble(df3) bubble(df3)
bubble(df3) bubble(df3)
df3 |
A data frame generated by the 'pci' function. |
A ggplot2 object representing the bubble plot.
A ggplot2 object representing the bubble plot.
df3 <- pci(df2) p <- bubble(df3) print(p) df3 <- pci(df2) bubble(df3)
df3 <- pci(df2) p <- bubble(df3) print(p) df3 <- pci(df2) bubble(df3)
This function takes a data frame, transforms it by computing counts, percentages, mean, and standard deviation for specified columns. It helps in summarizing the data to understand the distribution and variation.
Create a count table with percentages, mean, and standard deviation.
counting(df1) counting(df1)
counting(df1) counting(df1)
df1 |
A data frame containing the data to be processed. |
A data frame with computed statistics, including counts, percentages, mean, and standard deviation.
A data frame with computed statistics.
df1 <- data.frame(A = c(-1, 2, 2, 3, -1), B = c(-1, 2, 3, -1, 2), C = c(1, 2, -2, 3, -1), D = c(3, 2, 1, -1, -2), E = c(2, 3, 1, -1, -3)) result <- counting(df1) print(result) df1 <- data.frame(A = c(-1, 2, 2, 3, -1), B = c(-1, 2, 3, -1, 2), C = c(1, 2, -2, 3, -1), D = c(3, 2, 1, -1, -2), E = c(2, 3, 1, -1, -3)) counting(df1)
df1 <- data.frame(A = c(-1, 2, 2, 3, -1), B = c(-1, 2, 3, -1, 2), C = c(1, 2, -2, 3, -1), D = c(3, 2, 1, -1, -2), E = c(2, 3, 1, -1, -3)) result <- counting(df1) print(result) df1 <- data.frame(A = c(-1, 2, 2, 3, -1), B = c(-1, 2, 3, -1, 2), C = c(1, 2, -2, 3, -1), D = c(3, 2, 1, -1, -2), E = c(2, 3, 1, -1, -3)) counting(df1)
Calculate the Potential for Conflict Index (PCI).
Calculate the Potential for Conflict Index (PCI).
pci(df2) pci(df2)
pci(df2) pci(df2)
df2 |
A data frame generated by the 'counting' function. |
A data frame with the calculated PCI values for each group.
A data frame with the calculated PCI values for each group.
df2 <- counting(df1) pci(df2) df2 <- counting(df1) pci(df2)
df2 <- counting(df1) pci(df2) df2 <- counting(df1) pci(df2)