Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

General Upkeep #255

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
^.*\.Rproj$
^\.Rproj\.user$
^\.travis\.yml$
^\.github$
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
49 changes: 49 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: R-CMD-check

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.Rhistory
.RData
.DS_Store
inst/doc
52 changes: 0 additions & 52 deletions .travis.yml

This file was deleted.

12 changes: 7 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,17 @@ Depends:
Imports:
ggplot2,
gridExtra,
plyr,
utils,
stats,
methods,
grDevices,
scales
scales,
rlang,
vctrs
License: MIT + file LICENSE
LazyData: true
VignetteBuilder: knitr
Suggests:
knitr
RoxygenNote: 7.0.2
knitr,
rmarkdown
RoxygenNote: 7.2.3
Encoding: UTF-8
10 changes: 8 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,14 @@ import(ggplot2)
import(grDevices)
import(gridExtra)
import(methods)
import(scales)
import(stats)
import(utils)
importFrom(ggplot2,aes)
importFrom(ggplot2,element_blank)
importFrom(ggplot2,element_text)
importFrom(ggplot2,geom_histogram)
importFrom(ggplot2,ggplot)
importFrom(ggplot2,theme)
importFrom(grid,gpar)
importFrom(grid,grid.draw)
importFrom(grid,grid.layout)
Expand All @@ -24,4 +29,5 @@ importFrom(grid,legendGrob)
importFrom(grid,popViewport)
importFrom(grid,pushViewport)
importFrom(grid,viewport)
importFrom(plyr,count)
importFrom(rlang,"%||%")
importFrom(rlang,.data)
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
- Fix some warnings from ggplot2 3.0.0.
- Remove dependency on plyr

Release v1.4.0

