Hello everyone,
I did some tests using the nodes List/Files Folders, Path to String, Table Row To Variable Loop Start and R Source Table (KNIME version 4.3.4) and the following snippet doesn’t work if the path contains any accentued characters, being the path from a local drive or from a network drive (a mapped share from a Linux’ Samba server, to be more specific about my use case).
# The foreign library provides access to many 3rd party data formats.
# Just a few examples are listed below, many others exist.
# More details cran.r-project.org/web/packages/foreign/foreign.pdf
library(foreign)
# map filepath from a flow variable here.
path = knime.flow.in[["Path_String"]]
# Read
data = read.dbf(path)
knime.out <- data
KNIME Console outputs Execute failed: Error in R code: Error: unable to open DBF file
, indicating a somewhat invalid path.
I say “somewhat invalid”, because if I manually declare the path inside the node, it just works, even with the accents, so I’m assuming that my GNU R (version 4.1.0) setup works fine, also strangely enough, if I compare a manually declared path with a automatically assigned path from a workflow variable (evaluating using something like path == pathmanual
), the output indicates that both are identical.
If both path were identical (they really are, but maybe a encoding problem is happening in the background and I can’t see it), the node should’ve run just fine. I’m puzzled and any help will be very appreciated.