NetCDF in julia - julia

After intalling NetCDF in julia,
julia> Pkg.status()
1 required packages:
- NetCDF 0.3.0
7 additional packages:
- BinDeps 0.3.19
- Compat 0.7.8
- Conda 0.1.8
- Formatting 0.1.4
- JSON 0.5.0
- SHA 0.1.2
- URIParser 0.1.1
I try simple things like
julia> ncinfo("/home/idf/Downloads/air.sig995.2012.nc")
ERROR: UndefVarError: ncinfo not defined
julia>
I must be missing a step?

Julia packages are git repositories, one could clone a repository directly or by Pkg.add(), it's not equals to loading it, therefore after adding a package and before using it you must load it's contents, and using is the right command to do this task,
So:
using NetCDF; is the missing statement.

Related

Building package against older Rcpp version

I'm writing an R package for simulations using Rcpp. Rcpp project setup has added my Rcpp version as dependendy Rcpp (>= 1.0.9)
A project partner who is trying to run the simulations has Rcpp version 1.0.8. I did not see anything in the release notes of Rcpp 1.0.9 that would suggest, that the package wouldn't build on version 1.0.8 but I would want to try to build it before changing the dependency.
Would the following work to test this:
install Rcpp 1.0.8 from the CRAN archive to a local library
add the local library as first entry to library paths with .libPaths
call devtools::build

icudt error while installing stringi library in R

I'm writing this because it took me several days to come to this result.
Bottom line: The stringi library version 1.1.3 (released March 2017) might have issues involving icudt. You can install stringi 1.1.2 using the following commands:
packageurl <- "https://cran.r-project.org/src/contrib/Archive/stringi/stringi_1.1.2.tar.gz"
install.packages(packageurl, repos=NULL, type="source")
I put this together from some RStudio documentation on how to install an older package.
Background:
I was trying to install the forecast library in R. Originally, I was using R 3.1.2. I also installed R 3.3.3 and tried to install stringi it. I'm running CentOS 6.7 and don't have a choice to upgrade.
Forecast failed to install due to issues installing stringi. The stringi library failed to install due to errors downloading ICU data library (icudt)
It looks like stringi 1.1.3 added download/build logic regarding icudt, and upcoming version 1.1.4 has corrections to this logic (as of date 2017-04-02).
I went to the ICU project site: and downloaded/installed the ICU library that appeared to be specified in the error messages below:
checking whether we may compile src/icu55/common/umapfile.c... yes
checking whether we may compile src/icu55/common/putil.cpp... yes
checking whether we can fetch icudt... WARNING: ignoring environment value of R_HOME
downloading ICU data library (icudt)
output path: icu55/data/icudt55l.zip
Error in stri_download_icudt("icu55/data") :
could not find function "dir.exists"
Calls: identical -> stri_download_icudt
Execution halted
*** icudt could not be downloaded. stopping.
ERROR: configuration failed for package ‘stringi’
Searches online for icu55, icudt55l.zip, or any procedure that followed to get past this error didn't turn up a procedure that worked. I downloaded, built, and installed ICU 55.1 and also ICU 58.2. I also updated gcc and g++. The CRAN repository install notes for stringi 1.1.3 don't currently give a straightforward set of instructions to successfully install stringi when I have a working internet connection.
I started by asking this as a question and then found my answer. I'll post it anyways. I had added several links but needed to remove them because I don't have enough cred to get away with them.
This has nothing to do with ICU. This is a bug in stringi, which I have already fixed in version 1.1.5 (now on CRAN). The dir.exists() function is specific to R ≥ 3.2.0 - I wasn't aware of that. Sorry for inconvenience.
The stringi library version 1.1.3 (released March 2017) might have issues involving icudt. You can install stringi 1.1.2 using the following commands:
packageurl <- "https://cran.r-project.org/src/contrib/Archive/stringi/stringi_1.1.2.tar.gz"
install.packages(packageurl, repos=NULL, type="source")

Writing R package, trimTrees and kknn cannot be installed automatically

Recently my package on R-Forge failed to build on windows, not linux. Apparently packages kknn and trimTrees are not available. I cannot figure out why or why these two packages are different from randomForest or rgl which installs automatically. I have tried to include package names in description file in Depends-field and/or in Imports-field. Nothing works...
If installing my package from r-forge repos, with randomForest and trimTrees package removed, first mentioned will install automatically second will fail and have to be installed manually first. Why is this?
I have already read the this answer
thanks alot, Soren
description file:
Package: forestFloor
Type: Package
Title: forestFloor
Version: 1.4
Date: 2015-05-19
Author: Soeren Havelund Welling
Maintainer: Soeren Havelund Welling <SOWE#DTU.DK>
Depends: R (>= 3.0.0), randomForest, trimTrees, rgl, kknn
Suggests:
Description: Visualizes Random Forrest with feature contributions.
SystemRequirements: OpenGL, GLU Library, zlib
License: GPL-2
Imports: Rcpp (>= 0.11.3), randomForest, trimTrees, rgl, kknn
LinkingTo: Rcpp
namespace
useDynLib(forestFloor)
importFrom(Rcpp, evalCpp)
importFrom(randomForest, randomForest)
importFrom(trimTrees, cinbag)
import(rgl)
import(kknn)
S3method(plot,forestFloor)
S3method(print,forestFloor)
export(forestFloor,
plot.forestFloor,
print.forestFloor,
box.outliers,
recTree,
vec.plot,
convolute_ff,
convolute_ff2,
convolute_grid,
show3d_new,
fcol,
randomForest,
plot3d,
kknn,
persp3d)
-----------log file from r forge ----------
using log directory 'R:/run/building/build_2015-05-19-12-04/RF_PKG_CHECK/PKGS/forestFloor.Rcheck'
using R version 3.2.0 Patched (2015-05-16 r68378)
using platform: x86_64-w64-mingw32 (64-bit)
using session charset: ISO8859-1
using option '--as-cran'
checking for file 'forestFloor/DESCRIPTION' ... OK
checking extension type ... Package
this is package 'forestFloor' version '1.4'
checking CRAN incoming feasibility ... NOTE
Maintainer: 'Soeren Havelund Welling '
New submission
The Title field is just the package name: provide a real title.
* checking package namespace information ... OK
* checking package dependencies ... ERROR
No repository set, so cyclic dependency check skipped
Packages required but not available: 'trimTrees' 'kknn'
See section 'The DESCRIPTION file' in the 'Writing R Extensions'
manual.
* DONE
Status: 1 ERROR, 1 NOTE
See
'R:/run/building/build_2015-05-19-12-04/RF_PKG_CHECK/PKGS/forestFloor.Rcheck/00check.log'
for details.
Run time: 6.77 seconds.
It turned out to be a current rForge server issue when it updated to R 3.2. The problem can for now be fixed manually by contacting admin. They're working on general fix also.
link to bug tracker