- Allow custom y-axis label and scale
Expand Down
2 changes: 1 addition & 1 deletion R/Boxplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ BoxPlotsPlot <- function(bdat, att, att_color){
panel.grid.minor = element_blank(),
panel.grid.major = element_blank(),
axis.title.x = element_blank())
+ geom_boxplot(data = bdat, aes_string(x="x", y="attribute"),
+ geom_boxplot(data = bdat, aes(x = .data$x, y = .data$attribute),
fill = att_color, colour = "gray80"))
return(boxplots)
}
10 changes: 5 additions & 5 deletions R/Custom.plots.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ GenerateCustomPlots <- function(attribute_plots, Set_data, QueryData, att_color,
if(length(QueryData) != 0){SetAndQueryData[1:nrow(Set_data), ]$color <- "gray23"}
# x_att <- attribute_plots$plots[[i]]$x
# y_att <- attribute_plots$plots[[i]]$y
if(isTRUE(attribute_plots$plots[[i]]$queries) == T){
if(isTRUE(attribute_plots$plots[[i]]$queries)){
if(length(QueryData) == 0){
warning("To overlay with query data please specify att.x and att.y where applicable.")
if(is.null(attribute_plots$plots[[i]]$y) == F){
if(!is.null(attribute_plots$plots[[i]]$y)){
CustomPlot[[i]] <- attribute_plots$plots[[i]]$plot(Set_data, attribute_plots$plots[[i]]$x, attribute_plots$plots[[i]]$y)
}
else{
CustomPlot[[i]] <- attribute_plots$plots[[i]]$plot(Set_data, attribute_plots$plots[[i]]$x)
}
}
else if(length(QueryData) != 0){
if(is.null(attribute_plots$plots[[i]]$y) == F){
if(is.na(atty[i]) == T){
if(!is.null(attribute_plots$plots[[i]]$y)){
if(is.na(atty[i])){
warning("No y attribute provided to overlay with query data.
If attempting to display plot that needs both x and y aesthetics please enter att.y parameter.
Plots that require just the x aestheitc will not be affected.")
Expand All @@ -39,7 +39,7 @@ GenerateCustomPlots <- function(attribute_plots, Set_data, QueryData, att_color,
}
}
else {
if(is.null(attribute_plots$plots[[i]]$y) == F){
if(!is.null(attribute_plots$plots[[i]]$y)){
CustomPlot[[i]] <- attribute_plots$plots[[i]]$plot(Set_data, attribute_plots$plots[[i]]$x, attribute_plots$plots[[i]]$y)
}
else{
Expand Down
8 changes: 4 additions & 4 deletions R/Custom.user.queries.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ customQueriesBar <- function(cust_data, sets,bar_data,custom){
return(NULL)
}
for(i in 1:length(cust_data)){
cust_data[[i]] <- count(cust_data[[i]][sets])
cust_data[[i]] <- count_compat(cust_data[[i]][sets])
colnames(cust_data[[i]])[num] <- "freq2"
cust_data[[i]] <- cust_data[[i]][!(rowSums(cust_data[[i]][ ,1:length(sets)]) == 0), ]
setup[[i]] <- merge(cust_data[[i]], bar_data, by = sets)
color2 <- rep(custom[[i]]$color, times = nrow(setup[[i]]))
if(isTRUE(custom[[i]]$active) == T){
act <- rep(T, nrow(setup[[i]]))
if(isTRUE(custom[[i]]$active)){
act <- rep(TRUE, nrow(setup[[i]]))
}
else{
act <- rep(F, nrow(setup[[i]]))
act <- rep(FALSE, nrow(setup[[i]]))
}
setup[[i]] <- cbind(setup[[i]], color2, act)
}
Expand Down
28 changes: 14 additions & 14 deletions R/Element.queries.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ QuerieElemAtt <- function(q, data, start_col, exp, names, att_x, att_y, palette)
if(length(q) == 0){
return(NULL)
}
for(i in 1:length(q)){
for(i in seq_along(q)){
index_q <- unlist(q[[i]]$params)
elem_color <- unlist(q[[i]]$color)
test <- as.character(index_q[1])
check <- match(test, names)
if(length(check) != 0){
if(is.na(att_y[i]) == F){
if(!is.na(att_y[i])){
elems <- GetElements(data, index_q)
end_col <- ((start_col + as.integer(length(names))) - 1)
elems <- elems[which(rowSums(elems[ ,start_col:end_col]) != 0), ]
if(is.null(exp) == F){
if(!is.null(exp)){
elems <- Subset_att(elems, exp)
}
if(nrow(elems) != 0){
Expand All @@ -33,11 +33,11 @@ QuerieElemAtt <- function(q, data, start_col, exp, names, att_x, att_y, palette)
elems <- NULL
}
}
else if(is.na(att_y[i]) == T){
else if(is.na(att_y[i])){
elems <- GetElements(data, index_q)
end_col <- ((start_col + as.integer(length(names))) - 1)
elems <- elems[which(rowSums(elems[ ,start_col:end_col]) != 0), ]
if(is.null(exp) == F){
if(!is.null(exp)){
elems <- Subset_att(elems, exp)
}
if(nrow(elems) != 0){
Expand Down Expand Up @@ -65,39 +65,39 @@ QuerieElemAtt <- function(q, data, start_col, exp, names, att_x, att_y, palette)


ElemBarDat <- function(q, data1, first_col, exp, names, palette, mbdata){
data1 <- data.frame(data1, check.names = F)
bar <- count(data1)
data1 <- data.frame(data1, check.names = FALSE)
bar <- count_compat(data1)
bar$x <- 1:nrow(bar)
rows <- data.frame()
act <- c()
if(length(q) == 0){
return(NULL)
}
for(i in 1:length(q)){
for(i in seq_along(q)){
index_q <- unlist(q[[i]]$params)
test <- as.character(index_q[1])
check <- match(test, names)
elem_color <- q[[i]]$color
if(is.na(check) != T){
if(!is.na(check)){
elem_data <- NULL
}
else{
elem_data <- data1[which(as.character(data1[ ,test]) %in% c(index_q[2:length(index_q)])), ]
if(!is.null(exp)){
elem_data <- Subset_att(elem_data, exp)
}
elem_data <- as.data.frame(count(elem_data[names]))
elem_data <- as.data.frame(count_compat(elem_data[names]))
names(elem_data) <- c(names, "freq")
elem_data <- elem_data[which(rowSums(elem_data[names]) != 0), ]
x <- merge(mbdata, elem_data[names], by = names)
elem_data <- merge(x[names], elem_data, by = names)
x <- x$x
elem_data$x <- x
if((isTRUE(q[[i]]$active) == T) && (is.null(elem_data) == F)){
act <- T
if(isTRUE(q[[i]]$active) && !is.null(elem_data)){
act <- TRUE
}
else if((isTRUE(q[[i]]$active) == F || is.null(q[[i]]$active) == T) && (is.null(elem_data) == F)){
act <- F
else if((!isTRUE(q[[i]]$active) || is.null(q[[i]]$active)) && !is.null(elem_data)){
act <- FALSE
}
elem_data$color <- elem_color
elem_data$act <- act
Expand Down
20 changes: 10 additions & 10 deletions R/General.query.funcs.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
SeperateQueries <- function(queries, choice, palette) {
seperated <- list()
for (i in 1:length(queries)) {
if (is.null(queries[[i]]$color) == T) {
if (is.null(queries[[i]]$color)) {
queries[[i]]$color <- palette[1]
palette <- palette[-1]
}
else if (is.null(queries[[i]]$color) == F) {
else if (!is.null(queries[[i]]$color)) {
next
}
}
if (choice == 1) {
for (i in 1:length(queries)) {
if (identical(intersects, queries[[i]]$query) == T ||
identical(elements, queries[[i]]$query) == T) {
if (identical(intersects, queries[[i]]$query) ||
identical(elements, queries[[i]]$query)) {
seperated <- c(seperated, list(queries[[i]]))
}
else{
Expand All @@ -24,8 +24,8 @@ SeperateQueries <- function(queries, choice, palette) {
}
else if (choice == 2) {
for (i in 1:length(queries)) {
if (identical(intersects, queries[[i]]$query) == F &&
identical(elements, queries[[i]]$query) == F) {
if (!identical(intersects, queries[[i]]$query) &&
!identical(elements, queries[[i]]$query)) {
seperated <- c(seperated, list(queries[[i]]))
}
else{
Expand Down Expand Up @@ -61,18 +61,18 @@ GuideGenerator <- function(queries, palette) {
return(NULL)
}
for (i in 1:length(queries)) {
if (is.null(queries[[i]]$color) == T) {
if (is.null(queries[[i]]$color)) {
queries[[i]]$color <- palette[1]
palette <- palette[-1]
}
else if (is.null(queries[[i]]$color) == F) {
else if (!is.null(queries[[i]]$color)) {
queries[[i]]$color <- queries[[i]]$color
}
colors[i] <- queries[[i]]$color
if (is.null(queries[[i]]$query.name) == FALSE) {
if (!is.null(queries[[i]]$query.name)) {
numbers[i] <- queries[[i]]$query.name
}
else if (is.null(queries[[i]]$query.name) == TRUE) {
else if (is.null(queries[[i]]$query.name)) {
numbers[i] <- paste("Query", as.character(i), sep = "")
}
}
Expand Down
Loading