Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
dougy147 committed Jun 25, 2024
2 parents 9e71ed7 + 3690a30 commit 9019a7a
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 14 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/r.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
#
# See https://github.com/r-lib/actions/tree/master/examples#readme for
# additional example workflows available for the R community.

name: R

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

permissions:
contents: read

jobs:
build:
runs-on: macos-latest
strategy:
matrix:
r-version: ['3.6.3', '4.1.1']

steps:
- uses: actions/checkout@v4
- name: Set up R ${{ matrix.r-version }}
uses: r-lib/actions/setup-r@f57f1301a053485946083d7a45022b278929a78a
with:
r-version: ${{ matrix.r-version }}
- name: Install dependencies
run: |
install.packages(c("remotes", "rcmdcheck"))
remotes::install_deps(dependencies = TRUE)
shell: Rscript {0}
- name: Check
run: rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "error")
shell: Rscript {0}
26 changes: 14 additions & 12 deletions R/easieR.R
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ easieR.msg<-function(msg="1"){
# "4"="User has terminated easieR")
#
# }

if (msg=="1") c(.dico[["desc_for_easier_to_work"]]) -> msg
else if (msg=="2") c(.dico[["txt_data_import_export_save"]],
.dico[["txt_preprocess_sort_select_operations"]],
Expand All @@ -72,7 +73,7 @@ easieR.msg<-function(msg="1"){



#### statistiques descriptives ####
#### statistiques .dico$descriptives ####


#### permet d'identifier et enlever les valeurs influentes ####
Expand Down Expand Up @@ -127,6 +128,7 @@ VI.multiples<-function(data, X){
data[which(data$D.Mahalanobis>seuil),]->outliers
length(outliers[,1])/length(data[,1])*100->pourcent


msgBox(paste(round(pourcent,2), .dico[["desc_percentage_outliers"]]))


Expand Down Expand Up @@ -540,7 +542,7 @@ VI.multiples<-function(data, X){


# cree la liste avec tous les resultats
.stat.desc.out<-function(X=NULL, groupes=NULL, data=NULL, tr=.1, type=3, plot=T){
.stat..dico$desc.out<-function(X=NULL, groupes=NULL, data=NULL, tr=.1, type=3, plot=T){
packages<-c('psych', 'ggplot2')
test2<-try(lapply(packages, library, character.only=T), silent=T)
data_summary <- function(x) {
Expand All @@ -558,11 +560,11 @@ VI.multiples<-function(data, X){

if(length(X)!=0){
if(is.null(groupes)) NULL->groupes2 else data.frame(data[,groupes])->groupes2
try( psych::describeBy(data[,X], group=groupes2,mat=(!is.null(groupes)),type=type,digits=4, check=FALSE,skew = TRUE,
ranges = TRUE,trim=tr, fast=FALSE), silent=T)->psych.desc
if(any(class(psych.desc)=='try-error')) {
psych::describeBy(data[,X], group=groupes2,mat=F,type=type,digits=15, check=FALSE,skew = TRUE,
ranges = TRUE,trim=tr)->psych.desc
try( psych::.dico$describeBy(data[,X], group=groupes2,mat=(!is.null(groupes)),type=type,digits=4, check=FALSE,skew = TRUE,
ranges = TRUE,trim=tr, fast=FALSE), silent=T)->psych..dico$desc
if(any(class(psych..dico$desc)=='try-error')) {
psych::.dico$describeBy(data[,X], group=groupes2,mat=F,type=type,digits=15, check=FALSE,skew = TRUE,
ranges = TRUE,trim=tr)->psych..dico$desc
expand.grid(sapply(groupes2, levels))->modalites
for(i in 1:length(modalites[,1])) {
if(is.null(psych.desc[[i]])) paste(.dico[["desc_no_obs_for_combination"]], paste(unlist(modalites[i,]), collapse=" & "))->Resultats[[i]] else psych.desc[[i]]->Resultats[[i]]
Expand Down Expand Up @@ -635,14 +637,14 @@ ref1 <-
require('bibtex')
c('base', packages, 'bibtex')->packages
if(Sys.info()[[1]]=="Windows"){
file.nametxt<-paste0(tempdir(), "\\references.bib")
file.name.dico$txt<-paste0(tempdir(), "\\references.bib")
} else {
file.nametxt<-paste0(tempdir(), "/references.bib")
file.name.dico$txt<-paste0(tempdir(), "/references.bib")
}

write.bib(packages, file=file.nametxt)
bibtex::read.bib(file.nametxt)->Resultats
file.remove(file.nametxt)
write.bib(packages, file=file.name.dico$txt)
bibtex::read.bib(file.name.dico$txt)->Resultats
file.remove(file.name.dico$txt)
return(Resultats)
}

Expand Down
2 changes: 1 addition & 1 deletion R/lang_en_EN.R
Original file line number Diff line number Diff line change
Expand Up @@ -1129,4 +1129,4 @@ load_en_EN <- function() {
assign("txt_gg_p_value" , "GG.p.value" , envir=.dico)
assign("txt_var_explained_dot" , "Var.explained" , envir=.dico)
assign("txt_V_sq_" , "V.squared" , envir=.dico)
}
}
2 changes: 1 addition & 1 deletion R/lang_fr_FR.R
Original file line number Diff line number Diff line change
Expand Up @@ -1129,4 +1129,4 @@ load_fr_FR <- function() {
assign("txt_gg_p_value" , "GG.valeur.p" , envir=.dico)
assign("txt_var_explained_dot" , "Var.expliquee" , envir=.dico)
assign("txt_V_sq_" , "V.carre" , envir=.dico)
}
}

0 comments on commit 9019a7a

Please sign in to comment.