sdf_standard_error: Calculate the standard error

Description Usage Arguments Value Examples

Description

This function will add an extra column on to a Spark DataFrame containing the standard error.

Usage

1
sdf_standard_error(sc, data, x_col, y_col, z_col, new_column_name)

Arguments

sc

A spark_connection.

data

A jobj: the Spark DataFrame on which to perform the function.

x_col

A string. The column to be used as X in the calculation.

y_col

A string. The column to be used as Y in the calculation.

z_col

A string. The column to be used as Z in the calculation.

new_column_name

A string. This is what the standard error column is called, it can be defaulted to "StandardError".

Value

Returns a jobj.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
## Not run: 
# Set up a spark connection
sc <- spark_connect(master = "local", version = "2.2.0")

# Extract some data
std_data <- spark_read_json(
  sc,
  "std_data",
  path = system.file(
    "data_raw/StandardErrorDataIn.json",
    package = "sparkts"
  )
) %>%
  spark_dataframe()

# Call the method
p <- sdf_standard_error(
  sc, std_data, x_col = "xColumn", y_col = "yColumn", z_col = "zColumn",
  new_column_name = "StandardError"
)

# Return the data to R
p %>% dplyr::collect()

spark_disconnect(sc = sc)

## End(Not run)

nathaneastwood/sparkts documentation built on May 25, 2019, 10:34 p.m.