112112# ' df <- createDataFrame(cbind(model = rownames(mtcars), mtcars))
113113# ' tmp <- mutate(df, v1 = log(df$mpg), v2 = cbrt(df$disp),
114114# ' v3 = bround(df$wt, 1), v4 = bin(df$cyl),
115- # ' v5 = hex(df$wt), v6 = toDegrees (df$gear),
115+ # ' v5 = hex(df$wt), v6 = degrees (df$gear),
116116# ' v7 = atan2(df$cyl, df$am), v8 = hypot(df$cyl, df$am),
117117# ' v9 = pmod(df$hp, df$cyl), v10 = shiftLeft(df$disp, 1),
118118# ' v11 = conv(df$hp, 10, 16), v12 = sign(df$vs - 0.5),
@@ -320,23 +320,37 @@ setMethod("acos",
320320 })
321321
322322# ' @details
323- # ' \code{approxCountDistinct }: Returns the approximate number of distinct items in a group.
323+ # ' \code{approx_count_distinct }: Returns the approximate number of distinct items in a group.
324324# '
325325# ' @rdname column_aggregate_functions
326- # ' @aliases approxCountDistinct approxCountDistinct ,Column-method
326+ # ' @aliases approx_count_distinct approx_count_distinct ,Column-method
327327# ' @examples
328328# '
329329# ' \dontrun{
330- # ' head(select(df, approxCountDistinct (df$gear)))
331- # ' head(select(df, approxCountDistinct (df$gear, 0.02)))
330+ # ' head(select(df, approx_count_distinct (df$gear)))
331+ # ' head(select(df, approx_count_distinct (df$gear, 0.02)))
332332# ' head(select(df, countDistinct(df$gear, df$cyl)))
333333# ' head(select(df, n_distinct(df$gear)))
334334# ' head(distinct(select(df, "gear")))}
335+ # ' @note approx_count_distinct(Column) since 3.0.0
336+ setMethod ("approx_count_distinct ",
337+ signature(x = " Column" ),
338+ function (x ) {
339+ jc <- callJStatic(" org.apache.spark.sql.functions" , " approx_count_distinct" , x @ jc )
340+ column(jc )
341+ })
342+
343+ # ' @details
344+ # ' \code{approxCountDistinct}: Returns the approximate number of distinct items in a group.
345+ # '
346+ # ' @rdname column_aggregate_functions
347+ # ' @aliases approxCountDistinct approxCountDistinct,Column-method
335348# ' @note approxCountDistinct(Column) since 1.4.0
336349setMethod ("approxCountDistinct ",
337350 signature(x = " Column" ),
338351 function (x ) {
339- jc <- callJStatic(" org.apache.spark.sql.functions" , " approxCountDistinct" , x @ jc )
352+ .Deprecated(" approx_count_distinct" )
353+ jc <- callJStatic(" org.apache.spark.sql.functions" , " approx_count_distinct" , x @ jc )
340354 column(jc )
341355 })
342356
@@ -1651,7 +1665,22 @@ setMethod("tanh",
16511665setMethod ("toDegrees ",
16521666 signature(x = " Column" ),
16531667 function (x ) {
1654- jc <- callJStatic(" org.apache.spark.sql.functions" , " toDegrees" , x @ jc )
1668+ .Deprecated(" degrees" )
1669+ jc <- callJStatic(" org.apache.spark.sql.functions" , " degrees" , x @ jc )
1670+ column(jc )
1671+ })
1672+
1673+ # ' @details
1674+ # ' \code{degrees}: Converts an angle measured in radians to an approximately equivalent angle
1675+ # ' measured in degrees.
1676+ # '
1677+ # ' @rdname column_math_functions
1678+ # ' @aliases degrees degrees,Column-method
1679+ # ' @note degrees since 3.0.0
1680+ setMethod ("degrees ",
1681+ signature(x = " Column" ),
1682+ function (x ) {
1683+ jc <- callJStatic(" org.apache.spark.sql.functions" , " degrees" , x @ jc )
16551684 column(jc )
16561685 })
16571686
@@ -1665,7 +1694,22 @@ setMethod("toDegrees",
16651694setMethod ("toRadians ",
16661695 signature(x = " Column" ),
16671696 function (x ) {
1668- jc <- callJStatic(" org.apache.spark.sql.functions" , " toRadians" , x @ jc )
1697+ .Deprecated(" radians" )
1698+ jc <- callJStatic(" org.apache.spark.sql.functions" , " radians" , x @ jc )
1699+ column(jc )
1700+ })
1701+
1702+ # ' @details
1703+ # ' \code{radians}: Converts an angle measured in degrees to an approximately equivalent angle
1704+ # ' measured in radians.
1705+ # '
1706+ # ' @rdname column_math_functions
1707+ # ' @aliases radians radians,Column-method
1708+ # ' @note radians since 3.0.0
1709+ setMethod ("radians ",
1710+ signature(x = " Column" ),
1711+ function (x ) {
1712+ jc <- callJStatic(" org.apache.spark.sql.functions" , " radians" , x @ jc )
16691713 column(jc )
16701714 })
16711715
@@ -2065,13 +2109,24 @@ setMethod("pmod", signature(y = "Column"),
20652109
20662110# ' @param rsd maximum estimation error allowed (default = 0.05).
20672111# '
2112+ # ' @rdname column_aggregate_functions
2113+ # ' @aliases approx_count_distinct,Column-method
2114+ # ' @note approx_count_distinct(Column, numeric) since 3.0.0
2115+ setMethod ("approx_count_distinct ",
2116+ signature(x = " Column" ),
2117+ function (x , rsd = 0.05 ) {
2118+ jc <- callJStatic(" org.apache.spark.sql.functions" , " approx_count_distinct" , x @ jc , rsd )
2119+ column(jc )
2120+ })
2121+
20682122# ' @rdname column_aggregate_functions
20692123# ' @aliases approxCountDistinct,Column-method
20702124# ' @note approxCountDistinct(Column, numeric) since 1.4.0
20712125setMethod ("approxCountDistinct ",
20722126 signature(x = " Column" ),
20732127 function (x , rsd = 0.05 ) {
2074- jc <- callJStatic(" org.apache.spark.sql.functions" , " approxCountDistinct" , x @ jc , rsd )
2128+ .Deprecated(" approx_count_distinct" )
2129+ jc <- callJStatic(" org.apache.spark.sql.functions" , " approx_count_distinct" , x @ jc , rsd )
20752130 column(jc )
20762131 })
20772132
0 commit comments