{"id":13711957,"url":"https://github.com/matbou85/ggScatRidges","last_synced_at":"2025-05-06T21:32:48.216Z","repository":{"id":206531757,"uuid":"716493738","full_name":"matbou85/ggScatRidges","owner":"matbou85","description":"This is a useful function to help the user to better visualise the distribution between sample groups using density plots combined to a scatter plot.","archived":false,"fork":false,"pushed_at":"2024-02-21T07:34:52.000Z","size":1462,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-12T20:03:26.280Z","etag":null,"topics":["ggplot2","ggridges","plotting","r"],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matbou85.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-11-09T08:59:20.000Z","updated_at":"2024-03-26T11:28:10.000Z","dependencies_parsed_at":"2023-11-22T13:43:25.096Z","dependency_job_id":"20cd1471-351d-4f92-a5f8-225934e694de","html_url":"https://github.com/matbou85/ggScatRidges","commit_stats":null,"previous_names":["matbou85/ggscatridges"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matbou85%2FggScatRidges","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matbou85%2FggScatRidges/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matbou85%2FggScatRidges/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matbou85%2FggScatRidges/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matbou85","download_url":"https://codeload.github.com/matbou85/ggScatRidges/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252772237,"owners_count":21801883,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ggplot2","ggridges","plotting","r"],"created_at":"2024-08-02T23:01:13.334Z","updated_at":"2025-05-06T21:32:47.710Z","avatar_url":"https://github.com/matbou85.png","language":"R","funding_links":[],"categories":["Plot layers"],"sub_categories":[],"readme":"\n\n# ggScatRidges: Scatter Plot Combined with Ridgelines in 'ggplot2'\n\n`ggScatRidges` is a simple function combining a scatter plot to a ridgeline plot to visualise the disparities of the data points. This helps visualising the distribution of different groups in the data.\n\n![An example of a plot that this package generates](misc/img/Rplot_Basic.png)\n\n## Installation\n\nPlease install the stable release from CRAN:\n\n``` r\ninstall.packages(\"ggScatRidges\")\n```\n\nAlternatively, you can install the latest development version from github:\n\n``` r\nremotes::install_github(\"matbou85/ggScatRidges\")\n```\n\n## Basic usage\n\n``` r\nlibrary(ggScatRidges)\n    \nggScatRidges(x = iris$Sepal.Length, y = iris$Sepal.Width, group= iris$Species, \n             color = \"lancet\", ridges = TRUE, title = \"plot iris\", legend.title = \"Grouping\",\n             xlab = \"Sepal.Length\", ylab = \"Sepal.Width\", base_size = 15, size = 2, \n             draw = TRUE, density_2d = TRUE, legend = TRUE, label = FALSE, text = NULL) \n```\n\n## Change parameters: remove legend, change points shape and size\n\n```r\nlibrary(ggScatRidges)\n\nggScatRidges(x = iris$Sepal.Length, y = iris$Sepal.Width, group= iris$Species, \n             color = \"lancet\", ridges = TRUE, title = \"plot iris\",\n             xlab = \"Sepal.Length\", ylab = \"Sepal.Width\", base_size = 15, size = 3, draw = TRUE,\n             density_2d = FALSE, legend = FALSE, label = FALSE, text = NULL, pch = c(10,12,14)) \n```\n\n![An example of a plot that this package generates](misc/img/Rplot_change_config.png)\n\n\n## PCA usage application\n\n``` r\nlibrary(ggScatRidges)\nlibrary(factoextra)\n \npca \u003c- prcomp(iris[,1:4])\nPC1=pca$x[,1]\nPC2=pca$x[,2]\neig.val \u003c- get_eigenvalue(pca)\nxlab \u003c- paste0(\"PC1: \", round(eig.val[1,3], digits = 1), \"% variance\")\nylab \u003c- paste0(\"PC2: \", round(eig.val[2,3] - eig.val[1,3], digits = 1), \"% variance\")\n  \nggScatRidges(x = PC1, y = PC2, group= iris$Species, \n             color = \"lancet\", ridges = TRUE, title = \"PCA iris\",\n             xlab = xlab, ylab = ylab, size = 2, draw = TRUE,\n             density_2d = TRUE, legend = TRUE, label = FALSE, text = NULL)\n\n```\n\n![An example of a plot that this package generates](misc/img/Rplot_PCA.png)\n\n## Plot from dataframe\n\n``` r\nlibrary(ggScatRidges)\nlibrary(dplyr)\n\niris2 \u003c- iris[,c(1,2,5)] ## The first column will be used as 'x', the second as 'y' and the third as group for plotting.\niris2 \u003c- iris2 %\u003e% group_by(Species) %\u003e% slice(1:10)\niris2$name \u003c- c(1:30) ## The fourth column is used for naming.\n\nggScatRidges(x = iris2, \n             color = \"lancet\", ridges = TRUE, title = \"plot iris\",\n             xlab = \"Sepal.Length\", ylab = \"Sepal.width\", size = 2, draw = TRUE,\n             density_2d = FALSE, legend = TRUE, label = TRUE)\n\n```\n\n![An example of a plot that this package generates](misc/img/Rplot_df.png)\n\n\nThis function is loosely inspired by one of the plots in [a post](http://www.sthda.com/english/articles/24-ggpubr-publication-ready-plots/78-perfect-scatter-plots-with-correlation-and-marginal-histograms/) by [Alboukadel Kassambara](http://www.sthda.com/english/user/profile/1) from 2017.\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatbou85%2FggScatRidges","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatbou85%2FggScatRidges","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatbou85%2FggScatRidges/lists"}