@@ -150,6 +150,27 @@ NULL
150
150
# ' df <- createDataFrame(cbind(model = rownames(mtcars), mtcars))}
151
151
NULL
152
152
153
+ # ' Miscellaneous functions for Column operations
154
+ # '
155
+ # ' Miscellaneous functions defined for \code{Column}.
156
+ # '
157
+ # ' @param x Column to compute on. In \code{sha2}, it is one of 224, 256, 384, or 512.
158
+ # ' @param y Column to compute on.
159
+ # ' @param ... additional Columns.
160
+ # ' @name column_misc_functions
161
+ # ' @rdname column_misc_functions
162
+ # ' @family misc functions
163
+ # ' @examples
164
+ # ' \dontrun{
165
+ # ' # Dataframe used throughout this doc
166
+ # ' df <- createDataFrame(cbind(model = rownames(mtcars), mtcars)[, 1:2])
167
+ # ' tmp <- mutate(df, v1 = crc32(df$model), v2 = hash(df$model),
168
+ # ' v3 = hash(df$model, df$mpg), v4 = md5(df$model),
169
+ # ' v5 = sha1(df$model), v6 = sha2(df$model, 256))
170
+ # ' head(tmp)
171
+ # ' }
172
+ NULL
173
+
153
174
# ' @details
154
175
# ' \code{lit}: A new Column is created to represent the literal value.
155
176
# ' If the parameter is a Column, it is returned unchanged.
@@ -569,19 +590,13 @@ setMethod("count",
569
590
column(jc )
570
591
})
571
592
572
- # ' crc32
573
- # '
574
- # ' Calculates the cyclic redundancy check value (CRC32) of a binary column and
575
- # ' returns the value as a bigint.
576
- # '
577
- # ' @param x Column to compute on.
593
+ # ' @details
594
+ # ' \code{crc32}: Calculates the cyclic redundancy check value (CRC32) of a binary column
595
+ # ' and returns the value as a bigint.
578
596
# '
579
- # ' @rdname crc32
580
- # ' @name crc32
581
- # ' @family misc functions
582
- # ' @aliases crc32,Column-method
597
+ # ' @rdname column_misc_functions
598
+ # ' @aliases crc32 crc32,Column-method
583
599
# ' @export
584
- # ' @examples \dontrun{crc32(df$c)}
585
600
# ' @note crc32 since 1.5.0
586
601
setMethod ("crc32 ",
587
602
signature(x = " Column" ),
@@ -590,19 +605,13 @@ setMethod("crc32",
590
605
column(jc )
591
606
})
592
607
593
- # ' hash
594
- # '
595
- # ' Calculates the hash code of given columns, and returns the result as a int column.
596
- # '
597
- # ' @param x Column to compute on.
598
- # ' @param ... additional Column(s) to be included.
608
+ # ' @details
609
+ # ' \code{hash}: Calculates the hash code of given columns, and returns the result
610
+ # ' as an int column.
599
611
# '
600
- # ' @rdname hash
601
- # ' @name hash
602
- # ' @family misc functions
603
- # ' @aliases hash,Column-method
612
+ # ' @rdname column_misc_functions
613
+ # ' @aliases hash hash,Column-method
604
614
# ' @export
605
- # ' @examples \dontrun{hash(df$c)}
606
615
# ' @note hash since 2.0.0
607
616
setMethod ("hash ",
608
617
signature(x = " Column" ),
@@ -1055,19 +1064,13 @@ setMethod("max",
1055
1064
column(jc )
1056
1065
})
1057
1066
1058
- # ' md5
1059
- # '
1060
- # ' Calculates the MD5 digest of a binary column and returns the value
1067
+ # ' @details
1068
+ # ' \code{md5}: Calculates the MD5 digest of a binary column and returns the value
1061
1069
# ' as a 32 character hex string.
1062
1070
# '
1063
- # ' @param x Column to compute on.
1064
- # '
1065
- # ' @rdname md5
1066
- # ' @name md5
1067
- # ' @family misc functions
1068
- # ' @aliases md5,Column-method
1071
+ # ' @rdname column_misc_functions
1072
+ # ' @aliases md5 md5,Column-method
1069
1073
# ' @export
1070
- # ' @examples \dontrun{md5(df$c)}
1071
1074
# ' @note md5 since 1.5.0
1072
1075
setMethod ("md5 ",
1073
1076
signature(x = " Column" ),
@@ -1307,19 +1310,13 @@ setMethod("second",
1307
1310
column(jc )
1308
1311
})
1309
1312
1310
- # ' sha1
1311
- # '
1312
- # ' Calculates the SHA-1 digest of a binary column and returns the value
1313
+ # ' @details
1314
+ # ' \code{sha1}: Calculates the SHA-1 digest of a binary column and returns the value
1313
1315
# ' as a 40 character hex string.
1314
1316
# '
1315
- # ' @param x Column to compute on.
1316
- # '
1317
- # ' @rdname sha1
1318
- # ' @name sha1
1319
- # ' @family misc functions
1320
- # ' @aliases sha1,Column-method
1317
+ # ' @rdname column_misc_functions
1318
+ # ' @aliases sha1 sha1,Column-method
1321
1319
# ' @export
1322
- # ' @examples \dontrun{sha1(df$c)}
1323
1320
# ' @note sha1 since 1.5.0
1324
1321
setMethod ("sha1 ",
1325
1322
signature(x = " Column" ),
@@ -2309,19 +2306,14 @@ setMethod("format_number", signature(y = "Column", x = "numeric"),
2309
2306
column(jc )
2310
2307
})
2311
2308
2312
- # ' sha2
2313
- # '
2314
- # ' Calculates the SHA-2 family of hash functions of a binary column and
2315
- # ' returns the value as a hex string .
2309
+ # ' @details
2310
+ # ' \code{sha2}: Calculates the SHA-2 family of hash functions of a binary column and
2311
+ # ' returns the value as a hex string. The second argument \code{x} specifies the number
2312
+ # ' of bits, and is one of 224, 256, 384, or 512 .
2316
2313
# '
2317
- # ' @param y column to compute SHA-2 on.
2318
- # ' @param x one of 224, 256, 384, or 512.
2319
- # ' @family misc functions
2320
- # ' @rdname sha2
2321
- # ' @name sha2
2322
- # ' @aliases sha2,Column,numeric-method
2314
+ # ' @rdname column_misc_functions
2315
+ # ' @aliases sha2 sha2,Column,numeric-method
2323
2316
# ' @export
2324
- # ' @examples \dontrun{sha2(df$c, 256)}
2325
2317
# ' @note sha2 since 1.5.0
2326
2318
setMethod ("sha2 ", signature(y = "Column", x = "numeric"),
2327
2319
function (y , x ) {
0 commit comments