packages

Creating an R package for windows

流过昼夜 提交于 2019-12-21 17:30:04
问题 I created an R package on Linux (and it is working on Linux), but I can't make the same package work on Windows. What I tried to do (maybe it was a bit foolish) was to convert the tar.gz into a Zip file and to install it from the R GUI. However, when I load the package library("myPackage") then I get the following message: Error in library("myPackage") : there is no package called 'myPackage' Should I try to build the package directly from Windows with the R tools? 回答1: To build an R package

Installing Python binary modules to a custom location in Windows

不羁的心 提交于 2019-12-21 12:33:19
问题 Suppose that I want to install a binary module for Python on Windows. Suppose that the module is distributed as a pre-built installer xxx-n.n.n.win32-py2.7.exe , prepared using distutils. My problem is that the installer insists on installing the package into whatever Python directory he finds in the registry. However, I have this tiny "portable" Python directory on a flash drive that I use from time to time and need to have packages installed there. That directory is not marked in the

Update a package and keep it from reverting to the original

谁说胖子不能爱 提交于 2019-12-21 12:29:16
问题 I want to upgrade the package ggplot2: library(ggplot2) packageDescription("ggplot2")["Version"] > 0.8.3 But the current version is 0.8.7. I tried update.packages(), which seemed to work OK. But it still returned older version 0.8.3. So I downloaded and installed the package source from Cran, which says 0.8.7 in the download page. I then install it via the GUI menu in R. It returns ** building package indices ... * DONE (ggplot2) I then run: packageDescription("ggplot2")["Version"] > 0.8.3

Loading the testthat package only for tests but not requiring in dependencies

萝らか妹 提交于 2019-12-21 07:56:02
问题 Building a package results in the following warning: * checking for unstated dependencies in tests ... WARNING ‘library’ or ‘require’ call not declared from: ‘testthat’ * checking tests ... Running ‘test-all.R’ OK * checking PDF version of manual ... OK WARNING: There was 1 warning. The package directory has a folder called tests , with a file test-all.R: library(testthat) library(bootLR) test_package("bootLR") Then a subfolder testthat with two files in it that hold the various tests. The

Define Classes in Packages

左心房为你撑大大i 提交于 2019-12-21 07:54:02
问题 I'm learning Python and I have been playing around with packages. I wanted to know the best way to define classes in packages. It seems that the only way to define classes in a package is to define them in the __init__.py of that package. Coming from Java, I'd kind of like to define individual files for my classes. Is this a recommended practice? I'd like to have my directory look somewhat like this: recursor/ __init__.py RecursionException.py RecursionResult.py Recursor.py So I could refer

How to avoid clang: No such file or directory error

我的未来我决定 提交于 2019-12-21 04:58:09
问题 I am trying to install RPostgreSQL into my R instance. I downloaded R with Anaconda, I also downloaded homebrew. When I run, install.packages('RPostgreSQL') I get an error message that reads -- make: x86_64-apple-darwin13.4.0-clang: No such file or directory make: *** [RS-DBI.o] Error 1 ERROR: compilation failed for package ‘RPostgreSQL’ * removing ‘/Users/user/anaconda2/lib/R/library/RPostgreSQL’ Should I download this clang file? 回答1: Try this command: conda install clangxx_osx-64 And

How to avoid clang: No such file or directory error

人走茶凉 提交于 2019-12-21 04:58:09
问题 I am trying to install RPostgreSQL into my R instance. I downloaded R with Anaconda, I also downloaded homebrew. When I run, install.packages('RPostgreSQL') I get an error message that reads -- make: x86_64-apple-darwin13.4.0-clang: No such file or directory make: *** [RS-DBI.o] Error 1 ERROR: compilation failed for package ‘RPostgreSQL’ * removing ‘/Users/user/anaconda2/lib/R/library/RPostgreSQL’ Should I download this clang file? 回答1: Try this command: conda install clangxx_osx-64 And

When developing an R package, do I have to recompile the package every time I make a change?

陌路散爱 提交于 2019-12-21 04:23:10
问题 I am developing a package in R When I am debugging a particular function or set of functions, what is the best way to test the function? Do I have to either use source('function.R') or R CMD build each time I want to check my changes? (extra credit for associated emacs ess key-bindings) 回答1: See also http://github.com/hadley/devtools/ which provides some tools to make this task easier. for example, after making changes to source code, you build, install, and reload a package with the function

How to tell what packages you have used in R

五迷三道 提交于 2019-12-21 03:33:38
问题 I have a very long R script with many if statements and exception cases. As i've been going, if been importing and testing libraries as I've gone and haven't really documented them very well. The problem is that if I run this from a clean installation, i'm not sure which statements the script will run, and so which libraries will be needed. My question is: Is there any R function to test which libraries are being used in a script? EDIT: I have not used all of the libraries that have been

TypeError: environment.setup is not a function in React Testing

让人想犯罪 __ 提交于 2019-12-21 03:28:13
问题 I was trying to implement the example shown in Jest website: Getting started with Jest. While running npm test on I was getting the following error: FAIL src/sum.test.js ● Test suite failed to run TypeError: environment.setup is not a function at node_modules/jest-runner/build/run_test.js:112:23 sum.js : function sum(a, b){ return a+b; } module.exports = sum; sum.test.js : const sum = require('./sum'); test('adding sum function', () => { expect(sum(234,4)).toBe(238); }) sum.js and sum.test.js