Learn R Programming

rIACI (version 1.0.0)

export_data_to_csv: Export Data to CSV Function

Description

Exports data from a NetCDF file to CSV files, one for each latitude and longitude point, including only points where data is present. This function utilizes a Python script to perform the data processing.

Usage

export_data_to_csv(nc_file, output_dir)

Value

None. CSV files are saved to the specified output directory.

Arguments

nc_file

Character. Path to the NetCDF file.

output_dir

Character. Output directory where CSV files will be saved.

Details

The function calls a Python script using the `reticulate` package to process the NetCDF file. The Python script `data_processing.py` should be located in the `python` directory of the `rIACI` package. Only grid points with available data are exported to CSV files. Each CSV file corresponds to a specific latitude and longitude point.

Examples

Run this code
if (FALSE) {
# Example usage of export_data_to_csv
netcdf_file <- "/path/to/processed_data.nc"
csv_output_directory <- "/path/to/csv_output"
export_data_to_csv(nc_file = netcdf_file, output_dir = csv_output_directory)
}

Run the code above in your browser using DataLab