Loading Distance package not responding in Julia

In Julia Studio 0.4.4 on Mac OS X 10.9, I am unable to load the Distance package.
When I run:
julia> using Distance
Julia studio terminal do not respond, it never goes back to the prompt. I have tried to reinstall the package as well as to remove the ~/.julia folder, but the problem persists.
julia> Pkg.status()
Required packages:
- DataFrames 0.4.3
- Distance 0.2.6
- IJulia 0.1.11 55b60c47 (dirty)
- RDatasets 0.1.1
Additional packages:
- BinDeps 0.2.12
- Blocks 0.0.4
- DataArrays 0.0.3
- GZip 0.2.12
- Homebrew 0.0.6
- JSON 0.3.5
- Nettle 0.1.3
- NumericExtensions 0.3.6
- REPLCompletions 0.0.1
- SortingAlgorithms 0.0.1
- StatsBase 0.3.8
- URIParser 0.0.2
- ZMQ 0.1.11
Thank you very much!

How to debug a case where R CMD check fails under narrow circumstances

Apologies for yet another package build debugging, but I'm completely stumped here.
Using R-devel.sh CMD check taRifx.geo_1.0.6.tar.gz --as-cran on (X)Ubuntu 14.04 LTS, installed via this script, I get the following error:
* checking examples ... ERROR
Running examples in ‘taRifx.geo-Ex.R’ failed
The error occurred in:
[ ...SNIP... ]
> ### * </HEADER>
> library('taRifx.geo')
Loading required package: sp
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
there is no package called ‘lattice’
Error: package ‘sp’ could not be loaded
Execution halted
The manual for package checking says:
Before using these tools, please check that your package can be
installed (which checked it can be loaded). R CMD check will inter
alia do this, but you may get more detailed error messages doing the
install directly.
But when I do that (being sure to use R-devel, loaded with --vanilla), I get no error:
# 1)
install.packages("taRifx.geo_1.0.6.tar.gz",repos=NULL)
# 2)
library(taRifx.geo)
# 3) Profit.
If I run R CMD check through RStudio or command line R (but not the -devel version), I also get no error.
Thing is, when I search the entire project's code for "lattice", I can't find any case where I use it, even in the example files. lattice is installed and I've tried checking with lattice in Suggests and without.
Project code here: https://github.com/gsk3/taRifx.geo
The check logs are here.
Now for the question: How do I go about debugging this? I have some thoughts as to where the problem might lie (Depends rather than Imports for a few packages, and the spatial packages tend to have very intertangled namespaces), but I can't really begin to solve it unless I can reproduce the error in an environment other than R CMD check run from the command line via R-devel.sh.
This, by the way, is Under development (unstable) (2014-05-26 r65771) -- "Unsuffered Consequences". Appropriately named.
Edit
Here are the contents of /usr/local/lib/R/site-library:
akima digest labeling plyr RJSONIO stringr
bitops evaluate lattice proto R.methodsS3 survival
boot fields mapproj pspline R.oo taRifx
caTools functional maps RandomFields RSQLite taRifx.geo
cluster gdata maptools RColorBrewer R.utils testthat
colorspace geoR MASS Rcpp scales whisker
data.table ggplot2 Matrix RCurl shapefiles xtable
DBI gtable memoise reshape2 sp
devtools gtools munsell rgdal spam
dichromat httr nlme rgeos splancs
The lattice description file says:
Depends: R (>= 2.15.1)
Built: R 3.2.0; x86_64-unknown-linux-gnu; 2014-05-29 17:14:03 UTC; unix
Still the same error on the CMD check.
I had been attempting to install to the site-wide library at "/usr/local/lib/R/site-library" which did not solve it, but I instead brute-forced a solution.
First, find all the places R might look:
> .libPaths()
[1] "/usr/local/lib/R/site-library"
[2] "/usr/lib/R/site-library"
[3] "/usr/lib/R/library"
[4] "/usr/local/lib/R-devel/lib/R/library"
Then, as root, install to each of those in turn until the error goes away. As it turns out, it's "/usr/local/lib/R-devel/lib/R/library":
install.packages(c('lattice','sp'),lib="/usr/local/lib/R-devel/lib/R/library")
Then q() that R-devel session and run R-devel.sh CMD check mypackage.tar.gz --as-cran.
As for why it needs lattice in the first place, I suspect it's pulling in an .Rdata file at launch which has lattice in the namespace.
Many thanks to #DirkEddelbuettel and #GavinSimpson for the various shoves in the right direction.

Resources