Problems with installing the SSOAP package on R

Asked

Viewed 119 times

0

I’m trying to install the package SSOAP in the software R and receive as return the following error message:

ERROR: dependency 'Xmlschema' is not available for package 'SSOAP' * removing ' srvfcmfile/documents$/2437/My Documents/R/win-library/3.6/SSOAP' Warning in install.Packages : installation of package ːC:/Users/2437/Desktop/FORMAO~1/MACROE~1/61E21~1.MOD/SSOAP_0.9-0(1).tar.gz' had non-zero Exit status

I searched about the bug and the package and from what I understood this was removed.

The part of code I’m trying to run is this:

wsdl <- getURL("https://www3.bcb.gov.br/sgspub/JSP/sgsgeral/FachadaWSSGS.wsdl", 
           ssl.verifypeer = FALSE)
doc  <- xmlInternalTreeParse(wsdl)

def <- processWSDL(doc)
ff  <- genSOAPClientInterface(def = def)

processWSDL and genSOAPClientInterface depend on SSOAP.

I would like to know if there is any other package that replaces SSOAP so I can run what I need.

  • You can fetch the Xmlschema package from cran files or to the Omegahat (the link is in the version number).

  • @Noisy The Xmlschema package I had already tried to install previously, and it returns error too.

  • Done, see the answer.

3 answers

0

To install R packages that are not available for the R version you are running, go see if they are in cran files.

Then there are several ways to install these packages. I will assume that the user downloaded the files .tar.gz and that these are in a local directory.

The following works on Ubuntu 19.04.

old_dir <- getwd()
setwd('~/um/caminho/para/as/transferencias')

file_xmlschema <- list.files(pattern = '^XMLSchema_.*\\.tar\\.gz')
install.packages(file_xmlschema, repos = NULL, type = "source")

file_ssoap <- list.files(pattern = '^SSOAP_.*\\.tar\\.gz')
install.packages(file_ssoap, repos = NULL, type = "source")

setwd(old_dir)

Ready, the packages are installed. Now I will run the question code.

library(SSOAP)
library(RCurl)
library(XML)

wsdl <- getURL("https://www3.bcb.gov.br/sgspub/JSP/sgsgeral/FachadaWSSGS.wsdl", 
               ssl.verifypeer = FALSE)
doc  <- xmlInternalTreeParse(wsdl)

def <- processWSDL(doc)

There Were 12 warnings (use warnings() to see them)

All warning messages are identical. It means that the function code should be updated to provide a list without elements.

warnings()

Warning messages:
1: In Structure(unlist(v[i]), Names = sapply(v[i], Names)) : Calling 'Structure(NULL, *)' is deprecated, as NULL cannot have Attributes.
Consider 'Structure(list(), *)' Instead.

ff  <- genSOAPClientInterface(def = def)
  • packages did not install the same way. How to update the function code? Sometimes it is possible to perform the same operation using another package.

  • @Letíciamarrara It is said that packages did not install, the problem is not in the function, it must be in the instructions you used to install the packages. You can edit the question with the code used for this?

  • The SSOAP package is installing normally on your machine?

  • @Yes, it is. Just like you said in the answer.

  • I believe the problem is there then. Pq on my machine does not install. Or you found some other problem in the code?

  • @When the first one runs install.packages of my answer gives error? If yes?

Show 1 more comment

0

library(XML)

library(RCurl)

old_dir <- getwd()
setwd('~/um/caminho/para/as/transferencias') #adicionei aqui o diretório utilizado, conforme me explicou acima.

file_xmlschema <- list.files(pattern = '^XMLSchema_.*\\.tar\\.gz')
install.packages(file_xmlschema, repos = NULL, type = "source")

file_ssoap <- list.files(pattern = '^SSOAP_.*\\.tar\\.gz')
install.packages(file_ssoap, repos = NULL, type = "source")

setwd(old_dir)

wsdl <- getURL("https://www3.bcb.gov.br/sgspub/JSP/sgsgeral/FachadaWSSGS.wsdl", 
               ssl.verifypeer = FALSE)
doc  <- xmlInternalTreeParse(wsdl)

def <- processWSDL(doc)
ff  <- genSOAPClientInterface(def = def)

inicio <- '01/01/1999'

fim <- '04/09/2015'

getSeries <- function(codigos, data.ini = inicio, data.fim = fim, remove.old = TRUE) {
  xmlstr <- ff@functions$getValoresSeriesXML(codigos, data.ini, data.fim, 
                                             .opts = list(ssl.verifypeer = FALSE))
  doc <- xmlInternalTreeParse(xmlstr)

  cleanup <- xpathApply(doc,"//SERIE", function(s) {
    id <- xmlGetAttr(s, "ID")
    s1 <- xmlSApply(s, function(x) xmlSApply(x, xmlValue))
    s1 <- t(s1)
    dimnames(s1) <- list(NULL, dimnames(s1)[[2]])
    df <- as.data.frame(s1, stringsAsFactors=FALSE)
    df$SERIE <- id
    df
  })
  df <- Reduce(rbind, cleanup)

  df$data  <- as.Date(sapply(strsplit(df$DATA,  "/"),
                             function(x) paste(c(x[2:1], 1), collapse="-")), "%Y-%m-%d")
  df$valor <- as.numeric(df$VALOR)
  df$serie <- factor(df$SERIE)

  if(remove.old){
    df$BLOQUEADO <- NULL
    df$SERIE <- NULL
    df$DATA <- NULL
    df$VALOR <- NULL
  }
  df
}

This is the code I need to run.

0

This mistake

  • stalling source package 'Xmlschema' ... ** package 'Xmlschema' successfully unpacked and MD5 sums checked ** using staged installation ** R ** Inst ** byte-Compile and prepare package for Lazy loading Error in findpack(package, lib.Loc) : there is no package called 'Xmlschema' Calls: -> findpack Execution interrupted ERROR: Lazy loading failed for package 'Xmlschema'
  • removing ' srvfcmfile/documents$/2437/My Documents/R/win-library/3.6/Xmlschema' Warning in install.Packages : installation of package ːXmlschema_0.6-1.tar.gz' had non-zero Exit status
  • stalling source package 'Xmlschema' ... ** package 'Xmlschema' successfully unpacked and MD5 sums checked ** using staged installation ** R ** Inst ** byte-Compile and prepare package for Lazy loading Error in findpack(package, lib.Loc) : there is no package called 'Xmlschema' Calls: -> findpack Execution interrupted ERROR: Lazy loading failed for package 'Xmlschema'
  • removing ' srvfcmfile/documents$/2437/My Documents/R/win-library/3.6/Xmlschema' Warning in install.Packages : installation of package ːXmlschema_0.7-0.tar.gz' had non-zero Exit status
  • @Noisy this is the error that appears

  • What is the operating system? If Windows needs the Rtools installed to compile the source code.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.