Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add block names to output #3

Closed
JohannesFriedrich opened this issue Jul 18, 2017 · 6 comments
Closed

Add block names to output #3

JohannesFriedrich opened this issue Jul 18, 2017 · 6 comments
Assignees

Comments

@JohannesFriedrich
Copy link

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?

@RLumSK
Copy link
Member

RLumSK commented Jul 18, 2017

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

RLumSK added a commit that referenced this issue Jul 18, 2017
@RLumSK
Copy link
Member

RLumSK commented Jul 18, 2017

Please check whether this is ok for you. Thanks.

@JohannesFriedrich
Copy link
Author

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)

@RLumSK
Copy link
Member

RLumSK commented Jul 19, 2017

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.

@RLumSK
Copy link
Member

RLumSK commented Jul 19, 2017

So the tests seem to work, implemented then.

@RLumSK RLumSK closed this as completed Jul 19, 2017
@JohannesFriedrich
Copy link
Author

Works perfect!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants