Description Usage Arguments Value Examples
This function will add an extra column on to a Spark DataFrame containing the standard error.
1 | sdf_standard_error(sc, data, x_col, y_col, z_col, new_column_name)
|
sc |
A |
data |
A |
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". |
Returns a jobj
.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.