Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
kaskr edited this pageAug 19, 2022 ·14 revisions

CRAN (all platforms)

In R type:

install.packages("TMB")

You will also need compiler tools.

Windows - installing required tools

On Windows, install theRtools matching your R-version.FromRtools4.2 the procedure is simpler than before: Just click on the 'Rtools42 installer' and follow the instructions (you donot need to modify yourPATH and you donot need to restart R after installing Rtools).

Windows debugger (gdb)

The debugger is recommended but not strictly required. To get it working under Rtools42:

  1. Start a shell by clickingStartMenu -> Rtools4.2 -> Rtools4.2-bash
  2. Install gdb by running the command (copy-paste doesn't work here)
    pacman -Sy gdb
  3. From R, modify your PATH permanently so the R executable can be found from the gdb shell:
    write('Sys.setenv(PATH=paste(R.home("bin"),Sys.getenv("PATH"),sep=";"))',file="~/.Rprofile",append=TRUE)
  4. Restart R and check that you can source a script through gdb:
    TMB::gdbsource("script.R",TRUE)

Mac OS - installing the required tools

On Mojave (Mac OS 10.14.1) it may be necessary to install command line developer tools by running the following two commands in a Terminal:

 xcode-select --install sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /

On High Sierra (Mac OS 10.13.1) it may be necessary to install command line developer tools by running the following code in a Terminal:

 xcode-select --install

On Mavericks (Mac OS 10.9) the Fortran compiler on the CRAN website does not work. More information and the solution can be foundhere. The easiest solution is to install the appropriate fortran libraries from r.research.att via the command line in Terminal:

curl -O http://r.research.att.com/libs/gfortran-4.8.2-darwin13.tar.bz2sudo tar fvxz gfortran-4.8.2-darwin13.tar.bz2 -C /

Test the installation

library(TMB)## Optionally:## precompile()runExample(all=TRUE)

Run the example suite

To get thefull suite of examples run:

download.file("https://github.com/kaskr/adcomp/archive/master.zip","adcomp-master.zip")unzip("adcomp-master.zip")

Change directory

setwd("adcomp-master/tmb_examples")

and run e.g. thesam example by

source("sam.R")

Clone this wiki locally


[8]ページ先頭

©2009-2026 Movatter.jp