Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…nto dev
  • Loading branch information
rogerssam committed Feb 1, 2024
2 parents fba51a1 + ad59fb1 commit 2a1111c
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 60 deletions.
53 changes: 23 additions & 30 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,44 +6,37 @@ name: pkgdown

jobs:
pkgdown:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
# Only restrict concurrency for non-PR jobs
concurrency:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
RSPM: https://packagemanager.rstudio.com/cran/__linux__/jammy/latest
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write

steps:
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-r@v2
id: install-r
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
shell: Rscript {0}
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- name: Cache R packages
uses: actions/cache@v3
- uses: r-lib/actions/setup-r-dependencies@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ubuntu-22.04-${{ steps.install-r.outputs.installed-r-version }}-1-${{ hashFiles('.github/r-depends.rds') }}
restore-keys: ubuntu-22.04-${{ steps.install-r.outputs.installed-r-version }}-1-

- name: Install dependencies
run: |
install.packages("remotes")
remotes::install_deps(dependencies = TRUE)
remotes::install_dev("pkgdown")
shell: Rscript {0}
extra-packages: any::pkgdown, local::.
needs: website

- name: Install package
run: R CMD INSTALL .
- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}

- name: Build and deploy pkgdown site
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "[email protected]"
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'
- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/[email protected]
with:
clean: false
branch: gh-pages
folder: docs
9 changes: 5 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ Depends:
R (>= 4.0.0)
Imports:
agricolae,
askpass,
cowplot,
xml2,
curl,
emmeans,
farver,
ggplot2,
Expand All @@ -48,11 +49,11 @@ Imports:
pracma,
rlang (>= 1.0.0),
scales,
stringi
stringi,
xml2
Suggests:
covr,
crayon,
getPass,
knitr,
mockery,
rmarkdown,
Expand All @@ -69,5 +70,5 @@ Config/testthat/edition: 3
Config/testthat/parallel: true
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
RoxygenNote: 7.3.0
VignetteBuilder: knitr
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export(resplot)
export(resplt)
export(update_asreml)
export(variogram)
importFrom(askpass,askpass)
importFrom(cowplot,add_sub)
importFrom(cowplot,plot_grid)
importFrom(curl,curl_fetch_disk)
Expand Down
10 changes: 8 additions & 2 deletions R/install_asreml.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ install_asreml <- function(library = .libPaths()[1], quiet = FALSE, force = FALS

# Get OS and R version
os_ver <- get_r_os()
if(os_ver$os=="mac") {
create_mac_folder()
}

url <- paste0("https://link.biometryhubwaite.com/", os_ver$os_ver)

# First check if file already exists, both in the current directory and temp folder
Expand Down Expand Up @@ -269,6 +273,7 @@ compare_versions <- function() {
#'
#' @return logical; TRUE if folder successfully created, otherwise it will error
#' @keywords internal
#' @importFrom askpass askpass
create_mac_folder <- function() {
# macOS needs some special set up
if(Sys.info()[["sysname"]] == "Darwin" &&
Expand All @@ -290,9 +295,10 @@ create_mac_folder <- function() {
message("The ASReml-R package uses Reprise license management and will require administrator privilege to create the folder '/Library/Application Support/Reprise' before it can be installed.")
input <- readline("Would you like to create this folder now (Yes/No)? You will be prompted for your password if yes. ")

if(toupper(input) %in% c("YES", "Y") && rlang::is_installed("getPass")) {
if(toupper(input) %in% c("YES", "Y")) {
system("sudo -S mkdir '/Library/Application Support/Reprise' && sudo -S chmod 777 '/Library/Application Support/Reprise'",
input = getPass::getPass("Please enter your user account password: "))
input = askpass::askpass("Please enter your user account password: "))
cat("\n")
}
else {
stop("ASReml-R cannot be installed until the folder '/Library/Application Support/Reprise' is created with appropriate permissions.
Expand Down
8 changes: 8 additions & 0 deletions R/mct.R
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,14 @@ multiple_comparisons <- function(model.obj,
attr(pp.tab, 'aliased') <- as.character(aliased_names)
}

# Add the critical value as an attribute
if(var(as.vector(crit.val), na.rm = TRUE) < 1e-10) {
attr(pp.tab, 'HSD') <- crit.val[1,2]
}
else {
attr(pp.tab, 'HSD') <- crit.val
}

rownames(pp.tab) <- NULL

return(pp.tab)
Expand Down
2 changes: 1 addition & 1 deletion man/autoplot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/variogram.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 11 additions & 11 deletions tests/testthat/_snaps/all-w2.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,12 @@
---

Genotype predicted.value std.error groups ci low up
1 G04 4.15 0.14 a 0.23 3.92 4.37
1 G04 4.14 0.14 a 0.23 3.92 4.37
2 G14 4.63 0.14 ab 0.23 4.41 4.86
3 G20 4.80 0.14 bc 0.23 4.57 5.02
4 G10 4.81 0.14 bcd 0.23 4.59 5.04
5 G28 4.84 0.14 bcde 0.23 4.61 5.07
6 G24 4.86 0.14 bcdef 0.23 4.63 5.08
6 G24 4.85 0.14 bcdef 0.23 4.63 5.08
7 G01 4.91 0.14 bcdefg 0.23 4.68 5.14
8 G05 4.94 0.14 bcdefgh 0.23 4.72 5.17
9 G49 4.95 0.14 bcdefgh 0.23 4.72 5.17
Expand All @@ -141,13 +141,13 @@
20 G06 5.13 0.14 bcdefghi 0.23 4.90 5.35
21 G55 5.14 0.14 bcdefghi 0.23 4.92 5.37
22 G32 5.16 0.14 bcdefghij 0.23 4.93 5.38
23 G11 5.17 0.14 bcdefghij 0.23 4.94 5.39
23 G11 5.16 0.14 bcdefghij 0.23 4.94 5.39
24 G39 5.18 0.14 bcdefghij 0.23 4.95 5.40
25 G61 5.20 0.14 bcdefghij 0.23 4.97 5.42
26 G53 5.21 0.14 bcdefghij 0.23 4.98 5.43
27 G37 5.21 0.14 bcdefghij 0.23 4.99 5.44
28 G26 5.21 0.14 bcdefghij 0.23 4.99 5.44
29 G43 5.22 0.14 bcdefghij 0.23 4.99 5.44
29 G43 5.21 0.14 bcdefghij 0.23 4.99 5.44
30 G35 5.22 0.14 bcdefghij 0.23 4.99 5.44
31 G66 5.22 0.14 bcdefghij 0.23 4.99 5.44
32 G16 5.23 0.14 cdefghij 0.23 5.00 5.45
Expand All @@ -157,24 +157,24 @@
36 G47 5.27 0.14 cdefghij 0.23 5.05 5.50
37 G44 5.29 0.14 cdefghij 0.23 5.06 5.52
38 G23 5.29 0.14 cdefghij 0.23 5.07 5.52
39 G56 5.30 0.14 cdefghij 0.23 5.07 5.52
39 G56 5.29 0.14 cdefghij 0.23 5.07 5.52
40 G58 5.31 0.14 cdefghij 0.23 5.08 5.53
41 G57 5.32 0.14 cdefghij 0.23 5.09 5.54
41 G57 5.31 0.14 cdefghij 0.23 5.09 5.54
42 G63 5.32 0.14 cdefghij 0.23 5.09 5.54
43 G62 5.32 0.14 cdefghij 0.23 5.09 5.55
44 G54 5.33 0.14 cdefghij 0.23 5.11 5.56
45 G51 5.36 0.14 cdefghij 0.23 5.13 5.58
46 G67 5.37 0.14 cdefghij 0.23 5.14 5.59
47 G59 5.37 0.14 cdefghij 0.23 5.14 5.60
47 G22 5.37 0.14 cdefghij 0.23 5.14 5.60
48 G42 5.37 0.14 cdefghij 0.23 5.14 5.60
49 G22 5.37 0.14 cdefghij 0.23 5.14 5.60
49 G59 5.37 0.14 cdefghij 0.23 5.14 5.60
50 G65 5.38 0.14 cdefghij 0.23 5.15 5.60
51 G69 5.38 0.14 cdefghij 0.23 5.16 5.61
52 G38 5.38 0.14 cdefghij 0.23 5.16 5.61
53 G12 5.39 0.14 defghij 0.23 5.17 5.62
54 G31 5.41 0.14 efghij 0.23 5.19 5.64
55 G50 5.42 0.14 efghij 0.23 5.20 5.65
56 G17 5.43 0.14 efghij 0.23 5.20 5.65
56 G17 5.42 0.14 efghij 0.23 5.20 5.65
57 G52 5.43 0.14 efghij 0.23 5.20 5.65
58 G64 5.44 0.14 fghij 0.23 5.21 5.67
59 G13 5.45 0.14 ghij 0.23 5.22 5.67
Expand All @@ -183,12 +183,12 @@
62 G60 5.48 0.14 ghij 0.23 5.25 5.71
63 G27 5.49 0.14 ghijk 0.23 5.26 5.72
64 G18 5.50 0.14 ghijk 0.23 5.27 5.72
65 G36 5.51 0.14 hijk 0.23 5.28 5.73
65 G36 5.50 0.14 hijk 0.23 5.28 5.73
66 G48 5.51 0.14 hijk 0.23 5.29 5.74
67 G40 5.53 0.14 hijk 0.23 5.30 5.75
68 G33 5.61 0.14 ijk 0.23 5.38 5.83
69 G19 5.73 0.14 jk 0.23 5.51 5.96
70 G03 6.08 0.14 k 0.23 5.85 6.30
70 G03 6.07 0.14 k 0.23 5.85 6.30

---

Expand Down
Loading

0 comments on commit 2a1111c

Please sign in to comment.