Skip to content

Commit 95a6910

Browse files
committed
change NULL to NA
1 parent 882c70d commit 95a6910

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

R/pkg/R/mllib_clustering.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,12 +414,12 @@ setMethod("summary", signature(object = "LDAModel"),
414414
trainingLogLikelihood <- if (isDistributed) {
415415
callJMethod(jobj, "trainingLogLikelihood")
416416
} else {
417-
NULL
417+
NA
418418
}
419419
logPrior <- if (isDistributed) {
420420
callJMethod(jobj, "logPrior")
421421
} else {
422-
NULL
422+
NA
423423
}
424424
list(docConcentration = unlist(docConcentration),
425425
topicConcentration = topicConcentration,

R/pkg/inst/tests/testthat/test_mllib_clustering.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@ test_that("spark.lda with text input", {
196196
expect_true(logPerplexity >= 0 & is.finite(logPerplexity))
197197
expect_equal(vocabSize, 10)
198198
expect_true(setequal(stats$vocabulary, c("0", "1", "2", "3", "4", "5", "6", "7", "8", "9")))
199-
expect_true(is.null(trainingLogLikelihood))
200-
expect_true(is.null(logPrior))
199+
expect_true(is.na(trainingLogLikelihood))
200+
expect_true(is.na(logPrior))
201201

202202
# Test model save/load
203203
modelPath <- tempfile(pattern = "spark-lda-text", fileext = ".tmp")
@@ -212,8 +212,8 @@ test_that("spark.lda with text input", {
212212
expect_equal(logPerplexity, stats2$logPerplexity)
213213
expect_equal(vocabSize, stats2$vocabSize)
214214
expect_true(all.equal(vocabulary, stats2$vocabulary))
215-
expect_true(is.null(stats2$trainingLogLikelihood))
216-
expect_true(is.null(stats2$logPrior))
215+
expect_true(is.na(stats2$trainingLogLikelihood))
216+
expect_true(is.na(stats2$logPrior))
217217

218218
unlink(modelPath)
219219
})

0 commit comments

Comments
 (0)