aboutsummaryrefslogtreecommitdiff
path: root/R/pkg/R/DataFrame.R
diff options
context:
space:
mode:
authorYu ISHIKAWA <yuu.ishikawa@gmail.com>2015-08-26 18:14:32 -0700
committerShivaram Venkataraman <shivaram@cs.berkeley.edu>2015-08-26 18:14:32 -0700
commit773ca037a43d464ce7f16fe693ca6034f09a35b7 (patch)
treede249e08ec5e0d5e1a02d54782a7f3a84207a043 /R/pkg/R/DataFrame.R
parentad7f0f160be096c0fdae6e6cf7e3b6ba4a606de7 (diff)
downloadspark-773ca037a43d464ce7f16fe693ca6034f09a35b7.tar.gz
spark-773ca037a43d464ce7f16fe693ca6034f09a35b7.tar.bz2
spark-773ca037a43d464ce7f16fe693ca6034f09a35b7.zip
[MINOR] [SPARKR] Fix some validation problems in SparkR
Getting rid of some validation problems in SparkR https://github.com/apache/spark/pull/7883 cc shivaram ``` inst/tests/test_Serde.R:26:1: style: Trailing whitespace is superfluous. ^~ inst/tests/test_Serde.R:34:1: style: Trailing whitespace is superfluous. ^~ inst/tests/test_Serde.R:37:38: style: Trailing whitespace is superfluous. expect_equal(class(x), "character") ^~ inst/tests/test_Serde.R:50:1: style: Trailing whitespace is superfluous. ^~ inst/tests/test_Serde.R:55:1: style: Trailing whitespace is superfluous. ^~ inst/tests/test_Serde.R:60:1: style: Trailing whitespace is superfluous. ^~ inst/tests/test_sparkSQL.R:611:1: style: Trailing whitespace is superfluous. ^~ R/DataFrame.R:664:1: style: Trailing whitespace is superfluous. ^~~~~~~~~~~~~~ R/DataFrame.R:670:55: style: Trailing whitespace is superfluous. df <- data.frame(row.names = 1 : nrow) ^~~~~~~~~~~~~~~~ R/DataFrame.R:672:1: style: Trailing whitespace is superfluous. ^~~~~~~~~~~~~~ R/DataFrame.R:686:49: style: Trailing whitespace is superfluous. df[[names[colIndex]]] <- vec ^~~~~~~~~~~~~~~~~~ ``` Author: Yu ISHIKAWA <yuu.ishikawa@gmail.com> Closes #8474 from yu-iskw/minor-fix-sparkr.
Diffstat (limited to 'R/pkg/R/DataFrame.R')
-rw-r--r--R/pkg/R/DataFrame.R8
1 files changed, 4 insertions, 4 deletions
diff --git a/R/pkg/R/DataFrame.R b/R/pkg/R/DataFrame.R
index a5162de705..dd8126aebf 100644
--- a/R/pkg/R/DataFrame.R
+++ b/R/pkg/R/DataFrame.R
@@ -661,15 +661,15 @@ setMethod("collect",
# listCols is a list of columns
listCols <- callJStatic("org.apache.spark.sql.api.r.SQLUtils", "dfToCols", x@sdf)
stopifnot(length(listCols) == ncol)
-
+
# An empty data.frame with 0 columns and number of rows as collected
nrow <- length(listCols[[1]])
if (nrow <= 0) {
df <- data.frame()
} else {
- df <- data.frame(row.names = 1 : nrow)
+ df <- data.frame(row.names = 1 : nrow)
}
-
+
# Append columns one by one
for (colIndex in 1 : ncol) {
# Note: appending a column of list type into a data.frame so that
@@ -683,7 +683,7 @@ setMethod("collect",
# TODO: more robust check on column of primitive types
vec <- do.call(c, col)
if (class(vec) != "list") {
- df[[names[colIndex]]] <- vec
+ df[[names[colIndex]]] <- vec
} else {
# For columns of complex type, be careful to access them.
# Get a column of complex type returns a list.