Unable to read an SBML file in SBMLR - r

I'm trying to read a SBML file (Test.xml) using the R package SBMLR. Below is the code I executed.
library(SBMLR)
file <- system.file("models","Test.xml",package = "SBMLR")
doc <- readSBML(file)
When I execute the 3rd line I get an error message saying:
Error in xmlEventParse(filename, handlers = sbmlHandler(),
ignoreBlanks = TRUE) : File does not exist
I have tried to read the file using rsbml library as well.. But still I'm getting an error saying
Error: File unreadable.
I'm following this guide at the moment. Any help regarding the issue is highly appreciated!

Related

Error in 1:nrow(SM) : argument of length 0 for metadata file

Good day everyone
I am really struggling to get my metadata file in Rstudio for analysis. The import of the file is working perfectly fine, however, the moment I am trying to generate a phyloseq object this is the error I am getting: Error in 1:nrow(SM): argument of length 0.
My code:
# This is to import the file into Rstudio
metadata_ASV = read.table(file.choose(), header = TRUE, row.names = 1, sep = "\t")
I then check the form of the file
class(metadata_ASV)
The command below is the one I am using to generate the phyloseq object. This command did work previously but suddenly it is not working anymore.
ASV_sampledata = sample_data(metadata_ASV)
Any insight into what is causing the error:
Error in 1:nrow(SM): argument of length 0
Thank you in advance for any help on this.
Regards
Sunette

Why can I not load data from beginning.zip file

I am trying to load my R file but it keeps reading as errors and
Error in source("C:/Users/masters/OneDrive/Desktop/GCU/Business Analyst/Business Analyst/MIS-650/Beginning.csv") :
C:/Users/masters/OneDrive/Desktop/GCU/Business Analyst/Business Analyst/MIS-650/Beginning.csv:1:3: unexpected input
1: PK
loading through the Rstudio file open file method.
I am using the [Default] [64-bit] C:\Program Files\R\R-3.6.2 version, please help.
Try using read.csv
Something like this:
df <- read.csv('C:/Users/masters/OneDrive/Desktop/GCU/Business Analyst/Business Analyst/MIS-650/Beginning.csv')

How to eliminate security concern while accessing to the file through program in R in Windows?

While accessing to CSV file from disk with the help of the R program, where a path to the CSV file is provided in the configuration file ( A path is like "testData/Amazon S3/Inventory/Accounts.csv" which is provided in the Configuration file and cfig[2]$save.location is variable who is having value of this path accessed from Configuration file). Few lines of code are below
path <- cfig[2]$save.location
test_data <- fread(path,stringsAsFactors = FALSE,drop=col_ignor,blank.lines.skip = TRUE)
but it gave the message below:
Taking input= as a system command ('testData/Amazon
S3/Inventory/Accounts.csv') and a variable has been used in the
expression passed to input=. Please use fread(cmd=...). There is a
security concern if you are creating an app and the app could have a
malicious user and the app is not running in a secure environment;
e.g. the app is running as root. Please read item 5 in the NEWS file
for v1.11.6 for more information and for the option to suppress this
message.
'testData' is not recognized as an internal or external
command, operable program or batch file. Warning messages:
1: In (if
(.Platform$OS.type == "unix") system else shell)(paste0("(", :
'(testData/Amazon S3/Inventory/Accounts.csv) >
C:\Users\sharmb5\AppData\Local\Temp\RtmpOa25kH\filea78b5351f1'
execution failed with error code 1.
2: In fread(cfig[2]$save.location,
stringsAsFactors = FALSE, drop = col_ignor, : File
'C:\Users\sharmb5\AppData\Local\Temp\RtmpOa25kH\filea78b5351f1' has
size 0. Returning a NULL data.table.
when the following line of code executes,
config[4]$save.location <- stri_replace_all(config[4]$save.location, cp_val, fixed = cp_key)
It gives an error like as, Error in [<-.data.table(*tmp*, j, value = list(TestCaseID = "C419760", : Supplied 14 columns to be assigned 15 items. Please see NEWS for v1.12.2.
The above error was a warning but after manually updating of packages. This warning turns into an error. What will be the reason behind this issue and how to solve it? Thanks for Advance!!!

Error while trying to write a csv file

I'm trying to write a csv file in RStudio on a MacOS, but I'm getting this error:
Error: Failed to open '/Users/some.one/Documents/data'
and this is my code:
write_csv(dat, path_dat, na = "NA", append = FALSE, col_names = TRUE)
can someone maybe tell me what might cause such an error?
Edit:
dat ........... is a data frame
path_dat ...... is the path in the error : /Users/some.one/Documents/data
I would check that you have access to this directory. You can do via getwd()
If you don't, you can change the directory you're writing to via setwd(path_to_directory) and then run your write.csv function.

Error in ls(envir = envir, all.names = private)?

The below error keeps coming up inconsistently when I try to read excel files into R using the 'XLConnect' package.
Error in ls(envir = envir, all.names = private) :
invalid 'envir' argument
I have actually run into this error while even using other packages that read excel files like package 'xlsx' and 'xlsReadWrite'. Many times restarting the R session solves this problem, which leads me to think that something else I am doing in my R session is changing the environment and not allowing me to load excel files anymore. Below is the latest example of code that is causing this error. In this case I know that the following coding sequence is causing the error to appear - but why is that happening? And how can I get past this error if I need the chron package.
library("XLConnect")
wb2 <- loadWorkbook("excel_file", create = FALSE)
library(chron)
wb2 <- loadWorkbook("excel_file", create = FALSE)
Anyone else run into this issue before? Any help on this issue is greatly appreciated!
Before reopening the workbook try removing the reference to previously opened one, so:
rm(wb2)
wb2 <- loadWorkbook("excel_file", create = FALSE)
Also, make sure that "excel_file" is not open by excel or any other program while you run the R test.
I've seen the same error come up when using XLConnect and the above seemed to help.
Had this problem a couple of times and the call stack looks like this message is generated when a "OutOfMemory" Exception is thrown.
To solve this problem I used:
options( java.parameters = "-Xmx4g" )
to increase the heap size rJava is able to use.
Debugging with options(error=utils::recover) helped a lot, because the R error messages are not very specific.

Resources