RODBC and Access - odbcConnectAccess on Ubuntu 14.04 - r

I'm having a similar problem as this one:
RODBC and Access - Loading data
but I'm working on Ubuntu 14.04 OS.
As stated, I need to query an Access file I have. I've tried
db <- "foo.accdb"
con <- odbcConnect(db)
which obviously doesn't work as the function I should use is odbcConnectAccess2007(), which is not available for package RODBC and is not listed on the manual:
http://cran.r-project.org/web/packages/RODBC/RODBC.pdf
I'm using RStudio Version 0.98.1091 with
R version 3.1.2 (2014-10-31)
Platform: x86_64-pc-linux-gnu (64-bit)
My question is:
Is there any way I can access an Access database in a file using R from an Ubuntu computer?

Related

Why changing R version from global options won't affect R version used in the console?

I am trying to figure out which version of R is currently being used by Rstudio. I changed the R version under: tools/global options/general/ R sessions/ R version.
But the version being used by the console seems not affected. I also tried restarting the R session under: Session/ Restart R. Running R.version in console prints the version 4.0.5 yet I have changed the version of R from global options.
here is a screenshot of what I see on Rsutio.

Install mxnet package in Rstudio Cloud

I want to install the package mxnet on Rstudio Cloud, which is the cloud version of Rstudio. I tried it first with R 3.6, then R 3.5.3, neither worked.
I tried to install from with this piece of code:
cran <- getOption("repos")
cran["dmlc"] <- "https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/R/CRAN/"
cran["dmlc"] <- "https://s3-us-west-2.amazonaws.com/apache-mxnet/R/CRAN/"
options(repos = cran)
install.packages("mxnet")
I got a 404 error file not found. Then i tried downloading the .tar.gz installation file associated with LInux/R/CPU, and it also gave an error:
ERROR: cannot extract package from
‘/cloud/project/apache-mxnet-src-1.5.0-incubating.tar.gz’
Here is my session info:
R version 3.5.3 (2019-03-11)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.6 LTS
Thanks for your help. I need to get this package installed and running on Rstudio Cloud.
RStudio Cloud is linux based
Platform: x86_64-pc-linux-gnu (64-bit)
The snippet you use is instruction for R on Windows CPU platform. R on Linux instruction there says to build it from source which wouldn't work on the cloud. Seems like no CRAN repo currently has binaries of the linux version of the mxnet package.
RStudio Cloud gives you access to the terminal and you can even download the sources for mxnet, but to build it you need sudo which the terminal doesn't provide so building from source stops on ./install_mxnet_ubuntu_r.sh command here:
git clone --recursive https://github.com/apache/incubator-mxnet.git mxnet
cd mxnet/docs/install
./install_mxnet_ubuntu_r.sh

R Studio not using the newest R version on my computer

I installed R 3.5.3, then restarted my Windows 7 computer. Next I launched R Studio and ran the command sessionInfo() and am informed that R Studio is still utilizing R version 3.5.1.
R version 3.5.1 (2018-07-02)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
I went to the Tools > Global Options > General > R Version and get a screen like this
(source: rstudio.com)
Although I could simply select the specific version of R I'd like to use (eg 3.5.3) I want R Studio to use the default version of R on my machine, which I'd always want to be the most current version of R on my machine.
How do I achieve this? I'm using the installr package to update R every six months or so. It seems installr doesn't force Windows 7 to realize I've got a new R version on my system.

RStudio not loading RevoScaleR on Ubuntu 16.04

Long story short:
Calling rxImport() works fine in a Terminal R session but fails when using RStudio, despite using the same installation of R.
Setup:
I'd like to use RevoScaleR functions like rxImport(...) on Ubuntu. I have an installation of RStudio and R done through package manager.
I've installed MS Rclient following the instructions here.
Everything seems to work as I can run in the terminal:
/opt/microsoft/rclient/3.4.3/bin/R$ ./R
R version 3.4.3 (2017-11-30) -- "Kite-Eating Tree"
Copyright (C) 2017 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
...
Microsoft R Open 3.4.3
The enhanced R distribution from Microsoft
Microsoft packages Copyright (C) 2018 Microsoft
Loading Microsoft R Client packages, version 3.4.3.0097.
Microsoft R Client limits some functions to available memory.
See: https://go.microsoft.com/fwlink/?linkid=799476 for information
about additional features.
...
Using the Intel MKL for parallel mathematical computing (using 2 cores).
Default CRAN mirror snapshot taken on 2018-01-01.
See: https://mran.microsoft.com/.
> R.home()
[1] "/opt/microsoft/rclient/3.4.3/runtime/R"
> rxImport()
Error in rxImport() : 'inData' must be specified.
So the function is loaded and available by default. Now I tell the RStudio to use this installation of R by adding the following at the end of ~/.profile :
RSTUDIO_WHICH_R="/opt/microsoft/rclient/3.4.3/bin/R/R"
Error:
When I run rstudio I get a R console in the IDE saying:
> R.home()
[1] "/opt/microsoft/rclient/3.4.3/runtime/R"
> rxImport()
Error in rxImport() : could not find function "rxImport"
Possible causes
I've found some threads with people complaining about MS packages not dealing properly with ~ and working directory (i.e. on a remote server), setwd() doesn't solve my issue, though.
Do you have any ideas on how to get RevoScaleR to work with RStudio? Thanks in advance.
An answer I got from Github:
https://github.com/rstudio/rstudio/issues/2455#issuecomment-375327109
try setting
R_LIBS_SITE=/opt/microsoft/rclient/3.4.3/libraries/RServer
in
/opt/microsoft/rclient/3.4.3/runtime/R/etc/Renviron

R Bioconductor package error on Linux (GenomicFeatures)

I want to use the function "makeTxDbfromGFF", which is part of the GenomicFeatures package. This function used to work perfectly until now, I get the following output:
makeTxDbFromGFF("/file/to/gencode.v19.annotation.gtf", dataSource="Gencode", organism="Homo sapiens", format="gtf")
>Import genomic features from the file as a GRanges object ... OK
>Prepare the 'metadata' data frame ... OK
>Make the TxDb object ... Error in c(x, value) :
could not find symbol "recursive" in environment of the generic function
This function works on my Mac, but not on my Linux workstation. Here some details to my session:
R version 3.3.3 (2017-03-06)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.1 LTS
I already uninstalled the new version 1.26.3 and installed the previous version (1.24.5), but I get the same error. On my Mac I use the version 1.26.2.
My research so far was not very successful. I just found out it might be due to some inconsistency with other software/packages(?).

Resources