Package 'pcir'

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

Help Index


pcir Package Functions and Setup

Description

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).

Functions

- '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.

See Also

Useful links:


Create a Bubble Plot for PCI Visualization

Description

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.

Usage

bubble(df3)

bubble(df3)

Arguments

df3

A data frame generated by the 'pci' function.

Value

A ggplot2 object representing the bubble plot.

A ggplot2 object representing the bubble plot.

Examples

df3 <- pci(df2)
p <- bubble(df3)
print(p)
df3 <- pci(df2)
bubble(df3)

Create a Count Table with Percentages, Mean, and SD

Description

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.

Usage

counting(df1)

counting(df1)

Arguments

df1

A data frame containing the data to be processed.

Value

A data frame with computed statistics, including counts, percentages, mean, and standard deviation.

A data frame with computed statistics.

Examples

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)

PCI Function

Description

Calculate the Potential for Conflict Index (PCI).

Calculate the Potential for Conflict Index (PCI).

Usage

pci(df2)

pci(df2)

Arguments

df2

A data frame generated by the 'counting' function.

Value

A data frame with the calculated PCI values for each group.

A data frame with the calculated PCI values for each group.

Examples

df2 <- counting(df1)
pci(df2)
df2 <- counting(df1)
pci(df2)