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

Column type conversions #38

Open
wants to merge 1 commit 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
5 changes: 4 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ Imports:
stringi,
stringr,
testthat (>= 3.0.3),
vdiffr (>= 1.0.2)
vdiffr (>= 1.0.2),
jaspBase
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this necessary? Originally, the idea was that jaspTools could do things, like installing jaspBase, for a developer. But this kinda looks like it becomes a cycle. Or is this intended as a workaround until we get rid of jaspTools altogether?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

even though we already had things like jaspBase:::.vdf before, this change will make it impossible to install jaspTools without first installing jaspBase.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No it's not necessary, but since we are using jaspBase anyway I figured it might as well be specified as a dependency - hence I asked before whether it's deliberate that it's excluded.

So I guess I am saying I can remove it - as you say jaspTools sets up jaspBase anyway so it's not a gib deal.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops sorry I missed that in your message.

Remotes:
jasp-stats/jaspBase
RoxygenNote: 7.2.3
Roxygen: list(markdown = TRUE)
29 changes: 1 addition & 28 deletions R/rbridge.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
env[[".setColumnDataAsNominalText"]] <- function(...) return(TRUE)

env[[".allColumnNamesDataset"]] <- function(...) {
dataset <- .getInternal("dataset")
dataset <- loadCorrectDataset(dataset)
dataset <- jaspBase::getDataSet(dataset)
return(colnames(dataset))
}
}
Expand All @@ -26,32 +25,6 @@

.baseCitation <- "x"

.readDatasetToEndNative <- function(columns = c(), columns.as.numeric = c(), columns.as.ordinal = c(),
columns.as.factor = c(), all.columns = FALSE) {

dataset <- .getInternal("dataset")
dataset <- loadCorrectDataset(dataset)

if (all.columns) {
columns <- colnames(dataset)
columns <- columns[columns != ""]
}
dataset <- jaspBase:::.vdf(dataset, columns, columns.as.numeric, columns.as.ordinal,
columns.as.factor, all.columns, exclude.na.listwise = c())

return(dataset)
}

.readDataSetHeaderNative <- function(columns = c(), columns.as.numeric = c(), columns.as.ordinal = c(),
columns.as.factor = c(), all.columns = FALSE) {

dataset <- .readDatasetToEndNative(columns, columns.as.numeric, columns.as.ordinal,
columns.as.factor, all.columns)
dataset <- dataset[0, , drop = FALSE]

return(dataset)
}

.requestTempFileNameNative <- function(...) {
root <- getTempOutputLocation("html")
numPlots <- length(list.files(file.path(root, "plots")))
Expand Down
3 changes: 2 additions & 1 deletion R/run.R
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ initAnalysisRuntime <- function(dataset, makeTests, ...) {
reinstallChangedModules()

# dataset to be found in the analysis when it needs to be read
.setInternal("dataset", dataset)
dataset <- loadCorrectDataset(dataset)
jaspBase::setDataSet(dataset)

# prevent the results from being translated (unless the user explicitly wants to)
Sys.setenv(LANG = getPkgOption("language"))
Expand Down
Loading