Fixed issue #8917: Error in R Export plugin - patch by peterhol