R-Lum/rxylib

Add block names to output

JohannesFriedrich opened this issue · 6 comments

In xylib it is possible to set names for blocks. Until now these names are not exported to R. I wrote a C++ function get_block_names.cpp to extract them from files (if available), see commit caf5906.

The question is: how to store them? In metadata? In an extra slot? Should the names be exported automatically or with an extra argument?

The block can store metadata, so it should be stored here. I'll check it how to implement it best.

Please check whether this is ok for you. Thanks.

Thanks for your work, Sebastian!
The print method works well, but when there are no block names, the plot method fails:

results <- read_xyData("https://cbc-wb01x.chemistry.ohio-state.edu/~woodward/ceo2br.cpi")
plot(results)

Error in ans[test & ok] <- rep(yes, length.out = length(ans))[test & ok] :
replacement has length zero 0

I think its a problem with the ifelse structure in line 85 in methods_rxylib.R (when asking Google for that error message)

Yeah, the problem comes from (?ifelse)

returns a value with the same shape as test which is filled with elements selected from either yes or no depending on whether the element of test is TRUE or FALSE.

It is a little bit tricky ... fixed.

So the tests seem to work, implemented then.

Works perfect!