Use SpotfireData package with non-TERR R engine - r

I want to read in Spotfire Binary data into a non-TERR R engine that can handle graphing and other complex packages, etc. So I want to use the SpotfireData package with other non-TERR R engines. Yet when I try to install, I get an error:
install.packages("SpotfireData")
Warning in install.packages :
package ‘SpotfireData’ is not available (for R version 3.4.4)
Has anyone had luck using the SpotfireData package outside of TERR?
I'm using:
> version
_
platform x86_64-w64-mingw32
arch x86_64
os mingw32
system x86_64, mingw32
status
major 3
minor 4.4
year 2018
month 03
day 15
svn rev 74408
language R
version.string R version 3.4.4 (2018-03-15)
nickname Someone to Lean On
Also, when I switch engines to R3.4.3, I get the same error:
install.packages("SpotfireData")
Warning in install.packages :
package ‘SpotfireData’ is not available (for R version 3.4.3)
Also, when I copy/paste the actual SpotfireData package folder into my R3.4.4 library, I get this error:
library(SpotfireData)
Error in library(SpotfireData) :
‘SpotfireData’ is not a valid installed package

An alternative method is to write a simple data function that Spotfire calls using TERR to save the data from Spotfire into R format and then read that file into R.
Lots more info here: https://community.tibco.com/wiki/tips-debugging-tibco-enterprise-runtime-r-scripts-tibco-spotfire-dataexpression-functions
Here's the important part from that page:
To do this, add a line of code to the top of the R script to save the input parameters to an RData file:
save(list=ls(), file="C:/debug.RData", RFormat=TRUE)
Then, in RStudio or the TERR console, load the RData file and run the R script so that the exact same inputs are used as when the R script ran in the TERR data function.
load(file="C:/debug.RData")

I'm not aware of an easy way to do this - TIBCO don't publish the packages to a repository that I know of.
If you have Spotfire Statistics Services you can find the binary packages under the installation directory - in the 'update\R\src\contrib' folder. Copy the SpotfireData_<ver>.tar.gz file to your machine and then install directly from that file. I've personally used this approach.
To install the library from the file use the 'install.packages' command with the filename, similar to below:
install.packages("c:/users/xxxxxx/Downloads/SpotfireData_9.12.0-63.tar.gz",repos=NULL)
You will also need to have the Rtools installed so it can compile the package from source - check on cran.r-project.org and download the appropriate Rtools for your version.

Related

Is it ok that installing package gives a warning: package ‘...’ was built under R version 3.3.2? [duplicate]

I am creating my own R package which depends on a function defined in R-package named fOption.
My NAMESPACE file has a line:
import(fOptions)
My DESCRIPTION file has a line:
Depends: fOptions
However, when I compile my R package using R CMD CHECL --as-cran option from the terminal, I get the following warning messages:
Found the following significant warnings:
Warning: package ‘timeDate’ was built under R version 3.1.2
Warning: package ‘timeSeries’ was built under R version 3.1.2
Warning: package ‘fBasics’ was built under R version 3.1.2
I found that these are dependencies of fOptions as its description file says:
Depends: methods, timeDate, timeSeries, fBasics
Does this mean that I cannot create my R package that depend on this particular R package (fOption)?
I am using OS X Version 10.9.4 and My R version is 3.1.1 (2014-07-10) -- "Sock it to Me".
Those are warnings, not errors, which means you can proceed but it's better if you address them.
In this case, you're getting the warnings because a few of the packages you need were built using an R version that is newer than the R version you are running. This can potentially be a problem, though it's likely not a problem, hence it's just a warning. If any of those packages have a different behaviour in the newer R version, for example, this would be critical, though that's likely not the case.
I would suggest updating your R version to 3.1.2, and that would get rid of these warnings plus you'll have a newer R version :) If you are working in an environment where you cannot update R, then it's fine, you can go on with your package with these warnings, it's just non-ideal.
My R was an environment within Anaconda - I was able to avoid this error by updating R as follows:
Open Anaconda Command line (this takes you to the base environment)
(base) C:\Users\grant>
Find the path to your R environment by running the following command:
(base) C:\Users\grant>conda envs
output:
# conda environments:
#
base * C:\Users\grant\Anaconda3
Python2p7 C:\Users\grant\Anaconda3\envs\Python2p7
R C:\Users\grant\Anaconda3\envs\R
rstudio C:\Users\grant\Anaconda3\envs\rstudio
Using the above path - activate your R environment:
(base) C:\Users\grant>activate C:\Users\grant\Anaconda3\envs\R
Now that your R environment is active - you can update your version of R as follows:
(R) C:\Users\grant>conda update r-caret

how can I find the base R installation on ubuntu?

I installed both the Microsoft R Open and base R (CRAN) on my linux desktop. But I can't find where my base R was installed now. Is there a way I can find this out?
When I type R in terminal I get the following because /usr/bin/R points to my MRO install.
Microsoft R Open 3.2.3
Default CRAN mirror snapshot taken on 2016-01-01
The enhanced R distribution from Microsoft
Visit http://go.microsoft.com/fwlink/?LinkID=722555 for information
about additional features.
Multithreaded BLAS/LAPACK libraries detected. Using 4 cores for math algorithms.
[Previously saved workspace restored]
> R.home()
[1] "/usr/lib64/MRO-3.2.3/R-3.2.3/lib/R"
I just want to know how I can access my CRAN R install again.
Thanks!

Error in installing packages from RStudio

I have been trying to install the package "doby" from RStudio (ver 0.98.501 ) on ubuntu 13.04 but it keeps throwing the following warning and the package does not get installed.
Warning in install.packages :
package ‘doBy’ is not available (for R version 2.15.2)
I have followed all the instructions given here :
http://www.r-bloggers.com/installing-r-packages/
Can someone please suggest where I might be going wrong ?
If you are on Ubuntu, please see this README for Ubuntu from CRAN --- it will allow you to get to the current version of R (today 3.0.2, in a few days 3.0.3) with mininal effort.
Once you have a current R version, getting the doBy package (which depends on it) installed is a piece of cake too.
If however you prefer to stay with your version of R, you can manually fetch an older version of doBy from its CRAN archive. Download to, say, /tmp and run R CMD INSTALLby hand on it.
From http://cran.r-project.org/web/packages/doBy/index.html, package doBy depends on R version 3.0 and above. Your R version is 2.15.2. You will need to install a later version of R, and then change the settings in Rstudio to target the updated version.

Error in R CMD Check: Packages required but not available

I am trying to create a package. It depends on several packages. I added the imports to the namespace file and the Depends in the description file.
I found possible solutions here and here, but these didn't work- I think because I am on CentOS.
This is what I see on my screen:
[hadoop#localhost RProjects]$ sudo R CMD check TextPreProcess
* using log directory ‘/home/hadoop/RProjects/TextPreProcess.Rcheck’
* using R version 2.15.1 (2012-06-22)
* using platform: x86_64-redhat-linux-gnu (64-bit)
* using session charset: UTF-8
* checking for file ‘TextPreProcess/DESCRIPTION’ ... OK
* checking extension type ... Package
* this is package ‘TextPreProcess’ version ‘1.0’
* checking package namespace information ... OK
* checking package dependencies ... ERROR
Packages required but not available:
‘RWeka’ ‘Snowball’ ‘lsa’ ‘plyr’ ‘snowfall’ ‘tau’ ‘tm’
See the information on DESCRIPTION files in the chapter ‘Creating R
packages’ of the ‘Writing R Extensions’ manual.
I went through Writing R Extentions but I couldn't derive a lot of insight as to how to solve my problem.
It's working now.
What I did was:
add ~/R/x86_64-redhat-linux-gnu-library/2.15 to .libPaths (That's where my R library was)
Detach all libraries in R
Restart the R session. (For multiple sessions, close all of them.)
install the required packages.
Check if the Imports & Exports are correct in the namespace file.
Check if the required fields are available in the Description file. Make sure all dependencies are handled between 'Depends', 'Imports', 'Suggests' and 'Enhances'.
Checked it. R CMD check <pkg>. Built it. R CMD build <pkg>. Installed it. R CMD INSTALL <tarball>.
Done.
I had the same problem because packages were installed but for different R versions.
To solve, I opened the old R version (the one the package was built under), and installed the missing packages under that version and it solved the problem.
E.g.
# Version should match the version your package was built in
R.version
# 3.5.1
install.packages(c('stringr', 'lubridate', 'testthat'))
Tips
If you need to check your R version, simply type R.version
If you need to switch R version, hold control while starting RStudio on windows, or on mac download a very simple application called RSwitch to instantly switch between version (you'll still need to restart the R session with .rs.restartR()

Why does adding a Depends argument to a package DESCRIPTION cause it not to be compiled for versions after the specified one?

I've just released a package to CRAN which has the following line in the DESCRIPTION file:
Depends: R (>= 2.12.0)
I have never used such a line in a package DESCRIPTION file before, and never had any troubles.
I received the following message a few hours ago, as is typical for CRAN releases:
Dear package maintainer,
this notification has been generated automatically.
Your package maRketSim_0.9.tar.gz has been built for Windows and
will be published within 24 hours in the corresponding CRAN directory
(CRAN/bin/windows/contrib/2.13/).
R version 2.13.1 Patched (2011-07-20 r56455)
All the best,
Uwe Ligges
(Maintainer of binary packages for Windows)
Now with this package, install.packages(maRketSim) on Windows in R 2.13.1 returns:
In getDependencies(pkgs, dependencies, available, lib) :
package ‘maRketSim’ is not available (for R version 2.13.1)
The same error occurs in R 2.13.0 on Windows.
Yet the install works just fine in R 2.12.2 on the same machine.
Did including the Depends line mess things up?
It works for me on Linux. CRAN says that there are currently no binary builds for Windows or MacOS X. What system/OS were you trying the install on when it failed.
Uwe's (automated) message does mention that it might take up to 24 hours for the new build to reach CRAN and thence out to whatever mirror you are using.
And this does appear to be the issue: there is a binary for maRketSim in http://cran.r-project.org/bin/windows/contrib/2.12/ but not yet in http://cran.r-project.org/bin/windows/contrib/2.13/
You just need to wait a little while before you can install the binary for the 2.13.x branch of R/

Resources