Forum

Using R in external scripts
Multiple Poster
Offline
User avatar
Posts: 5
Joined: Tue May 03, 2016 10:10 am

R Passing NA's in data frame to Kognitio - External Script

by awilliams » Fri Jan 06, 2017 2:59 pm

Was stumped on this issue for longer than I care to admit but it is fairy simple to solve passing NA values within R data frames to Kognitio as NULL values when using external scripts.

Given df

A | B
--|------------
--| 1 | NA

and you want to "write it back" to kognitio, where column B is declared as an INT, through stdout you would simply use the following

write.table(x, row.names = FALSE, col.names = FALSE, sep = ",", na = "")

The import parameter being na = "".

Again its a simple solution - and I am sure there are more (efficient for larger df's?)

One issue I havent found a solution for - passing back multiple data frames. Unsure if this is even possible.
Reply with quote Top

Who is online

Users browsing this forum: No registered users and 1 guest

cron