Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ShinySbm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VANRENTERGHEM Théodore
ShinySbm
Commits
2582f61c
Commit
2582f61c
authored
1 year ago
by
Theodore Vanrenterghem
Browse files
Options
Downloads
Plain Diff
Merge branch 'dev'
parents
cd59e413
e89193a5
No related branches found
Branches containing commit
Tags
v0.1.6
No related merge requests found
Pipeline
#124020
passed
1 year ago
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
R/fct_errorHandeling.R
+4
-4
4 additions, 4 deletions
R/fct_errorHandeling.R
R/mod_help_to_import.R
+6
-1
6 additions, 1 deletion
R/mod_help_to_import.R
R/mod_tab_upload.R
+6
-0
6 additions, 0 deletions
R/mod_tab_upload.R
with
16 additions
and
5 deletions
R/fct_errorHandeling.R
+
4
−
4
View file @
2582f61c
...
...
@@ -2,7 +2,7 @@
#'
#' @description Check the raw data.frame according to inputs
#'
#' @param dta=NULL,inputs=NULL
#' @param dta=NULL,inputs=NULL
,show_message_repeated_rows=FALSE
#' `dta` data.frame
#' `inputs` list of inputs from upload table:
#' - `input$dataType`
...
...
@@ -14,16 +14,16 @@
#' and warnings with indication to get a better results
#'
#' @noRd
check_data_inputs
<-
function
(
dta
=
NULL
,
inputs
=
NULL
)
{
check_data_inputs
<-
function
(
dta
=
NULL
,
inputs
=
NULL
,
show_message_repeated_rows
=
FALSE
)
{
## Check for all cases
# Table are too thin could be a separator problem
if
(
dim
(
dta
)
[
2
]
<=
1
)
{
if
(
ncol
(
dta
)
<=
1
)
{
warning
(
"Low number of columns: Try to change separator"
)
}
else
{
# if table are thicker
# Prevent miss-comprehension: if set rows as name and the first column has
# repetition it would give an error and stop the app. The real correction is
# in "mod_tab_upload.R" but here is a message that tell what's happening to the user
if
(
inputs
$
headerrow
&
any
(
duplicated
(
dta
[[
1
]]))
&
is.character
(
dta
[[
1
]])
)
{
if
(
inputs
$
headerrow
&
show_message_repeated_rows
)
{
message
(
"Repeated values in the 1st column: cannot be set as row names"
)
}
## Check in case of a adjacency matrix
...
...
This diff is collapsed.
Click to expand it.
R/mod_help_to_import.R
+
6
−
1
View file @
2582f61c
...
...
@@ -58,7 +58,12 @@ mod_help_to_import_server <- function(id, rawData = NULL, sbmData = NULL, input_
if
(
!
is.null
(
rawData
)
&
!
is.null
(
input_upload
)
&&
input_upload
$
whichData
==
"importData"
)
{
warns
<-
list
()
mess
<-
list
()
withCallingHandlers
(
check_data_inputs
(
dta
=
rawData
(),
inputs
=
input_upload
),
withCallingHandlers
(
check_data_inputs
(
dta
=
rawData
(),
inputs
=
input_upload
,
show_message_repeated_rows
=
session
$
userData
$
vars
$
show_message_repeated_rows
),
warning
=
function
(
w
)
{
warns
<<-
c
(
warns
,
list
(
w
))
},
...
...
This diff is collapsed.
Click to expand it.
R/mod_tab_upload.R
+
6
−
0
View file @
2582f61c
...
...
@@ -194,6 +194,7 @@ mod_tab_upload_server <- function(id, r, parent_session) {
ns
<-
session
$
ns
## will be used in other modules inside conditionnal panels that should only be shown when the sbm has been run
# reset when loading a new matrix
session
$
userData
$
vars
$
show_message_repeated_rows
<-
FALSE
output
$
sbmRan
<-
renderText
({
if
(
session
$
userData
$
vars
$
sbm
$
runSbm
!=
0
)
{
"YES"
...
...
@@ -265,6 +266,7 @@ mod_tab_upload_server <- function(id, r, parent_session) {
sep
(),
dec
(),
input
$
headerrow
,
input
$
headercol
),
{
session
$
userData
$
vars
$
show_message_repeated_rows
<-
FALSE
if
(
input
$
whichData
==
"importData"
)
{
validate
(
need
(
input
$
mainDataFile
$
datapath
,
""
)
...
...
@@ -276,8 +278,12 @@ mod_tab_upload_server <- function(id, r, parent_session) {
row.names
=
1
,
header
=
input
$
headercol
,
check.names
=
FALSE
)
}
else
{
data
<-
read.table
(
file
=
input
$
mainDataFile
$
datapath
,
sep
=
sep
(),
header
=
input
$
headercol
,
check.names
=
FALSE
)
if
(
input
$
headerrow
){
session
$
userData
$
vars
$
show_message_repeated_rows
<-
TRUE
}
}
}
else
{
validate
(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment