Icon

kn_​example_​r_​read_​single_​csv_​file

use R library(readr) to read (messy) CSV file into KNIME

use R library(readr) to read (messy) CSV file into KNIME

Export the data to SQLite, ARFF and Parquet and demonstrate to read the files back into KNIME

use R library(readr) to read (messy) CSV file into KNIMEExport the data to SQLite, ARFF and Parquet and demonstrate to read the files back into KNIME https://forum.knime.com/t/trouble-loading-data-with-csv-reader/20135/10?u=mlauber71 library(arrow)library(RSQLite)library(foreign)library(readr)file_location <- knime.flow.in[["v_path_csv_file"]]# enter the correct delimiter like , comma ; semicolon, | pipedf <- as.data.frame(read_delim(file_location, delim=";", col_names = TRUE))# ----- location of SQLite Database# define some basic variablesvar_loc_sqlite <- paste0(knime.flow.in[["var_path_data"]], "db.sqlite")con = dbConnect(drv=RSQLite::SQLite(), dbname=var_loc_sqlite)dbWriteTable(con, "test_file", df, overwrite = TRUE)# export as ARFF filevar_loc_arff <- paste0(knime.flow.in[["var_path_data"]], "test_file.arff")write.arff(df, var_loc_arff, eol = "\n")# export file as parquetvar_loc_parquet <- paste0(knime.flow.in[["var_path_data"]], "test_file.parquet")write_parquet(df, var_loc_parquet)# bring data back to KNIMEknime.out <- dfdbDisconnect(con) library(readr)file_location <- knime.flow.in[["v_path_csv_file"]]# enter the correct delimiter like , comma ; semicolon, | pipeknime.out <- as.data.frame(read_delim(file_location, delim=";", col_names = TRUE)) KNIME and R — installation across operating systems — some remarkshttps://medium.com/p/6494a2a498cc locate and create/data/ folderwith absolute pathsv_path_csv_filedummy dataread CSV fileknime://knime.workflow/data/db.sqlitedefault.test_fileknime://knime.workflow/data/test_file.arffread CSV file andexport to KNIME, SQLite and ARFFv_path*test_file.csv/data/test_file.tableknime://knime.workflow/data/test_file.parquet Collect LocalMetadata Java EditVariable (simple) Data Generator R Source (Table) SQLite Connector DB Table Selector DB Reader ARFF Reader R Source (Table) String to Path(Variable) CSV Writer Table Writer Parquet Reader use R library(readr) to read (messy) CSV file into KNIMEExport the data to SQLite, ARFF and Parquet and demonstrate to read the files back into KNIME https://forum.knime.com/t/trouble-loading-data-with-csv-reader/20135/10?u=mlauber71 library(arrow)library(RSQLite)library(foreign)library(readr)file_location <- knime.flow.in[["v_path_csv_file"]]# enter the correct delimiter like , comma ; semicolon, | pipedf <- as.data.frame(read_delim(file_location, delim=";", col_names = TRUE))# ----- location of SQLite Database# define some basic variablesvar_loc_sqlite <- paste0(knime.flow.in[["var_path_data"]], "db.sqlite")con = dbConnect(drv=RSQLite::SQLite(), dbname=var_loc_sqlite)dbWriteTable(con, "test_file", df, overwrite = TRUE)# export as ARFF filevar_loc_arff <- paste0(knime.flow.in[["var_path_data"]], "test_file.arff")write.arff(df, var_loc_arff, eol = "\n")# export file as parquetvar_loc_parquet <- paste0(knime.flow.in[["var_path_data"]], "test_file.parquet")write_parquet(df, var_loc_parquet)# bring data back to KNIMEknime.out <- dfdbDisconnect(con) library(readr)file_location <- knime.flow.in[["v_path_csv_file"]]# enter the correct delimiter like , comma ; semicolon, | pipeknime.out <- as.data.frame(read_delim(file_location, delim=";", col_names = TRUE)) KNIME and R — installation across operating systems — some remarkshttps://medium.com/p/6494a2a498cc locate and create/data/ folderwith absolute pathsv_path_csv_filedummy dataread CSV fileknime://knime.workflow/data/db.sqlitedefault.test_fileknime://knime.workflow/data/test_file.arffread CSV file andexport to KNIME, SQLite and ARFFv_path*test_file.csv/data/test_file.tableknime://knime.workflow/data/test_file.parquetCollect LocalMetadata Java EditVariable (simple) Data Generator R Source (Table) SQLite Connector DB Table Selector DB Reader ARFF Reader R Source (Table) String to Path(Variable) CSV Writer Table Writer Parquet Reader

Nodes

Extensions

Links