Julia ≠ 🇷 [Software]

posted by Helmut Homepage – Vienna, Austria, 2022-01-12 01:02 (255 d 22:43 ago) – Posting: # 22730
Views: 1,300

Hi Weidson,

» When I use the option Install from Achive File (.zip; targ.gz) of Rstudio Panel and choose the file at save directory the following message appears on RStudio's console:
»
» Installing package into ‘C:/Users/weidson.carlo/Documents/R/win-library/3.6’
» (as ‘lib’ is unspecified)
» Warning in install.packages :
»   cannot open compressed file 'Metida.jl-master/DESCRIPTION', probable reason 'No such file or directory'
» Error in install.packages : cannot open the connection


As expected (see the subject line). It’s like presenting a Fortran-source to a C-compiler. Can’t work.
First you have to download and install Julia. Then start julia.exe (in the installation’s /bin-folder) and in its terminal:

julia> import Pkg; Pkg.add("Metida")

Looks on my machine like this:

               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.7.1 (2021-12-22)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> import Pkg; Pkg.add("Metida")
    Updating registry at `C:\Users\HS\.julia\registries\General`
    Updating git-repo `https://github.com/JuliaRegistries/General.git`
  Downloaded artifact: Hwloc
    Updating `C:\Users\HS\.julia\environments\v1.7\Project.toml`
  [a1dec852] + Metida v0.12.4
    Updating `C:\Users\HS\.julia\environments\v1.7\Manifest.toml`
  [79e6a3ab] + Adapt v3.3.3
  [4fba245c] + ArrayInterface v3.2.2
  [2a0fbf3d] + CPUSummary v0.1.6
  [bbf7d656] + CommonSubexpressions v0.3.0
  [b429d917] + DensityInterface v0.4.0
  [85a47980] + Dictionaries v0.3.17
  [163ba53b] + DiffResults v1.0.3
  [b552c78f] + DiffRules v1.9.0
  [31c24e10] + Distributions v0.25.37
  [1a297f60] + FillArrays v0.12.7
  [6a86dc24] + FiniteDiff v2.9.0
  [f6369f11] + ForwardDiff v0.10.24
  [0e44f5e4] + Hwloc v2.0.0
  [615f187c] + IfElse v0.1.1
  [313cdc1a] + Indexing v1.1.1
  [d3d80556] + LineSearches v7.1.1
  [1914dd2f] + MacroTools v0.5.9
  [a1dec852] + Metida v0.12.4
  [075456b7] + MetidaBase v0.5.1
  [d41bc354] + NLSolversBase v7.8.2
  [77ba4419] + NaNMath v0.3.6
  [429524aa] + Optim v1.6.0
  [90014a1f] + PDMats v0.11.5
  [d96e819e] + Parameters v0.12.3
  [85a6dd25] + PositiveFactorizations v0.2.4
  [1fd47b50] + QuadGK v2.4.2
  [03a91e81] + SplitApplyCombine v1.2.0
  [aedffcd0] + Static v0.4.1
  [90137ffa] + StaticArrays v1.3.1
  [9d95f2ec] + TypedTables v1.4.0
  [3a884ed6] + UnPack v1.0.2
  [e33a78d0] + Hwloc_jll v2.7.0+0
  [4607b0f0] + SuiteSparse
Precompiling project...
  32 dependencies successfully precompiled in 26 seconds (51 already precompiled)

Before you can run PharmCat’s example in GitHub you have to install three other libraries.

julia> import Pkg; Pkg.add("CSV")
julia> import Pkg; Pkg.add("DataFrames")
julia> import Pkg; Pkg.add("CategoricalArrays")

Then with

julia> using Metida, CSV, DataFrames, CategoricalArrays
julia> df = CSV.File(joinpath(dirname(pathof(Metida)),"..","test","csv","df0.csv")) |> DataFrame
julia> transform!(df, :subject => categorical, renamecols=false)
julia> transform!(df, :period => categorical, renamecols=false)
julia> transform!(df, :sequence => categorical, renamecols=false)
julia> transform!(df, :formulation => categorical, renamecols=false)
julia> lmm = LMM(@formula(var~sequence+period+formulation), df;
       random = VarEffect(@covstr(formulation|subject), CSH),
       repeated = VarEffect(@covstr(formulation|subject), DIAG),
       )

You should get:

Linear Mixed Model: var ~ sequence
Random 1:
    Model: formulation|subject
    Type: CSH (3), Subjects: 5
Repeated:
    Model: formulation|subject
    Type: DIAG (2)
Blocks: 5, Maximum block size: 4
Not fitted.

Then:

julia> fit!(lmm)

You should get:

Linear Mixed Model: var ~ sequence + period + formulation
Random 1:
    Model: formulation|subject
    Type: CSH (3), Subjects: 5
Repeated:
    Model: formulation|subject
    Type: DIAG (2)
Blocks: 5, Maximum block size: 4
Status: converged See warnings in log.
    -2 logREML: 10.0652    BIC: 23.9282

    Fixed-effects parameters:
───────────────────────────────────────────────────────
                     Coef.  Std. Error      z  Pr(>|z|)
───────────────────────────────────────────────────────
(Intercept)      1.57749     0.334543    4.72    <1e-05
sequence: 2     -0.170833    0.384381   -0.44    0.6567
period: 2        0.195984    0.117228    1.67    0.0946
period: 3        0.145014    0.109171    1.33    0.1841
period: 4        0.157363    0.117228    1.34    0.1795
formulation: 2  -0.0791667   0.0903709  -0.88    0.3810
───────────────────────────────────────────────────────
    Variance components:
    θ vector: [0.455584, 0.367656, 1.0, 0.143682, 0.205657]
  Random 1   σ² formulation: 1   var   0.207557
  Random 1   σ² formulation: 2   var   0.135171
  Random 1   ρ                   rho   1.0
  Residual   σ² formulation: 1   var   0.0206445
  Residual   σ² formulation: 2   var   0.0422948


The terminal REPL (Read-Eval-Print-Loop) of Julia is pain in the back. I suggest Atom/Juno or Visual Studio Code.

Didn’t try package JuliaCall, except in very simple examples. According to the documentation one could install Julia with the function install_julia() and packages with julia_install_package(). Never tried that.

Dif-tor heh smusma 🖖 Довге життя Україна! [image]
Helmut Schütz
[image]

The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes

Complete thread:

UA Flag
Activity
 Admin contact
22,385 posts in 4,684 threads, 1,594 registered users;
online 4 (0 registered, 4 guests [including 4 identified bots]).
Forum time: Sunday 00:46 CEST (Europe/Vienna)

You really don’t know what you don’t know until you write about it.
Then, everyone knows what you don’t know.    Rod Machado

The Bioequivalence and Bioavailability Forum is hosted by
BEBAC Ing. Helmut Schütz
HTML5