This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Export File Error In R ?

Hi , I executed the following code with that error Error in basename(file) : a character vector argument expected . Any suggestions?

if (!requireNamespace("BiocManager"))
install.packages("BiocManager")
BiocManager::install()
library(CellNOptR)
network =readSIF("C:/Users/T440s/Desktop/network.sif")
file = file.create("C:/Users/T440s/Desktop/network.sbml") 
toSBML(network,file, bitString = c(rep(1,length(network$reacID))),version=c("standard","cellnopt"))
r software error

is file defined?

SURE I created one named file

Please share the line where you defined file

file = file.create("C:/Users/T440s/Desktop/network.sbml")

And just with :

toSBML(network,"C:/Users/T440s/Desktop/network.sbml", bitString = c(rep(1,length(network$reacID))),version=c("standard","cellnopt"))

To add to Bastien's point, the file argument to the CellNOptR::toSBML function is the name of the file to save to (according to the manual), which is a plain string.

file.create (as with all file manipulation operations of its class) returns a boolean value based on if the operation succeeded (see the relevant manual. You're passing a TRUE/FALSE value to a parameter than expects a filename string.

0 answers

No answers yet.

Log in to answer this question.