sbmlteam / libsbml

LibSBML is a native library for reading, writing and manipulating files and data streams containing the Systems Biology Markup Language (SBML). It offers language bindings for C, C++, C#, Java, JavaScript, MATLAB, Perl, PHP, Python, R and Ruby.

Home Page:https://sbml.org/software/libsbml

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

libSBML R package power function is pow() instead of ^

LeonieLorenz opened this issue · comments

When reading in an SBML file that contains a rule with the power function (), the R package translates it into pow(x,y) which is not defined in R. Instead you would want the result to be x^y or x**y.


Here is a snippet from the SBML model that I am reading and the resulting R code below.

SBML (from BioModels BIOMD0000000982):

beta_0 1 p time

R (based on libSBML tutorial):

formulaToString( Rule_getMath(Model_getRule(m,5)))
[1] "beta_0 * pow(1 - p, time)"