diff --git a/.github/workflows/DNA build.yml b/.github/workflows/build-and-check.yml similarity index 53% rename from .github/workflows/DNA build.yml rename to .github/workflows/build-and-check.yml index 30cbea9e..fd136281 100644 --- a/.github/workflows/DNA build.yml +++ b/.github/workflows/build-and-check.yml @@ -3,41 +3,74 @@ name: build on: [push, pull_request, workflow_dispatch] jobs: - Bibliography: + install-dependencies: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: r-lib/actions/setup-tinytex@v2 + - uses: actions/checkout@v3 - - name: Install LaTeX packages - run: tlmgr install urlbst + - name: Restore System Dependencies Cache + uses: actions/cache@v3 + id: system-deps-cache + with: + path: | + /usr/local/texlive + /usr/local/bin/pandoc + /usr/local/texlive/texmf-var + /usr/local/texlive/tlpkg/texlive.tlpdb + key: ${{ runner.os }}-system-deps-v1 + + - name: Install System Dependencies + if: steps.system-deps-cache.outputs.cache-hit != 'true' + run: | + sudo apt-get update + sudo apt-get install -y texlive-latex-base texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended texlive-bibtex-extra pandoc pandoc-citeproc + + - uses: actions/cache@v3 + id: r-packages-cache + with: + path: | + ~/.cache/R + /usr/local/texlive + /usr/local/bin/pandoc + /usr/local/texlive/texmf-var + key: ${{ runner.os }}-r-${{ hashFiles('**/DESCRIPTION') }}-v1 - - uses: gradle/wrapper-validation-action@v1 - - uses: actions/cache@v3 - id: pandoc - with: - path: pandoc-2.19.2-1 - key: pandoc-2.19.2-1 - - name: Download pandoc-2.19.2-1-amd64.deb - if: steps.pandoc.outputs.cache-hit != 'true' - run: | - mkdir pandoc-2.19.2-1 - cd pandoc-2.19.2-1 - wget https://github.com/jgm/pandoc/releases/download/2.19.2/pandoc-2.19.2-1-amd64.deb - - name: Install pandoc - run: | - cd pandoc-2.19.2-1 - sudo dpkg -i pandoc-2.19.2-1-amd64.deb + - uses: r-lib/actions/setup-r@v2 - - name: Check pandoc version - run: pandoc --version + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + cache-version: 2 + working-directory: rDNA/rDNA + extra-packages: | + any::devtools + any::testthat + any::ggplot2 + any::roxygen2 + any::igraph + any::ggraph + any::askpass + any::cluster + any::sna + any::ggrepel + any::coda + any::MCMCpack + any::tidygraph + any::heatmaply + any::factoextra + any::MASS + any::pbmcapply + Bibliography: + needs: install-dependencies + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: r-lib/actions/setup-tinytex@v2 + - uses: gradle/wrapper-validation-action@v1 - name: Setup Gradle uses: gradle/gradle-build-action@v2.4.2 - - name: Execute Gradle build for bibliography run: ./gradlew :bibliography:build - - name: Store artifacts uses: actions/upload-artifact@v3 with: @@ -68,33 +101,16 @@ jobs: path: build/*.jar rDNA: + needs: [DNA, install-dependencies] runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: r-lib/actions/setup-r@v2 - - - uses: r-lib/actions/setup-r-dependencies@v2 - with: - cache-version: 2 - working-directory: rDNA/rDNA - extra-packages: | - any::ggplot2 - any::roxygen2 - any::igraph - any::ggraph - any::askpass - any::cluster - any::sna - - uses: gradle/wrapper-validation-action@v1 - - name: Setup Gradle uses: gradle/gradle-build-action@v2.4.2 - - name: Execute Gradle build for rDNA run: ./gradlew :rDNA:build - - name: Store artifacts uses: actions/upload-artifact@v3 with: @@ -103,9 +119,8 @@ jobs: rDNA-check: runs-on: ${{ matrix.config.os }} - + needs: rDNA name: ${{ matrix.config.os }} (${{ matrix.config.r }}) - strategy: fail-fast: false matrix: @@ -115,29 +130,39 @@ jobs: - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} - {os: ubuntu-latest, r: 'release'} - {os: ubuntu-latest, r: 'oldrel-1'} - env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} R_KEEP_PKG_SOURCE: yes - steps: - uses: actions/checkout@v3 - - - uses: r-lib/actions/setup-pandoc@v2 - - uses: r-lib/actions/setup-r@v2 with: r-version: ${{ matrix.config.r }} http-user-agent: ${{ matrix.config.http-user-agent }} use-public-rspm: true - - uses: r-lib/actions/setup-r-dependencies@v2 with: extra-packages: any::rcmdcheck needs: check working-directory: rDNA/rDNA - - uses: r-lib/actions/check-r-package@v2 with: working-directory: rDNA/rDNA upload-snapshots: true + + rDNA-test: + runs-on: ubuntu-latest + needs: [rDNA, install-dependencies] + steps: + - uses: actions/checkout@v3 + - uses: r-lib/actions/setup-r@v2 + - uses: gradle/wrapper-validation-action@v1 + - name: Setup Gradle + uses: gradle/gradle-build-action@v2.4.2 + - name: Execute Gradle rDNATest Task + run: ./gradlew :rDNA:rDNATest + - name: Store test results + uses: actions/upload-artifact@v3 + with: + name: rDNA-Test-Results + path: build/reports/tests diff --git a/bibliography/bibliography.bib b/bibliography/bibliography.bib index a07f43f5..bb59756b 100644 --- a/bibliography/bibliography.bib +++ b/bibliography/bibliography.bib @@ -2828,6 +2828,15 @@ @article{starke2023green doi={10.1016/j.jclepro.2023.139058} } +@article{steemers2024united, + title={The {U}nited {K}ingdom's {R}ejoin Movement: A Post-{B}rexit Analysis of Framing Strategies}, + author={Steemers, Kai}, + journal={British Journal of Politics and International Relations}, + year={2024}, + doi={10.1177/13691481241269308}, + note={Forthcoming} +} + @article{steinfeld2016f, title={The {F}-Campaign: A Discourse Network Analysis of Party Leaders' Campaign Statements on {F}acebook}, author={Steinfeld, Nili}, diff --git a/bibliography/build.gradle b/bibliography/build.gradle index 537c685d..a48cc1f5 100644 --- a/bibliography/build.gradle +++ b/bibliography/build.gradle @@ -1,3 +1,7 @@ +plugins { + id 'base' +} + task bibliographyMarkdown { inputs.dir '.' doLast { @@ -47,7 +51,7 @@ task bibliographyPdflatex { } } -task build { +build { dependsOn bibliographyMarkdown dependsOn bibliographyPdflatex inputs.dir '.' @@ -56,3 +60,25 @@ task build { doLast {} } + +clean { + doFirst { + println "Attempting to delete bibliography files..." + + def filesToDelete = fileTree(dir: "$rootDir/build", include: '**/bibliography.*').files + if (filesToDelete.isEmpty()) { + println "No bibliography files found to delete." + } else { + println "Found bibliography files to delete: " + filesToDelete.each { file -> + println file.absolutePath + } + } + } + + delete fileTree(dir: "$rootDir/build", include: '**/bibliography.*') + + doLast { + println "Bibliography files have been removed." + } +} diff --git a/build/bibliography.md b/build/bibliography.md index dc3aaec0..c228f836 100644 --- a/build/bibliography.md +++ b/build/bibliography.md @@ -4,7 +4,7 @@ author: bibliography: - bibliography.bib csl: apa-numeric-superscript-brackets.csl -date: 2024-08-10 +date: 2024-08-19 title: "Discourse Network Analysis: Bibliography" --- @@ -2462,9 +2462,18 @@ conflicts. *Journal of Cleaner Production*, *425*, 139058. +
+ +266\. Steemers, K. (2024). The United Kingdom’s Rejoin movement: A +post-Brexit analysis of framing strategies. *British Journal of Politics +and International Relations*. + + +
+
-266\. Steinfeld, N. (2016). The F-campaign: A discourse network analysis +267\. Steinfeld, N. (2016). The F-campaign: A discourse network analysis of party leaders’ campaign statements on Facebook. *Israel Affairs*, *22*(3–4), 743–759. @@ -2472,7 +2481,7 @@ of party leaders’ campaign statements on Facebook. *Israel Affairs*,
-267\. St-Jacques, B. (2019). *Us and them. Mapping discourse coalitions +268\. St-Jacques, B. (2019). *Us and them. Mapping discourse coalitions in the EU copyright directive debate* \[Master's Thesis, Hertie School of Governance, Master of Public Policy\]. @@ -2481,7 +2490,7 @@ of Governance, Master of Public Policy\].
-268\. Stoddart, M. C. J., Koop-Monteiro, Y., & Tindall, D. B. (2024). +269\. Stoddart, M. C. J., Koop-Monteiro, Y., & Tindall, D. B. (2024). Instagram as an arena of climate change communication and mobilization: A discourse network analysis of COP26. *Environmental Communication*. @@ -2490,7 +2499,7 @@ A discourse network analysis of COP26. *Environmental Communication*.
-269\. Stoddart, M. C. J., Mattoni, A., & McLevey, J. (2020). *Industrial +270\. Stoddart, M. C. J., Mattoni, A., & McLevey, J. (2020). *Industrial development and eco-tourisms. Can oil extraction and nature conservation co-exist?* Palgrave Macmillan. @@ -2499,7 +2508,7 @@ co-exist?* Palgrave Macmillan.
-270\. Stoddart, M. C. J., McCurdy, P., Slawinski, N., & Collins, C. G. +271\. Stoddart, M. C. J., McCurdy, P., Slawinski, N., & Collins, C. G. (2020). Envisioning energy futures in the North Atlantic oil industry: Avoidance, persistence, and transformation as responses to climate change. *Energy Research & Social Science*, *69*, 101662. @@ -2509,7 +2518,7 @@ change. *Energy Research & Social Science*, *69*, 101662.
-271\. Stoddart, M. C. J., & Nezhadhossein, E. (2016). Is nature-oriented +272\. Stoddart, M. C. J., & Nezhadhossein, E. (2016). Is nature-oriented tourism a pro-environmental practice? Examining tourism–environmentalism alignments through discourse networks and intersectoral relationships. *The Sociological Quarterly*, *57*(3), 544–568. @@ -2519,7 +2528,7 @@ alignments through discourse networks and intersectoral relationships.
-272\. Stoddart, M. C. J., Ramos, H., Foster, K., & Ylä-Anttila, T. +273\. Stoddart, M. C. J., Ramos, H., Foster, K., & Ylä-Anttila, T. (2023). Competing crises? Media coverage and framing of climate change during the COVID-19 pandemic. *Environmental Communication*, *17*(3), 276–292. @@ -2528,7 +2537,7 @@ during the COVID-19 pandemic. *Environmental Communication*, *17*(3),
-273\. Stoddart, M. C. J., & Smith, J. (2016). The endangered arctic, the +274\. Stoddart, M. C. J., & Smith, J. (2016). The endangered arctic, the arctic as resource frontier: Canadian news media narratives of climate change and the north. *Canadian Review of Sociology/Revue Canadienne de Sociologie*, *53*(3), 316–336. @@ -2537,7 +2546,7 @@ Sociologie*, *53*(3), 316–336.
-274\. Stoddart, M. C. J., & Tindall, D. B. (2015). Canadian news media +275\. Stoddart, M. C. J., & Tindall, D. B. (2015). Canadian news media and the cultural dynamics of multilevel climate governance. *Environmental Politics*, *24*(3), 401–422. @@ -2546,7 +2555,7 @@ and the cultural dynamics of multilevel climate governance.
-275\. Stoddart, M. C. J., Tindall, D. B., Smith, J., & Haluza-Delay, R. +276\. Stoddart, M. C. J., Tindall, D. B., Smith, J., & Haluza-Delay, R. (2017). Media access and political efficacy in the eco-politics of climate change: Canadian national news and mediated policy networks. *Environmental Communication*, *11*(3), 386–400. @@ -2556,7 +2565,7 @@ climate change: Canadian national news and mediated policy networks.
-276\. Stoddart, M. C. J., & Yang, Y. (2022). What are the roles of +277\. Stoddart, M. C. J., & Yang, Y. (2022). What are the roles of regional and local climate governance discourse and actors? Mediated climate change policy networks in Atlantic Canada. *Review of Policy Research*, *40*(6), 1144–1168. @@ -2565,7 +2574,7 @@ Research*, *40*(6), 1144–1168.
-277\. Sumirat, P. A., & Eriyanto, E. (2023). Koalisi wacana dalam debat +278\. Sumirat, P. A., & Eriyanto, E. (2023). Koalisi wacana dalam debat pemekaran Papua: Analisis jaringan wacana debat pemekaran tiga provinsi Baru di Papua. *Jurnal Riset Komunikasi (JURKOM)*, *6*(2), 1–16. @@ -2574,7 +2583,7 @@ Baru di Papua. *Jurnal Riset Komunikasi (JURKOM)*, *6*(2), 1–16.
-278\. Swacha, P., Karaczun, Z. M., & Murawska, D. (2022). The +279\. Swacha, P., Karaczun, Z. M., & Murawska, D. (2022). The Europeanization of Polish climate policy. *Ekonomia i Środowisko – Economics and Environment*, *83*(4), 62–75. @@ -2583,7 +2592,7 @@ Economics and Environment*, *83*(4), 62–75.
-279\. Swarnakar, P., Shukla, R., & Broadbent, J. (2022). Beliefs and +280\. Swarnakar, P., Shukla, R., & Broadbent, J. (2022). Beliefs and networks: Mapping the Indian climate policy discourse surrounding the Paris climate change conference in 2015. *Environmental Communication*, *16*(2), 145–162. @@ -2592,7 +2601,7 @@ Paris climate change conference in 2015. *Environmental Communication*,
-280\. Swedenmark, S. Ö. (2018). *“Vi ska sträcka oss lite längre +281\. Swedenmark, S. Ö. (2018). *“Vi ska sträcka oss lite längre än vi behöver.” En fallstudie om diskursen kring mellanorganisatorisk samverkan inom Stockholmsregionen* \[Magisteruppsats i statsvetenskap, Mittuniversitetet\]. @@ -2602,7 +2611,7 @@ kring mellanorganisatorisk samverkan inom Stockholmsregionen*
-281\. Swinkels, E. M. (2021). *The role of EU leaders and ideas in +282\. Swinkels, E. M. (2021). *The role of EU leaders and ideas in managing the Eurozone crisis: Navigating uncharted territory* \[PhD thesis, Utrecht University\]. @@ -2610,7 +2619,7 @@ thesis, Utrecht University\].
-282\. Swinkels, M., & Esch, F. van. (2022). Deciding upon the banking +283\. Swinkels, M., & Esch, F. van. (2022). Deciding upon the banking union: How a joint belief shift instigated deep institutional change in Eurozone governance. *European Policy Analysis*, *8*(1), 9–32. @@ -2619,7 +2628,7 @@ Eurozone governance. *European Policy Analysis*, *8*(1), 9–32.
-283\. Syafrudin, M., Sarwono, Hakim, A., & Solimun. (2023). Examine the +284\. Syafrudin, M., Sarwono, Hakim, A., & Solimun. (2023). Examine the elements that impact food security. *Proceedings of the Fifth Annual International Conference on Business and Public Administration (AICoBPA 2022)*, 563–581. @@ -2628,7 +2637,7 @@ International Conference on Business and Public Administration (AICoBPA
-284\. Taranger, K. K. (2020). *The institutionalisation of climate +285\. Taranger, K. K. (2020). *The institutionalisation of climate justice in the global governance architecture* \[Master's Thesis, Universiteit Utrecht, Copernicus Institute of Sustainable Development, Environmental Governance Section\]. @@ -2637,7 +2646,7 @@ Environmental Governance Section\].
-285\. Tobin, P., Schmidt, N. M., Tosun, J., & Burns, C. (2018). Mapping +286\. Tobin, P., Schmidt, N. M., Tosun, J., & Burns, C. (2018). Mapping states’ Paris climate pledges: Analysing targets and groups at COP 21. *Global Environmental Change*, *48*, 11–21. @@ -2646,7 +2655,7 @@ states’ Paris climate pledges: Analysing targets and groups at COP 21.
-286\. Tolstukha, E. (2022). *Stalemate in the democratic reform debate +287\. Tolstukha, E. (2022). *Stalemate in the democratic reform debate of the European Union? A dynamic discourse network analysis of actors and their commitment to reform options* \[PhD thesis, University of Glasgow, School of Social; Political Sciences\]. @@ -2656,7 +2665,7 @@ Glasgow, School of Social; Political Sciences\].
-287\. Tosun, J., & Lang, A. (2016). The politics of hydraulic fracturing +288\. Tosun, J., & Lang, A. (2016). The politics of hydraulic fracturing in Germany: Party competition at different levels of government. In C. M. Weible, T. Heikkila, K. Ingold, & M. Fischer (Eds.), *Policy debates on hydraulic fracturing. Comparing coalition politics in North America @@ -2667,7 +2676,7 @@ and Europe* (pp. 177–200). Palgrave Macmillan.
-288\. Tosun, J., & Schaub, S. (2017). Mobilization in the European +289\. Tosun, J., & Schaub, S. (2017). Mobilization in the European public sphere: The struggle over genetically modified organisms. *Review of Policy Research*, *34*(3), 310–330. @@ -2676,7 +2685,7 @@ of Policy Research*, *34*(3), 310–330.
-289\. Tribulová, Z. (2019). *Postoj českej republiky k energetickej +290\. Tribulová, Z. (2019). *Postoj českej republiky k energetickej tranzícii v kontexte energiewende – analýza politického diskurzu* \[Master's Thesis, Masaryk University, Faculty of Social Studies\]. @@ -2685,7 +2694,7 @@ tranzícii v kontexte energiewende – analýza politického diskurzu*
-290\. Tuinenburg, J. (2019). *The effect of discourse networks on the +291\. Tuinenburg, J. (2019). *The effect of discourse networks on the leading support schemes for renewable electricity* \[Master's Thesis, Universiteit Utrecht, Sustainable Development, Earth System Governance\]. @@ -2694,7 +2703,7 @@ Governance\].
-291\. Umansky Casapa, N. (2022). *Securitization and social media +292\. Umansky Casapa, N. (2022). *Securitization and social media networks: Who tweets security?* \[Doctoral Thesis, University College Dublin, School of Politics; International Relations\]. @@ -2703,7 +2712,7 @@ Dublin, School of Politics; International Relations\].
-292\. Vanková, L. (2019). *Ťažba hnedého uhlia na hornej nitre: Analỳza +293\. Vanková, L. (2019). *Ťažba hnedého uhlia na hornej nitre: Analỳza diskurzívnych sietí* \[Master's Thesis, Masaryk University, Faculty of Social Studies\]. @@ -2711,7 +2720,7 @@ Social Studies\].
-293\. Vantaggiato, F. P., & Lubell, M. N. (2024). *Governing sea level +294\. Vantaggiato, F. P., & Lubell, M. N. (2024). *Governing sea level rise in a polycentric system. Easier said than done*. Cambridge University Press. @@ -2719,7 +2728,7 @@ University Press.
-294\. Vaughan, M. (2020). Talking about tax: The discursive distance +295\. Vaughan, M. (2020). Talking about tax: The discursive distance between 38 Degrees and GetUp. *Journal of Information Technology & Politics*, *17*(2), 114–129. @@ -2728,7 +2737,7 @@ Politics*, *17*(2), 114–129.
-295\. Vedres, B. (2022). Multivocality and robust action dynamics in +296\. Vedres, B. (2022). Multivocality and robust action dynamics in political discourse. *Poetics*, *90*, 101576. @@ -2736,7 +2745,7 @@ political discourse. *Poetics*, *90*, 101576.
-296\. Vesa, J., Gronow, A., & Ylä-Anttila, T. (2020). The quiet +297\. Vesa, J., Gronow, A., & Ylä-Anttila, T. (2020). The quiet opposition: How the pro-economy lobby influences climate policy. *Global Environmental Change*, *63*, 102117. @@ -2745,7 +2754,7 @@ Environmental Change*, *63*, 102117.
-297\. Vogeler, C. S. (2022). The integration of environmental objectives +298\. Vogeler, C. S. (2022). The integration of environmental objectives in the common agricultural policy – partisan politics in the European Parliament. *Zeitschrift für Vergleichende Politikwissenschaft*, *15*(4), 551–569. @@ -2754,7 +2763,7 @@ Parliament. *Zeitschrift für Vergleichende Politikwissenschaft*,
-298\. Vogeler, C. S., Möck, M., & Bandelow, N. C. (2021). Shifting +299\. Vogeler, C. S., Möck, M., & Bandelow, N. C. (2021). Shifting governance cooperatively – coordination by public discourses in the German water–food nexus. *Journal of Environmental Management*, *286*, 112266. @@ -2763,7 +2772,7 @@ German water–food nexus. *Journal of Environmental Management*, *286*,
-299\. Vogeler, C. S., Schwindenhammer, S., Gonglach, D., & Bandelow, N. +300\. Vogeler, C. S., Schwindenhammer, S., Gonglach, D., & Bandelow, N. C. (2021). Agri-food technology politics: Exploring policy narratives in the European Parliament. *European Policy Analysis*, *7*, 324–343. @@ -2772,7 +2781,7 @@ the European Parliament. *European Policy Analysis*, *7*, 324–343.
-300\. Völker, T., & Saldivia Gonzatti, D. (2024). Discourse networks of +301\. Völker, T., & Saldivia Gonzatti, D. (2024). Discourse networks of the far right: How far-right actors become mainstream in public debates. *Political Communication*, *41*(3), 353–372. @@ -2781,7 +2790,7 @@ the far right: How far-right actors become mainstream in public debates.
-301\. Steinsdorff, S. von, Gottmann, L., Hüggelmeyer, M., Jeske, I.-M., +302\. Steinsdorff, S. von, Gottmann, L., Hüggelmeyer, M., Jeske, I.-M., Onkelbach, C., & Siebeking, J. (2021). Plenardebatten als Spiegel sich wandelnder Diskurskoalitionen: Die Positionierung der Bundestagsfraktionen zum Verhältnis von Ökologie und Ökonomie seit 1977. @@ -2792,7 +2801,7 @@ Bundestagsfraktionen zum Verhältnis von Ökologie und Ökonomie seit 1977.
-302\. Wagemans, S. (2023). *A shadow on solar mobility: The impact of +303\. Wagemans, S. (2023). *A shadow on solar mobility: The impact of failure on socio-technical system configurations* \[Master’s thesis, Universiteit Utrecht, Copernicus Institute of Sustainable Development\]. @@ -2801,7 +2810,7 @@ Universiteit Utrecht, Copernicus Institute of Sustainable Development\].
-303\. Wagner, P., & Payne, D. (2017). Trends, frames and discourse +304\. Wagner, P., & Payne, D. (2017). Trends, frames and discourse networks: Analysing the coverage of climate change in Irish newspapers. *Irish Journal of Sociology*, *25*(1), 5–28. @@ -2810,7 +2819,7 @@ networks: Analysing the coverage of climate change in Irish newspapers.
-304\. Wallaschek, S. (2019). The discursive appeal to solidarity and +305\. Wallaschek, S. (2019). The discursive appeal to solidarity and partisan journalism in Europe’s migration crisis. *Social Inclusion*, *7*(2), 187–197. @@ -2818,7 +2827,7 @@ partisan journalism in Europe’s migration crisis. *Social Inclusion*,
-305\. Wallaschek, S. (2019). *Mapping solidarity in Europe. Discourse +306\. Wallaschek, S. (2019). *Mapping solidarity in Europe. Discourse networks in the Euro crisis and Europe’s migration crisis* \[Doctoral Dissertation, University of Bremen, Bremen International Graduate School of Social Sciences (BIGSSS), Department of Social Sciences\]. @@ -2828,7 +2837,7 @@ of Social Sciences (BIGSSS), Department of Social Sciences\].
-306\. Wallaschek, S. (2020). Analyzing the European parliamentary +307\. Wallaschek, S. (2020). Analyzing the European parliamentary elections in 2019: Actor visibility and issue-framing in transnational media. In M. Kaeding, M. Müller, & J. Schmälter (Eds.), *Die Europwahl 2019. Ringen um die Zukunft Europas* (pp. 219–230). Springer VS. @@ -2838,7 +2847,7 @@ media. In M. Kaeding, M. Müller, & J. Schmälter (Eds.), *Die Europwahl
-307\. Wallaschek, S. (2020). Contested solidarity in the Euro crisis and +308\. Wallaschek, S. (2020). Contested solidarity in the Euro crisis and Europe’s migration crisis: A discourse network analysis. *Journal of European Public Policy*, *27*(7), 1034–1053. @@ -2847,7 +2856,7 @@ European Public Policy*, *27*(7), 1034–1053.
-308\. Wallaschek, S. (2020). Framing solidarity in the Euro crisis: A +309\. Wallaschek, S. (2020). Framing solidarity in the Euro crisis: A comparison of the German and Irish media discourse. *New Political Economy*, *25*(2), 231–247. @@ -2856,7 +2865,7 @@ Economy*, *25*(2), 231–247.
-309\. Wallaschek, S. (2020). The discursive construction of solidarity: +310\. Wallaschek, S. (2020). The discursive construction of solidarity: Analysing public claims in Europe’s migration crisis. *Political Studies*, *68*(1), 74–92. @@ -2864,7 +2873,7 @@ Studies*, *68*(1), 74–92.
-310\. Wallaschek, S. (2017). Notions of solidarity in Europe’s migration +311\. Wallaschek, S. (2017). Notions of solidarity in Europe’s migration crisis: The case of Germany’s media discourse. *EuropeNow Journal*, *11*. @@ -2872,7 +2881,7 @@ crisis: The case of Germany’s media discourse. *EuropeNow Journal*,
-311\. Wallaschek, S., Kaushik, K., Verbalyte, M., Sojka, A., Sorci, G., +312\. Wallaschek, S., Kaushik, K., Verbalyte, M., Sojka, A., Sorci, G., Trenz, H.-J., & Eigmüller, M. (2022). Same same but different? Gender politics and (trans-) national value contestation in Europe on Twitter. *Politics and Governance*, *10*(1), 146–160. @@ -2882,7 +2891,7 @@ politics and (trans-) national value contestation in Europe on Twitter.
-312\. Wallaschek, S., Starke, C., & Brüning, C. (2020). Solidarity in +313\. Wallaschek, S., Starke, C., & Brüning, C. (2020). Solidarity in the public sphere: A discourse network analysis of German newspapers (2008–2017). *Politics and Governance*, *8*(2). @@ -2891,7 +2900,7 @@ the public sphere: A discourse network analysis of German newspapers
-313\. Wang, S. (2018). *Dynamic constructed climate change discourses +314\. Wang, S. (2018). *Dynamic constructed climate change discourses and discourse networks across newspapers in China around three critical policy moments: A comparative study of People’s Daily, China Daily, and Southern Weekend* \[PhD thesis, University of Exeter, Department of @@ -2901,7 +2910,7 @@ Politics\].
-314\. Wang, S. (2024). *Communicating climate change in China. A dynamic +315\. Wang, S. (2024). *Communicating climate change in China. A dynamic discourse approach*. Palgrave Macmillan. @@ -2909,7 +2918,7 @@ discourse approach*. Palgrave Macmillan.
-315\. Wang, C., & Wang, L. (2017). Unfolding policies for innovation +316\. Wang, C., & Wang, L. (2017). Unfolding policies for innovation intermediaries in China: A discourse network analysis. *Science and Public Policy*, *44*(3), 354–368. @@ -2918,7 +2927,7 @@ Public Policy*, *44*(3), 354–368.
-316\. Wang, Y. (2021). Examining the actor coalitions and discourse +317\. Wang, Y. (2021). Examining the actor coalitions and discourse coalitions of the opt-out movement in New York: A discourse network analysis. *Teachers College Record*, *123*(5), 1–26. @@ -2927,7 +2936,7 @@ analysis. *Teachers College Record*, *123*(5), 1–26.
-317\. Wang, Y. (2017). The social networks and paradoxes of the opt-out +318\. Wang, Y. (2017). The social networks and paradoxes of the opt-out movement amid the common core state standards implementation. *Education Policy Analysis Archives*, *25*(34), 1–27. @@ -2936,7 +2945,7 @@ Policy Analysis Archives*, *25*(34), 1–27.
-318\. Wang, Y. (2020). Understanding Congressional coalitions: A +319\. Wang, Y. (2020). Understanding Congressional coalitions: A discourse network analysis of Congressional hearings for the Every Student Succeeds act. *Education Policy Analysis Archives*, *28*(119), 1–30. @@ -2945,7 +2954,7 @@ Student Succeeds act. *Education Policy Analysis Archives*, *28*(119),
-319\. Wesche, J. P., Negro, S. O., Brugger, H. I., Eichhammer, W., & +320\. Wesche, J. P., Negro, S. O., Brugger, H. I., Eichhammer, W., & Hekkert, M. P. (2024). The influence of visions on cooperation among interest organizations in fragmented socio-technical systems. *Environmental Policy and Governance*, *34*(2), 152–165. @@ -2955,7 +2964,7 @@ interest organizations in fragmented socio-technical systems.
-320\. Westenberger, G.-J., & Schneider, V. (2022). Söders Ökofeuerwerk +321\. Westenberger, G.-J., & Schneider, V. (2022). Söders Ökofeuerwerk und die grünfärbung der CSU: Diskursnetzwerke im bayrischen Themenwettbewerb. *Zeitschrift für Vergleichende Politikwissenschaft*, *15*(4), 641–665. @@ -2964,7 +2973,7 @@ Themenwettbewerb. *Zeitschrift für Vergleichende Politikwissenschaft*,
-321\. Wibisono, H., Lovett, J. C., & Anindito, D. B. (2023). The +322\. Wibisono, H., Lovett, J. C., & Anindito, D. B. (2023). The contestation of ideas behind Indonesia’s rural electrification policies: The influence of global and national institutional dynamics. *Development Policy Review*, *41*(1), e12650. @@ -2974,7 +2983,7 @@ The influence of global and national institutional dynamics.
-322\. Witkowski, K., Whetsell, T. A., & Ganapati, N. E. (2024). Using +323\. Witkowski, K., Whetsell, T. A., & Ganapati, N. E. (2024). Using collaborative governance to regulate sober living facilities: Structures and strategies for mitigating the influence of powerful actors in multi-sectoral networks. *Administration & Society*, *56*(4), 473–510. @@ -2984,7 +2993,7 @@ multi-sectoral networks. *Administration & Society*, *56*(4), 473–510.
-323\. Wu, J., & Liu, Y. (2020). Deception detection methods +324\. Wu, J., & Liu, Y. (2020). Deception detection methods incorporating discourse network metrics in synchronous computer-mediated communication. *Journal of Information Science*, *46*(1), 64–81. @@ -2993,7 +3002,7 @@ communication. *Journal of Information Science*, *46*(1), 64–81.
-324\. Wu, J., & Zhou, L. (2015). DOBNet: Exploiting the discourse of +325\. Wu, J., & Zhou, L. (2015). DOBNet: Exploiting the discourse of deception behaviour to uncover online deception strategies. *Behaviour & Information Technology*, *34*(9), 936–948. @@ -3002,7 +3011,7 @@ Information Technology*, *34*(9), 936–948.
-325\. Yan, K., Wu, H., Bu, K., & Wu, L. (2024). The college admission +326\. Yan, K., Wu, H., Bu, K., & Wu, L. (2024). The college admission policy evolution from 2003 to 2020 in China – a social network analysis. *Higher Education Policy*, *37*, 209–236. @@ -3011,7 +3020,7 @@ policy evolution from 2003 to 2020 in China – a social network analysis.
-326\. Yap, X.-S., Heiberg, J., Truffer, B., David, E., & Kneib, J.-P. +327\. Yap, X.-S., Heiberg, J., Truffer, B., David, E., & Kneib, J.-P. (2023). Emerging global socio-technical regimes for tackling space debris: A discourse network analysis. *Acta Astronautica*, *207*, 445–454. @@ -3020,7 +3029,7 @@ debris: A discourse network analysis. *Acta Astronautica*, *207*,
-327\. You, J., Weible, C. M., & Heikkila, T. (2021). Exploring +328\. You, J., Weible, C. M., & Heikkila, T. (2021). Exploring instigator and defender policy scenarios in the siting of energy infrastructure. *Politics & Policy*, *50*(1), 8–32. @@ -3029,7 +3038,7 @@ infrastructure. *Politics & Policy*, *50*(1), 8–32.
-328\. Yordy, J., Durnová, A., & Weible, C. M. (2024). Exploring +329\. Yordy, J., Durnová, A., & Weible, C. M. (2024). Exploring emotional discourses: The case of COVID-19 protests in the US media. *Administrative Theory & Praxis*, *46*(1), 35–54. @@ -3038,7 +3047,7 @@ emotional discourses: The case of COVID-19 protests in the US media.
-329\. Yordy, J., You, J., Park, K., Weible, C. M., & Heikkila, T. +330\. Yordy, J., You, J., Park, K., Weible, C. M., & Heikkila, T. (2019). Framing contests and policy conflicts over gas pipelines. *Review of Policy Research*, *36*(6), 736–756. @@ -3047,7 +3056,7 @@ emotional discourses: The case of COVID-19 protests in the US media.
-330\. You, J., Yordy, J., Park, K., Heikkila, T., & Weible, C. M. +331\. You, J., Yordy, J., Park, K., Heikkila, T., & Weible, C. M. (2020). Policy conflicts in the siting of natural gas pipelines. *Journal of Environmental Policy & Planning*, *22*(4), 501–517. @@ -3056,7 +3065,7 @@ emotional discourses: The case of COVID-19 protests in the US media.
-331\. You, J., Yordy, J., Weible, C. M., Park, K., Heikkila, T., & +332\. You, J., Yordy, J., Weible, C. M., Park, K., Heikkila, T., & Gilchrist, D. (2021). Comparing policy conflict on electricity transmission line sitings. *Public Policy and Administration*, *38*(1), 107–129. @@ -3065,7 +3074,7 @@ transmission line sitings. *Public Policy and Administration*, *38*(1),
-332\. Žaková, K. (2023). *Expertization of the Czech climate policy +333\. Žaková, K. (2023). *Expertization of the Czech climate policy network* \[Master’s thesis, Masaryk University, Faculty of Social Studies\]. @@ -3073,7 +3082,7 @@ Studies\].
-333\. Zunaedi, Z. Z. H. (2024). Jejaring wacana cuitan Twitter pada +334\. Zunaedi, Z. Z. H. (2024). Jejaring wacana cuitan Twitter pada kontroversi konten pemeliharaan satwa liar. *Perspektif*, *13*(3), 756–766. diff --git a/dna/build.gradle b/dna/build.gradle index b4d6d65d..77db1c00 100644 --- a/dna/build.gradle +++ b/dna/build.gradle @@ -3,6 +3,10 @@ plugins { id 'java' } +tasks.withType(JavaCompile) { + options.release = 11 +} + // create jar file, not just .class files jar { inputs.dir '.' @@ -28,9 +32,6 @@ jar { } } - sourceCompatibility = '11' - targetCompatibility = '11' - destinationDirectory.set(file("$rootDir/build/")) } @@ -82,3 +83,16 @@ dependencies { // https://mvnrepository.com/artifact/org.apache.commons/commons-math3 implementation group: 'org.apache.commons', name: 'commons-math3', version: '3.6.1' } + +// Extend the default clean task to include custom directories and files +clean { + doFirst { + println "Attempting to delete jar file..." + } + + delete fileTree(dir: "$rootDir/build", include: '**/*.jar') + + doLast { + println "Jar file has been removed." + } +} diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 7454180f..a4b76b95 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ffed3a25..9355b415 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 1b6c7873..f5feea6d 100755 --- a/gradlew +++ b/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -80,13 +82,12 @@ do esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -133,22 +134,29 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac case $MAX_FD in #( '' | soft) :;; #( *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -193,11 +201,15 @@ if "$cygwin" || "$msys" ; then done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ @@ -205,6 +217,12 @@ set -- \ org.gradle.wrapper.GradleWrapperMain \ "$@" +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + # Use "xargs" to parse quoted args. # # With -n1 it outputs one arg per line, with the quotes and backslashes removed. diff --git a/gradlew.bat b/gradlew.bat index 107acd32..9d21a218 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -13,8 +13,10 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +27,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -40,13 +43,13 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +78,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/rDNA/build.gradle b/rDNA/build.gradle index 194ccbdf..86f78796 100644 --- a/rDNA/build.gradle +++ b/rDNA/build.gradle @@ -1,3 +1,11 @@ +import java.nio.file.Files +import java.nio.file.StandardCopyOption + +plugins { + id 'base' +} + +// Task to generate R documentation task rDNADocument { inputs.dir 'rDNA' doLast { @@ -8,55 +16,131 @@ task rDNADocument { } } -task rDNABuild { - dependsOn rDNADocument - inputs.dir 'rDNA' - def outputDir = file("$rootDir/build/") - doFirst { - delete fileTree(dir: outputDir, includes: ['*.tar.gz']) +// Task to find the most recent JAR file in the build directory +def findLatestJarFile() { + def jarDir = file("$rootDir/build") + def jarFiles = jarDir.listFiles({ file -> file.name.endsWith('.jar') } as FileFilter) + + if (jarFiles && jarFiles.size() > 0) { + return jarFiles.sort { -it.lastModified() }[0] + } else { + throw new GradleException("No jar files found in the build directory.") + } +} + +// Task to ensure the inst/java directory exists in the temporary build directory +task createJavaDirInTempBuildDir { + doLast { + def javaDir = file("$rootDir/build/temp-rDNA/inst/java") + if (!javaDir.exists()) { + println "Creating directory: ${javaDir.absolutePath}" + javaDir.mkdirs() + } else { + println "Directory already exists: ${javaDir.absolutePath}" + } + } +} + +// Task to copy the JAR file into the inst/java directory +task copyJarIntoTempBuildDir { + dependsOn ':dna:build', createJavaDirInTempBuildDir + doLast { + def latestJar = findLatestJarFile() + def destinationDir = file("$rootDir/build/temp-rDNA/inst/java") + + println "Copying JAR file: ${latestJar.name} to ${destinationDir.absolutePath}" + + // Copy the JAR file using Java NIO Files class + Files.copy(latestJar.toPath(), new File(destinationDir, latestJar.name).toPath(), StandardCopyOption.REPLACE_EXISTING) + + println "JAR file copied successfully." } +} + +// Task to copy R package sources to a temporary build directory +task copyRPackageSourcesToBuildDir(type: Copy) { + from "$rootDir/rDNA/rDNA" + into "$rootDir/build/temp-rDNA" + exclude 'inst/java/**' +} + +// Task to build the R package (create a .tar.gz file) and clean up after +task rDNABuild(dependsOn: [rDNADocument, copyRPackageSourcesToBuildDir, copyJarIntoTempBuildDir]) { doLast { - mkdir "$rootDir/build" + // Delete old .tar.gz files in the build directory + def buildDir = file("$rootDir/build") + buildDir.listFiles({ file -> file.name.endsWith('.tar.gz') } as FileFilter)?.each { it.delete() } + + // Build the R package in the temporary directory exec { - workingDir "$rootDir/build/" - commandLine 'R', "CMD", "build", "../rDNA/rDNA" + workingDir "$rootDir/build" + commandLine 'R', 'CMD', 'build', 'temp-rDNA' } + + println "R package built successfully." + + // Cleanup the temporary build directory + delete file("$rootDir/build/temp-rDNA") + println "Temporary directory temp-rDNA deleted." } - outputs.dir outputDir } +// Task to check the R package using the .tar.gz file task rDNACheck { - inputs.dir 'rDNA' doLast { - mkdir "$rootDir/build" + def tarGzFile = file("$rootDir/build").listFiles({ file -> file.name.endsWith('.tar.gz') } as FileFilter)[0] exec { - workingDir "rDNA" - commandLine 'R', "-e", "devtools::check(manual = TRUE, check_dir = '../../build/')" + workingDir "$rootDir/build" + commandLine 'R', 'CMD', 'check', '--as-cran', tarGzFile.absolutePath } + println "R package check completed." } - def outputDir = file("$rootDir/build/") - outputs.dir outputDir } -task rDNATest { - inputs.dir 'rDNA' +// Task to test the R package and generate code coverage report +task rDNATest(dependsOn: [rDNADocument, copyRPackageSourcesToBuildDir, copyJarIntoTempBuildDir]) { doLast { - mkdir "$rootDir/build" + def packageName = "rDNA" // Ensure this matches the Package field in DESCRIPTION + def tempDir = file("$rootDir/build/${packageName}") + + // Rename the directory to match the package name + file("$rootDir/build/temp-rDNA").renameTo(tempDir) + + // Run tests using devtools::test() directly on the package source directory exec { - workingDir "rDNA" - commandLine 'R', "-e", "devtools::test()" + workingDir tempDir.absolutePath + commandLine 'R', '-e', 'devtools::test()' } + + // Run code coverage using covr::codecov() on the package source directory exec { - workingDir "rDNA" - commandLine 'R', "-e", "withr::with_envvar(c('NOT_CRAN' = 'true'), covr::codecov(quiet = FALSE))" + workingDir tempDir.absolutePath + commandLine 'R', '-e', 'covr::codecov()' } + + println "R package testing and code coverage completed." + println "Deleting temporary directory..." + delete tempDir + println "Temporary directory deleted." + } +} + +// Extend the default clean task to include custom directories and files +clean { + doFirst { + println "Attempting to delete temporary directory and .tar.gz file..." + } + + delete "$rootDir/build/temp-rDNA" + delete "$rootDir/build/rDNA.Rcheck" + delete fileTree(dir: "$rootDir/build", include: '**/*.tar.gz') + + doLast { + println "Temporary build directories and .tar.gz files have been removed." } } -task build { +// Main build task +build { dependsOn rDNABuild - inputs.dir 'rDNA' - def outputDir = file("$rootDir/build/") - outputs.dir outputDir - doLast {} } diff --git a/rDNA/rDNA/.Rbuildignore b/rDNA/rDNA/.Rbuildignore index d2176e93..91114bf2 100644 --- a/rDNA/rDNA/.Rbuildignore +++ b/rDNA/rDNA/.Rbuildignore @@ -1,3 +1,2 @@ ^.*\.Rproj$ ^\.Rproj\.user$ -inst/java/ diff --git a/rDNA/rDNA/DESCRIPTION b/rDNA/rDNA/DESCRIPTION index 33a3623a..30d9889d 100755 --- a/rDNA/rDNA/DESCRIPTION +++ b/rDNA/rDNA/DESCRIPTION @@ -1,6 +1,6 @@ Package: rDNA Version: 3.0.11 -Date: 2024-08-17 +Date: 2024-08-19 Title: Discourse Network Analysis in R Authors@R: c(person(given = "Philip", @@ -21,7 +21,9 @@ Authors@R: role = "ctb")) Maintainer: Philip Leifeld Description: Qualitative content analysis and discourse network analysis - using the Java software Discourse Network Analyzer (DNA). + using the Java software Discourse Network Analyzer (DNA). This + package includes a proprietary Java `.jar` file that is provided for + internal use only. Depends: R (>= 4.1.0) Imports: @@ -44,9 +46,9 @@ Suggests: MCMCpack (>= 1.7-0), coda (>= 0.19-4.1) SystemRequirements: Java (>= 11) -License: GPL-2 URL: https://github.com/leifeld/dna BugReports: https://github.com/leifeld/dna/issues +License: GPL-3 | file LICENSE Encoding: UTF-8 Language: en-US RoxygenNote: 7.3.1 diff --git a/rDNA/rDNA/LICENSE b/rDNA/rDNA/LICENSE new file mode 100644 index 00000000..aee97fa1 --- /dev/null +++ b/rDNA/rDNA/LICENSE @@ -0,0 +1,4 @@ +The R code in this package is licensed under the GPL-3 license. + +The included Java `.jar` file is proprietary and is provided for use within this package only. +No rights are granted to redistribute or modify the `.jar` file. All rights are reserved by the original author. diff --git a/rDNA/rDNA/R/rDNA.R b/rDNA/rDNA/R/rDNA.R index 6d3e14dd..c6b04f5d 100644 --- a/rDNA/rDNA/R/rDNA.R +++ b/rDNA/rDNA/R/rDNA.R @@ -44,7 +44,7 @@ dnaEnvironment <- new.env(hash = TRUE, parent = emptyenv()) #' dna_init() #' } #' -#' @family {rDNA package startup} +#' @family startup #' #' @export #' @importFrom rJava .jinit .jnew .jarray @@ -94,7 +94,7 @@ dna_init <- function(jarfile = dna_jar(), memory = 1024, returnString = FALSE) { #' #' @author Philip Leifeld #' -#' @family {rDNA package startup} +#' @family startup #' #' @export dna_getHeadlessDna <- function() { @@ -108,18 +108,18 @@ dna_getHeadlessDna <- function() { #' rDNA requires the installation of a DNA jar file to run properly. While it is #' possible to store the jar file in the respective working directory, it is #' preferable to install it in the rDNA library installation directory under -#' \code{inst/java/}. The \code{dna_jar} function attempts to find the version -#' of the jar file that matches the installed \pkg{rDNA} version in the -#' \code{inst/java/} sub-directory of the package library path and return the -#' jar file name including its full path. If this fails, it will try to find the -#' jar file in the current working directory and return its file name. If this -#' fails as well, it will attempt to download the matching jar file from GitHub -#' and store it in the library path and return its file name. If this fails, it -#' will attempt to store the downloaded jar file in the working directory and -#' return its file name. If this fails as well, it will clone the current DNA -#' master code from GitHub to a local temporary directory, build the jar file -#' from source, and attempt to store the built jar file in the library path or, -#' if this fails, in the working directory and return the file name of the jar +#' \code{java/}. The \code{dna_jar} function attempts to find the version of the +#' jar file that matches the installed \pkg{rDNA} version in the \code{java/} +#' sub-directory of the package library path and return the jar file name +#' including its full path. If this fails, it will try to find the jar file in +#' the current working directory and return its file name. If this fails as +#' well, it will attempt to download the matching jar file from GitHub and store +#' it in the library path and return its file name. If this fails, it will +#' attempt to store the downloaded jar file in the working directory and return +#' its file name. If this fails as well, it will clone the current DNA master +#' code from GitHub to a local temporary directory, build the jar file from +#' source, and attempt to store the built jar file in the library path or, if +#' this fails, in the working directory and return the file name of the jar #' file. If all of this fails, an error message is thrown. #' #' @return The file name of the jar file that matches the installed \pkg{rDNA} @@ -127,7 +127,7 @@ dna_getHeadlessDna <- function() { #' #' @author Philip Leifeld #' -#' @family {rDNA package startup} +#' @family startup #' #' @importFrom utils download.file unzip packageVersion #' @export @@ -135,7 +135,17 @@ dna_jar <- function() { # detect package version v <- as.character(packageVersion("rDNA")) - # try to locate jar file in library path and return jar file path + # try to locate jar file in library path under java/ and return jar file path + tryCatch({ + rdna_dir <- dirname(system.file(".", package = "rDNA")) + jar <- paste0(rdna_dir, "/java/dna-", v, ".jar") + if (file.exists(jar)) { + message("Jar file found in library path.") + return(jar) + } + }, error = function(e) {success <- FALSE}) + + # try to locate jar file in library path under inst/java/ and return jar file path tryCatch({ rdna_dir <- dirname(system.file(".", package = "rDNA")) jar <- paste0(rdna_dir, "/inst/java/dna-", v, ".jar") @@ -147,7 +157,7 @@ dna_jar <- function() { # try to locate jar file in working directory and return jar file path tryCatch({ - jar <- paste0(getwd(), "/inst/java/dna-", v, ".jar") + jar <- paste0(getwd(), "/dna-", v, ".jar") if (file.exists(jar)) { message("Jar file found in working directory.") return(jar) @@ -158,8 +168,8 @@ dna_jar <- function() { tryCatch({ rdna_dir <- dirname(system.file(".", package = "rDNA")) f <- paste0("https://github.com/leifeld/dna/releases/download/v", v, "/dna-", v, ".jar") - dest <- paste0(rdna_dir, "/inst/java/dna-", v, ".jar") - targetdir <- paste0(rdna_dir, "/", "inst/java/") + dest <- paste0(rdna_dir, "/java/dna-", v, ".jar") + targetdir <- paste0(rdna_dir, "/java/") dir.create(targetdir, recursive = TRUE, showWarnings = FALSE) suppressWarnings(download.file(url = f, destfile = dest, @@ -213,7 +223,7 @@ dna_jar <- function() { # try to copy built jar to library path tryCatch({ - targetdir <- paste0(find.package("rDNA"), "/", "inst/java/") + targetdir <- paste0(find.package("rDNA"), "/java/") dir.create(targetdir, recursive = TRUE, showWarnings = FALSE) dest <- paste0(targetdir, "dna-", v, ".jar") file.copy(from = builtjar, to = targetdir) @@ -237,7 +247,7 @@ dna_jar <- function() { stop("DNA jar file could not be identified or downloaded. Please download ", "the DNA jar file matching the version number of rDNA and store it in ", - "the inst/java/ directory of your rDNA library installation path or in ", + "the java/ sub-directory of your rDNA library installation path or in ", "your working directory. Your current rDNA version is ", v, ".") } @@ -260,7 +270,7 @@ dna_jar <- function() { #' #' @author Johannes B. Gruber, Philip Leifeld #' -#' @family {rDNA package startup} +#' @family startup #' #' @export dna_sample <- function(overwrite = FALSE) { @@ -313,7 +323,7 @@ dna_sample <- function(overwrite = FALSE) { #' #' @author Philip Leifeld #' -#' @family {rDNA database connections} +#' @family database #' @seealso \code{\link{dna_queryCoders}} #' #' @examples @@ -405,7 +415,7 @@ dna_openDatabase <- function(db_url, #' dna_closeDatabase() #' } #' -#' @family {rDNA database connections} +#' @family database #' #' @export #' @importFrom rJava .jcall @@ -450,7 +460,7 @@ dna_closeDatabase <- function() { #' dna_openConnectionProfile(file = "my profile.dnc", coderPassword = "sample") #' } #' -#' @family {rDNA database connections} +#' @family database #' #' @export #' @importFrom rJava .jcall @@ -505,7 +515,7 @@ dna_openConnectionProfile <- function(file, coderPassword = "") { #' #' @author Philip Leifeld #' -#' @family {rDNA database connections} +#' @family database #' #' @examples #' \dontrun{ @@ -560,7 +570,7 @@ dna_saveConnectionProfile <- function(file, coderPassword = "") { #' dna_printDetails() #' } #' -#' @family {rDNA database connections} +#' @family database #' #' @export #' @importFrom rJava .jcall @@ -603,7 +613,7 @@ dna_printDetails <- function() { #' } #' } #' -#' @family {rDNA database connections} +#' @family database #' #' @export dna_api <- function() { @@ -779,7 +789,7 @@ dna_getVariables <- function(statementType) { #' #' @author Philip Leifeld #' -#' @family {rDNA attributes} +#' @family attributes #' #' @importFrom rJava .jcall #' @importFrom rJava J @@ -1098,7 +1108,7 @@ dna_getAttributes <- function(statementType = NULL, #' #' @author Philip Leifeld #' -#' @family {rDNA networks} +#' @family networks #' #' @importFrom rJava .jarray #' @importFrom rJava .jcall @@ -1291,7 +1301,7 @@ dna_network <- function(networkType = "twomode", #' #' @author Philip Leifeld #' -#' @family {rDNA networks} +#' @family networks #' #' @export as.matrix.dna_network_onemode <- function(x, ...) { @@ -1316,7 +1326,7 @@ as.matrix.dna_network_onemode <- function(x, ...) { #' #' @author Philip Leifeld #' -#' @family {rDNA networks} +#' @family networks #' #' @export as.matrix.dna_network_twomode <- as.matrix.dna_network_onemode @@ -1340,7 +1350,7 @@ as.matrix.dna_network_twomode <- as.matrix.dna_network_onemode #' #' @author Philip Leifeld #' -#' @family {rDNA networks} +#' @family networks #' #' @export print.dna_network_onemode <- function(x, trim = 5, attr = TRUE, ...) { @@ -1393,7 +1403,7 @@ print.dna_network_onemode <- function(x, trim = 5, attr = TRUE, ...) { #' #' @author Philip Leifeld #' -#' @family {rDNA networks} +#' @family networks #' #' @export print.dna_network_twomode <- print.dna_network_onemode @@ -1639,7 +1649,7 @@ print.dna_network_twomode <- print.dna_network_onemode #' #' @author Tim Henrichsen #' -#' @family {rDNA networks} +#' @family networks #' #' @importFrom ggplot2 autoplot #' @importFrom ggplot2 aes @@ -1977,7 +1987,7 @@ autoplot.dna_network_twomode <- autoplot.dna_network_onemode #' } #' #' @author Philip Leifeld -#' @family {rDNA networks} +#' @family networks #' @importFrom rlang .data #' @export dna_tidygraph <- function(network, attributes = NULL, ...) { @@ -4753,8 +4763,8 @@ dna_phaseTransitions <- function(distanceMethod = "absdiff", timeWindow = "days", windowSize = 200, kernel = "uniform", - normalizeToOne = FALSE, - indentTime = TRUE, + normalizeToOne = TRUE, + indentTime = FALSE, excludeValues = list(), excludeAuthors = character(), excludeSources = character(), diff --git a/rDNA/rDNA/inst/CITATION b/rDNA/rDNA/inst/CITATION index 4141a39f..760d4a6e 100644 --- a/rDNA/rDNA/inst/CITATION +++ b/rDNA/rDNA/inst/CITATION @@ -1,18 +1,18 @@ -citHeader("To cite package rDNA in publications use:") - -if(!exists("meta") || is.null(meta)) meta <- packageDescription("rDNA") -year <- sub(".*(2[[:digit:]]{3})-.*", "\\1", meta$Date) -vers <- paste("R package version", meta$Version) -author <- meta$Author - -citEntry(entry="Manual", - title = "{rDNA. Discourse Network Analysis in R}", - author = author, - year = year, - note = vers, - organization = paste("University of Essex, Department of Government"), - address = "Colchester, UK", - textVersion = paste0("Leifeld, Philip (", year, "). rDNA. Discourse ", - "Network Analysis in R. ", vers, "."), - url = "https://github.com/leifeld/dna" +citEntry <- bibentry( + bibtype = "incollection", + title = "Discourse Network Analysis: Policy Debates as Dynamic Networks", + author = person(c("Philip"), "Leifeld"), + booktitle = "The Oxford Handbook of Political Networks", + editor = c( + person(c("Jennifer N."), "Victor"), + person(c("Alexander H."), "Montgomery"), + person(c("Mark N."), "Lubell") + ), + publisher = "Oxford University Press", + year = "2017", + chapter = "12", + pages = "301--325" ) + +citHeader("To cite this package, please use the following reference:") +citEntry diff --git a/rDNA/rDNA/man/as.matrix.dna_network_onemode.Rd b/rDNA/rDNA/man/as.matrix.dna_network_onemode.Rd index f447298d..0c5abb89 100644 --- a/rDNA/rDNA/man/as.matrix.dna_network_onemode.Rd +++ b/rDNA/rDNA/man/as.matrix.dna_network_onemode.Rd @@ -20,7 +20,7 @@ Remove the attributes and \code{"dna_network_onemode"} class label from a \code{dna_network_onemode} object and return it as a numeric matrix. } \seealso{ -Other {rDNA networks}: +Other networks: \code{\link{as.matrix.dna_network_twomode}()}, \code{\link{autoplot.dna_network}}, \code{\link{dna_network}()}, @@ -31,4 +31,4 @@ Other {rDNA networks}: \author{ Philip Leifeld } -\concept{{rDNA networks}} +\concept{networks} diff --git a/rDNA/rDNA/man/as.matrix.dna_network_twomode.Rd b/rDNA/rDNA/man/as.matrix.dna_network_twomode.Rd index 1c15deb4..ab5aded5 100644 --- a/rDNA/rDNA/man/as.matrix.dna_network_twomode.Rd +++ b/rDNA/rDNA/man/as.matrix.dna_network_twomode.Rd @@ -20,7 +20,7 @@ Remove the attributes and \code{"dna_network_twomode"} class label from a \code{dna_network_twomode} object and return it as a numeric matrix. } \seealso{ -Other {rDNA networks}: +Other networks: \code{\link{as.matrix.dna_network_onemode}()}, \code{\link{autoplot.dna_network}}, \code{\link{dna_network}()}, @@ -31,4 +31,4 @@ Other {rDNA networks}: \author{ Philip Leifeld } -\concept{{rDNA networks}} +\concept{networks} diff --git a/rDNA/rDNA/man/autoplot.dna_network.Rd b/rDNA/rDNA/man/autoplot.dna_network.Rd index 408bc862..08141092 100644 --- a/rDNA/rDNA/man/autoplot.dna_network.Rd +++ b/rDNA/rDNA/man/autoplot.dna_network.Rd @@ -304,7 +304,7 @@ autoplot(nw, atts = atts, node_colors = "color") + } \seealso{ -Other {rDNA networks}: +Other networks: \code{\link{as.matrix.dna_network_onemode}()}, \code{\link{as.matrix.dna_network_twomode}()}, \code{\link{dna_network}()}, @@ -315,4 +315,4 @@ Other {rDNA networks}: \author{ Tim Henrichsen } -\concept{{rDNA networks}} +\concept{networks} diff --git a/rDNA/rDNA/man/dna_api.Rd b/rDNA/rDNA/man/dna_api.Rd index 26830bf1..b6758a60 100644 --- a/rDNA/rDNA/man/dna_api.Rd +++ b/rDNA/rDNA/man/dna_api.Rd @@ -42,7 +42,7 @@ for (i in seq(variable_references$size()) - 1) { } \seealso{ -Other {rDNA database connections}: +Other database: \code{\link{dna_closeDatabase}()}, \code{\link{dna_openConnectionProfile}()}, \code{\link{dna_openDatabase}()}, @@ -52,4 +52,4 @@ Other {rDNA database connections}: \author{ Philip Leifeld } -\concept{{rDNA database connections}} +\concept{database} diff --git a/rDNA/rDNA/man/dna_closeDatabase.Rd b/rDNA/rDNA/man/dna_closeDatabase.Rd index a9488a7c..f25edae1 100644 --- a/rDNA/rDNA/man/dna_closeDatabase.Rd +++ b/rDNA/rDNA/man/dna_closeDatabase.Rd @@ -25,7 +25,7 @@ dna_closeDatabase() } \seealso{ -Other {rDNA database connections}: +Other database: \code{\link{dna_api}()}, \code{\link{dna_openConnectionProfile}()}, \code{\link{dna_openDatabase}()}, @@ -35,4 +35,4 @@ Other {rDNA database connections}: \author{ Philip Leifeld } -\concept{{rDNA database connections}} +\concept{database} diff --git a/rDNA/rDNA/man/dna_getAttributes.Rd b/rDNA/rDNA/man/dna_getAttributes.Rd index e572b781..fb2dc6e2 100644 --- a/rDNA/rDNA/man/dna_getAttributes.Rd +++ b/rDNA/rDNA/man/dna_getAttributes.Rd @@ -60,4 +60,4 @@ dna_getAttributes(statementType = "DNA Statement", variable = "concept") \author{ Philip Leifeld } -\concept{{rDNA attributes}} +\concept{attributes} diff --git a/rDNA/rDNA/man/dna_getHeadlessDna.Rd b/rDNA/rDNA/man/dna_getHeadlessDna.Rd index dce52f07..6548d7fd 100644 --- a/rDNA/rDNA/man/dna_getHeadlessDna.Rd +++ b/rDNA/rDNA/man/dna_getHeadlessDna.Rd @@ -27,7 +27,7 @@ auto-complete function access after typing the "$" if the headless reference has been saved to an object in the workspace. } \seealso{ -Other {rDNA package startup}: +Other startup: \code{\link{dna_init}()}, \code{\link{dna_jar}()}, \code{\link{dna_sample}()} @@ -35,4 +35,4 @@ Other {rDNA package startup}: \author{ Philip Leifeld } -\concept{{rDNA package startup}} +\concept{startup} diff --git a/rDNA/rDNA/man/dna_init.Rd b/rDNA/rDNA/man/dna_init.Rd index c72d8c6f..0023fc3c 100644 --- a/rDNA/rDNA/man/dna_init.Rd +++ b/rDNA/rDNA/man/dna_init.Rd @@ -35,7 +35,7 @@ dna_init() } \seealso{ -Other {rDNA package startup}: +Other startup: \code{\link{dna_getHeadlessDna}()}, \code{\link{dna_jar}()}, \code{\link{dna_sample}()} @@ -43,4 +43,4 @@ Other {rDNA package startup}: \author{ Philip Leifeld } -\concept{{rDNA package startup}} +\concept{startup} diff --git a/rDNA/rDNA/man/dna_jar.Rd b/rDNA/rDNA/man/dna_jar.Rd index 82e4af72..cfd8f3d5 100644 --- a/rDNA/rDNA/man/dna_jar.Rd +++ b/rDNA/rDNA/man/dna_jar.Rd @@ -17,22 +17,22 @@ Identify and/or download and install the correct DNA jar file. rDNA requires the installation of a DNA jar file to run properly. While it is possible to store the jar file in the respective working directory, it is preferable to install it in the rDNA library installation directory under -\code{inst/java/}. The \code{dna_jar} function attempts to find the version -of the jar file that matches the installed \pkg{rDNA} version in the -\code{inst/java/} sub-directory of the package library path and return the -jar file name including its full path. If this fails, it will try to find the -jar file in the current working directory and return its file name. If this -fails as well, it will attempt to download the matching jar file from GitHub -and store it in the library path and return its file name. If this fails, it -will attempt to store the downloaded jar file in the working directory and -return its file name. If this fails as well, it will clone the current DNA -master code from GitHub to a local temporary directory, build the jar file -from source, and attempt to store the built jar file in the library path or, -if this fails, in the working directory and return the file name of the jar +\code{java/}. The \code{dna_jar} function attempts to find the version of the +jar file that matches the installed \pkg{rDNA} version in the \code{java/} +sub-directory of the package library path and return the jar file name +including its full path. If this fails, it will try to find the jar file in +the current working directory and return its file name. If this fails as +well, it will attempt to download the matching jar file from GitHub and store +it in the library path and return its file name. If this fails, it will +attempt to store the downloaded jar file in the working directory and return +its file name. If this fails as well, it will clone the current DNA master +code from GitHub to a local temporary directory, build the jar file from +source, and attempt to store the built jar file in the library path or, if +this fails, in the working directory and return the file name of the jar file. If all of this fails, an error message is thrown. } \seealso{ -Other {rDNA package startup}: +Other startup: \code{\link{dna_getHeadlessDna}()}, \code{\link{dna_init}()}, \code{\link{dna_sample}()} @@ -40,4 +40,4 @@ Other {rDNA package startup}: \author{ Philip Leifeld } -\concept{{rDNA package startup}} +\concept{startup} diff --git a/rDNA/rDNA/man/dna_network.Rd b/rDNA/rDNA/man/dna_network.Rd index 81f3c20b..e44579fd 100644 --- a/rDNA/rDNA/man/dna_network.Rd +++ b/rDNA/rDNA/man/dna_network.Rd @@ -287,7 +287,7 @@ nw <- dna_network(networkType = "onemode", } \seealso{ -Other {rDNA networks}: +Other networks: \code{\link{as.matrix.dna_network_onemode}()}, \code{\link{as.matrix.dna_network_twomode}()}, \code{\link{autoplot.dna_network}}, @@ -298,4 +298,4 @@ Other {rDNA networks}: \author{ Philip Leifeld } -\concept{{rDNA networks}} +\concept{networks} diff --git a/rDNA/rDNA/man/dna_openConnectionProfile.Rd b/rDNA/rDNA/man/dna_openConnectionProfile.Rd index 8cd02116..0c19276b 100644 --- a/rDNA/rDNA/man/dna_openConnectionProfile.Rd +++ b/rDNA/rDNA/man/dna_openConnectionProfile.Rd @@ -45,7 +45,7 @@ dna_openConnectionProfile(file = "my profile.dnc", coderPassword = "sample") } \seealso{ -Other {rDNA database connections}: +Other database: \code{\link{dna_api}()}, \code{\link{dna_closeDatabase}()}, \code{\link{dna_openDatabase}()}, @@ -55,4 +55,4 @@ Other {rDNA database connections}: \author{ Philip Leifeld } -\concept{{rDNA database connections}} +\concept{database} diff --git a/rDNA/rDNA/man/dna_openDatabase.Rd b/rDNA/rDNA/man/dna_openDatabase.Rd index a235d245..63117103 100644 --- a/rDNA/rDNA/man/dna_openDatabase.Rd +++ b/rDNA/rDNA/man/dna_openDatabase.Rd @@ -69,7 +69,7 @@ dna_openDatabase(coderId = 1, \seealso{ \code{\link{dna_queryCoders}} -Other {rDNA database connections}: +Other database: \code{\link{dna_api}()}, \code{\link{dna_closeDatabase}()}, \code{\link{dna_openConnectionProfile}()}, @@ -79,4 +79,4 @@ Other {rDNA database connections}: \author{ Philip Leifeld } -\concept{{rDNA database connections}} +\concept{database} diff --git a/rDNA/rDNA/man/dna_phaseTransitions.Rd b/rDNA/rDNA/man/dna_phaseTransitions.Rd index e9286dc2..3c8d1561 100644 --- a/rDNA/rDNA/man/dna_phaseTransitions.Rd +++ b/rDNA/rDNA/man/dna_phaseTransitions.Rd @@ -31,8 +31,8 @@ dna_phaseTransitions( timeWindow = "days", windowSize = 200, kernel = "uniform", - normalizeToOne = FALSE, - indentTime = TRUE, + normalizeToOne = TRUE, + indentTime = FALSE, excludeValues = list(), excludeAuthors = character(), excludeSources = character(), diff --git a/rDNA/rDNA/man/dna_printDetails.Rd b/rDNA/rDNA/man/dna_printDetails.Rd index a2021f9e..bcfcb6af 100644 --- a/rDNA/rDNA/man/dna_printDetails.Rd +++ b/rDNA/rDNA/man/dna_printDetails.Rd @@ -26,7 +26,7 @@ dna_printDetails() } \seealso{ -Other {rDNA database connections}: +Other database: \code{\link{dna_api}()}, \code{\link{dna_closeDatabase}()}, \code{\link{dna_openConnectionProfile}()}, @@ -36,4 +36,4 @@ Other {rDNA database connections}: \author{ Philip Leifeld } -\concept{{rDNA database connections}} +\concept{database} diff --git a/rDNA/rDNA/man/dna_sample.Rd b/rDNA/rDNA/man/dna_sample.Rd index 20e3a0e3..ad53f4f2 100644 --- a/rDNA/rDNA/man/dna_sample.Rd +++ b/rDNA/rDNA/man/dna_sample.Rd @@ -26,7 +26,7 @@ dna_openDatabase(s) } \seealso{ -Other {rDNA package startup}: +Other startup: \code{\link{dna_getHeadlessDna}()}, \code{\link{dna_init}()}, \code{\link{dna_jar}()} @@ -34,4 +34,4 @@ Other {rDNA package startup}: \author{ Johannes B. Gruber, Philip Leifeld } -\concept{{rDNA package startup}} +\concept{startup} diff --git a/rDNA/rDNA/man/dna_saveConnectionProfile.Rd b/rDNA/rDNA/man/dna_saveConnectionProfile.Rd index 88b0aec7..5a98eb40 100644 --- a/rDNA/rDNA/man/dna_saveConnectionProfile.Rd +++ b/rDNA/rDNA/man/dna_saveConnectionProfile.Rd @@ -43,7 +43,7 @@ dna_saveConnectionProfile(file = "my profile.dnc", coderPassword = "sample") } \seealso{ -Other {rDNA database connections}: +Other database: \code{\link{dna_api}()}, \code{\link{dna_closeDatabase}()}, \code{\link{dna_openConnectionProfile}()}, @@ -53,4 +53,4 @@ Other {rDNA database connections}: \author{ Philip Leifeld } -\concept{{rDNA database connections}} +\concept{database} diff --git a/rDNA/rDNA/man/dna_tidygraph.Rd b/rDNA/rDNA/man/dna_tidygraph.Rd index e695a2ac..1b67677a 100644 --- a/rDNA/rDNA/man/dna_tidygraph.Rd +++ b/rDNA/rDNA/man/dna_tidygraph.Rd @@ -136,7 +136,7 @@ intergraph::asNetwork(g) } \seealso{ -Other {rDNA networks}: +Other networks: \code{\link{as.matrix.dna_network_onemode}()}, \code{\link{as.matrix.dna_network_twomode}()}, \code{\link{autoplot.dna_network}}, @@ -147,4 +147,4 @@ Other {rDNA networks}: \author{ Philip Leifeld } -\concept{{rDNA networks}} +\concept{networks} diff --git a/rDNA/rDNA/man/print.dna_network_onemode.Rd b/rDNA/rDNA/man/print.dna_network_onemode.Rd index 609f353e..b243ff63 100644 --- a/rDNA/rDNA/man/print.dna_network_onemode.Rd +++ b/rDNA/rDNA/man/print.dna_network_onemode.Rd @@ -28,7 +28,7 @@ Show details of a \code{dna_network_onemode} object. Print a one-mode network matrix and its attributes. } \seealso{ -Other {rDNA networks}: +Other networks: \code{\link{as.matrix.dna_network_onemode}()}, \code{\link{as.matrix.dna_network_twomode}()}, \code{\link{autoplot.dna_network}}, @@ -39,4 +39,4 @@ Other {rDNA networks}: \author{ Philip Leifeld } -\concept{{rDNA networks}} +\concept{networks} diff --git a/rDNA/rDNA/man/print.dna_network_twomode.Rd b/rDNA/rDNA/man/print.dna_network_twomode.Rd index b611cb67..6ddbdb57 100644 --- a/rDNA/rDNA/man/print.dna_network_twomode.Rd +++ b/rDNA/rDNA/man/print.dna_network_twomode.Rd @@ -28,7 +28,7 @@ Show details of a \code{dna_network_twomode} object. Print a two-mode network matrix and its attributes. } \seealso{ -Other {rDNA networks}: +Other networks: \code{\link{as.matrix.dna_network_onemode}()}, \code{\link{as.matrix.dna_network_twomode}()}, \code{\link{autoplot.dna_network}}, @@ -39,4 +39,4 @@ Other {rDNA networks}: \author{ Philip Leifeld } -\concept{{rDNA networks}} +\concept{networks} diff --git a/rDNA/rDNA/tests/testthat/test-clustering.R b/rDNA/rDNA/tests/testthat/test-clustering.R index ad1578f2..894af7eb 100644 --- a/rDNA/rDNA/tests/testthat/test-clustering.R +++ b/rDNA/rDNA/tests/testthat/test-clustering.R @@ -8,7 +8,7 @@ test_that("Example 1 produces expected output", { skip_if_not_installed("sna", minimum_version = "2.4") skip_if_not_installed("cluster", minimum_version = "1.12.0") samp <- dna_sample() - dna_init(samp) + dna_init() dna_openDatabase(samp, coderId = 1, coderPassword = "sample") mc1 <- dna_multiclust(variable1 = "organization", variable2 = "concept", @@ -17,7 +17,7 @@ test_that("Example 1 produces expected output", { k = 0, saveObjects = TRUE) expect_s3_class(mc1, "dna_multiclust") - expect_named(mc1, c("modularity", "max_mod", "memberships", "cl")) + expect_equal(names(mc1), c("cl", "k", "max_mod", "memberships", "modularity")) expect_true(length(mc1$modularity) > 0) expect_true(length(mc1$max_mod) > 0) expect_true(length(mc1$memberships) > 0) @@ -32,7 +32,7 @@ test_that("Example 2 produces expected output", { testthat::skip_on_ci() skip_if_not_installed("igraph", minimum_version = "0.8.1") samp <- dna_sample() - dna_init(samp) + dna_init() dna_openDatabase(samp, coderId = 1, coderPassword = "sample") set.seed(12345) mc2 <- dna_multiclust(k = 2, @@ -54,7 +54,7 @@ test_that("Example 2 produces expected output", { label_prop = FALSE, spinglass = FALSE) expect_s3_class(mc2, "dna_multiclust") - expect_named(mc2, c("modularity", "memberships")) + expect_equal(names(mc2), c("k", "max_mod", "memberships", "modularity")) expect_true(length(mc2$modularity) > 0) expect_true(length(mc2$memberships) > 0) dna_closeDatabase() @@ -69,13 +69,13 @@ test_that("Example 3 produces expected output", { skip_if_not_installed("sna", minimum_version = "2.4") skip_if_not_installed("cluster", minimum_version = "1.12.0") samp <- dna_sample() - dna_init(samp) + dna_init() dna_openDatabase(samp, coderId = 1, coderPassword = "sample") mc3 <- dna_multiclust(k = 2, timeWindow = "events", windowSize = 28) expect_s3_class(mc3, "dna_multiclust") - expect_named(mc3, c("max_mod")) + expect_equal(names(mc3), c("k", "max_mod", "memberships", "modularity")) expect_true(length(mc3$max_mod) > 0) dna_closeDatabase() unlink(samp) diff --git a/rDNA/rDNA/tests/testthat/test-phasetransitions.R b/rDNA/rDNA/tests/testthat/test-phasetransitions.R index 866ef9e9..24eea179 100644 --- a/rDNA/rDNA/tests/testthat/test-phasetransitions.R +++ b/rDNA/rDNA/tests/testthat/test-phasetransitions.R @@ -3,7 +3,7 @@ context("Testing phase transitions") # Create a function to set up the database for tests setup_dna_database <- function() { dna_init() - samp <- dna_sample() + samp <- dna_sample(overwrite = TRUE) dna_openDatabase(samp, coderId = 1, coderPassword = "sample") return(samp) } @@ -14,31 +14,38 @@ cleanup_dna_database <- function(samp) { unlink(samp) } -test_that("dna_phaseTransitions produces expected output with default settings", { +test_that("dna_phaseTransitions produces expected output with help file example", { testthat::skip_on_cran() testthat::skip_on_ci() samp <- setup_dna_database() - result <- dna_phaseTransitions() - - expect_type(result, "dna_phaseTransitions") - expect_true(!is.null(result$states)) - expect_true(!is.null(result$modularity)) - expect_true(!is.null(result$clusterMethod)) - expect_true(!is.null(result$distmat)) - - cleanup_dna_database(samp) -}) - -test_that("autoplot.dna_phaseTransitions produces expected plots", { - testthat::skip_on_cran() - testthat::skip_on_ci() - samp <- setup_dna_database() - phase_trans_obj <- dna_phaseTransitions() - - plots <- autoplot.dna_phaseTransitions(phase_trans_obj) + results <- dna_phaseTransitions(distanceMethod = "spectral", + clusterMethods = c("ward", + "pam", + "concor", + "walktrap"), + k.min = 2, + k.max = 6, + networkType = "onemode", + variable1 = "organization", + variable2 = "concept", + timeWindow = "days", + windowSize = 15, + kernel = "gaussian", + indentTime = FALSE, + normalizeToOne = FALSE) + expect_true("dna_phaseTransitions" %in% class(results)) + expect_true(!is.null(results$states)) + expect_true(!is.null(results$modularity)) + expect_true(!is.null(results$clusterMethod)) + expect_true(!is.null(results$distmat)) + + plots <- autoplot(results) expect_type(plots, "list") expect_length(plots, 4) - expect_type(plots[[1]], "ggplot") + expect_true("egg" %in% class(plots[[1]])) + expect_true("ggplot" %in% class(plots[[2]])) + expect_true("ggplot" %in% class(plots[[3]])) + expect_true("ggplot" %in% class(plots[[4]])) cleanup_dna_database(samp) }) diff --git a/rDNA/rDNA/tests/testthat/test-scaling.R b/rDNA/rDNA/tests/testthat/test-scaling.R index 8ee50e03..2d60d8c7 100644 --- a/rDNA/rDNA/tests/testthat/test-scaling.R +++ b/rDNA/rDNA/tests/testthat/test-scaling.R @@ -3,7 +3,7 @@ context("Testing IRT scaling") # Create a function to set up the database for tests setup_dna_database <- function() { dna_init() - samp <- dna_sample() + samp <- dna_sample(overwrite = TRUE) dna_openDatabase(samp, coderId = 1, coderPassword = "sample") return(samp) } @@ -51,7 +51,7 @@ test_that("dna_scale1dbin produces expected output with help file example", { expect_equal(dim(fit_1d_bin$ability), c(7, 9)) expect_equal(dim(fit_1d_bin$discrimination), c(5, 8)) expect_equal(dim(fit_1d_bin$difficulty), c(5, 8)) - expect_length(utils::capture.output(fit_1d_bin), 27) + expect_true(length(utils::capture.output(fit_1d_bin)) > 1) plot_1d_bin <- autoplot(fit_1d_bin) expect_length(plot_1d_bin, 9) classes <- unique(sapply(plot_1d_bin, class)[2, ]) @@ -93,7 +93,7 @@ test_that("dna_scale2dbin produces expected output with help file example", { expect_equal(names(fit_2d_bin), c("sample", "ability", "call")) expect_equal(dim(fit_2d_bin$sample), c(2000, 14)) expect_equal(dim(fit_2d_bin$ability), c(7, 12)) - expect_length(utils::capture.output(fit_2d_bin), 11) + expect_true(length(utils::capture.output(fit_2d_bin)) > 1) plot_2d_bin <- autoplot(fit_2d_bin) expect_length(plot_2d_bin, 3) classes <- unique(sapply(plot_2d_bin, class)[2, ]) @@ -135,7 +135,7 @@ test_that("dna_scale1dord produces expected output with help file example", { expect_equal(names(fit_1d_ord), c("sample", "ability", "call")) expect_equal(dim(fit_1d_ord$sample), c(2000, 7)) expect_equal(dim(fit_1d_ord$ability), c(7, 9)) - expect_length(utils::capture.output(fit_1d_ord), 11) + expect_true(length(utils::capture.output(fit_1d_ord)) > 1) plot_1d_ord <- autoplot(fit_1d_ord) expect_length(plot_1d_ord, 3) classes <- unique(sapply(plot_1d_ord, class)[2, ]) @@ -181,7 +181,7 @@ test_that("dna_scale2dord produces expected output with help file example", { expect_equal(dim(fit_2d_ord$ability), c(7, 12)) expect_equal(dim(fit_2d_ord$discrimination), c(5, 11)) expect_equal(dim(fit_2d_ord$difficulty), c(5, 8)) - expect_length(utils::capture.output(fit_2d_ord), 27) + expect_true(length(utils::capture.output(fit_2d_ord)) > 1) plot_2d_ord <- autoplot(fit_2d_ord) expect_length(plot_2d_ord, 9) classes <- unique(sapply(plot_2d_ord, class)[2, ]) diff --git a/rDNA/rDNA/tests/testthat/test-zzz.R b/rDNA/rDNA/tests/testthat/test-zzz.R index 68f66f72..0094cefc 100644 --- a/rDNA/rDNA/tests/testthat/test-zzz.R +++ b/rDNA/rDNA/tests/testthat/test-zzz.R @@ -4,5 +4,5 @@ teardown({ unlink("sample.dna") unlink("profile.dnc") unlink("test.dna") - unlink("inst/java/*.jar") + unlink("java/*.jar") }) \ No newline at end of file