Rmarkdown Parameterized Reports - Can't access data from selected file - rstudio

I have exactly the same problem as defined in a previous post (How do I access the data from a file passed as parameters in a RMarkdown document?), and I don't find (StackOverflow, google...) any clue to solve it !
With the default filename, it works! With the selected file (which could be the same file), I get an error.
Quitting from lines 51-51 (WBD_MCS.Rmd)
Error in file(file, "rt") : cannot open the connection
Calls: <Anonymous> ... withVisible -> eval -> eval -> read.csv2 -> read.table -> file
In addition: Warning message:
In file(file, "rt") :
cannot open file 'C:\Users\SESA40~1\AppData\Local\Temp\RtmpaMmix8/a6232463beeca55dd111a939/0': No such file or directory
Execution halted
I have the problem on MacOSX and Windows.
R version 3.2.5 (2016-04-14) -- "Very, Very Secure Dishes"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: i386-w64-mingw32/i386 (32-bit)
If someone can share a solution...
The header of my .Rmd file:
---
title: "Simulation de Monte Carlo pour une estimation Wideband Delphi"
author: "Alain BRET"
date: "28 avril 2016"
output:
pdf_document:
includes:
before_body: tex/tex_before_body.tex
in_header: tex/tex_header.tex
number_sections: yes
toc: yes
html_document:
number_sections: yes
toc: yes
word_document:
toc: yes
params:
nombre_occurences:
input: slider
label: "Nombre d'occurences:"
max: 10000
min: 1000
step: 500
value: 1000
datafile:
input: file
label: 'Fichier des estimations des Experts:'
value: data/estimation_data_2.csv
---

This issue has been reported to rstudio/rmarkdown#919 and fixed in the version 1.7 of the rmarkdown package. It should suffice to install.packages('rmarkdown').

Related

How is $id and $ref values are used in device tree yaml binding file? and can I see it?

This has been a question I had for a long time.
I started to read https://docs.kernel.org/devicetree/bindings/writing-schema.html but it's hard to understand.
For example in linux-5.15.68, the file Documentation/devicetree/bindings/pci/snps,dw-pcie.yaml starts like this.
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/pci/snps,dw-pcie.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Synopsys DesignWare PCIe interface
maintainers:
- Jingoo Han <jingoohan1#gmail.com>
- Gustavo Pimentel <gustavo.pimentel#synopsys.com>
description: |
Synopsys DesignWare PCIe host controller
allOf:
- $ref: /schemas/pci/pci-bus.yaml#
properties:
compatible:
anyOf:
- {}
- const: snps,dw-pcie
How is the URI $id and $scmema used? and if I want to browse the file, how can I do it?
When I put http://devicetree.org/schemas/pci/snps,dw-pcie.yaml the browser says 'These are not the schemas you are looking for.'.

must jupyterbook's TOC renumber chapters after each part?

As I understand it, when one specifies parts in the _toc.yml file, then renumbering of chapters happens at each part. Is there any way to disable that feature? I'd like for chapter numbering to continue ordinally, using parts as just a benign separator among the chapters.
What I have is:
# Table of content
# Learn more at https://jupyterbook.org/customize/toc.html
#
format: jb-book
root: intro
options:
numbered: True
chapters:
- file: FOUNDATION
parts:
- caption: Foundations
numbered: True
chapters:
- file: e_and_m/J-140_Maxwell_3_S0
sections:
- file: e_and_m/J-140_Maxwell_3_S1
- file: e_and_m/J-140_Maxwell_3_S2
- file: e_and_m/J-140_Maxwell_3_S3
- file: e_and_m/J-140_Maxwell_3_S9
- file: e_and_m/J-140_Maxwell_3_S11
- caption: Relativity
numbered: True
chapters:
- file: relativity/Special Relativity_1_1_VSC
- file: relativity/Special Relativity_2_1
- file: relativity/Special Relativity_3_1
- file: relativity/Special Relativity_4_1
So, J-140_Maxwell_3_S_0 is chapter 1 and Special Relativity_1_1_VSC is also chapter 1.
OR:
I could accomplish the same thing I guess, if I could include new chapters called Foundations.md and Relativity.md but exclude them from numbering. Can I do that as an alternative?
thanks

How can I fix yaml error: Block mapping value not allowed here

I copied Semaphore's config of GoReleaser and saved it as .semaphore/semaphore.yml but when I run it on Semaphore, I can see:
Unprocessable YAML file.
Error: {{:throw, {:yamerl_exception, [{:yamerl_parsing_error, :error, 'Block mapping value not allowed here', 30, 20, :block_mapping_value_not_allowed, :undefined, []}]}}, "# .semaphore/semaphore.yml.\nversion: v1.0\nname: Build\nagent:\n machine:\n type: e1-standard-2\n os_image: ubuntu1804\n\nblocks:\n - name: \"Test\"\n task:\n prologue:\n commands:\n # set go version\n - sem-version go 1.11\n - \"export GOPATH=~/go\"\n - \"export PATH=/home/semaphore/go/bin:$PATH\"\n - checkout\n\n jobs:\n - name: \"Lint\"\n commands:\n - go get ./...\n - go test ./...\n\n# On Semaphore 2.0 deployment and delivery is managed with promotions,\n# which may be automatic or manual and optionally depend on conditions.\npromotions:\n - name: Release\n pipeline_file: goreleaser.yml\n auto_promote_on:\n - result: passed\n branch:\n - \"^refs/tags/v*\"\n"}
How can I fix it?
In this last part:
promotions:
- name: Release
pipeline_file: goreleaser.yml
auto_promote_on:
- result: passed
branch:
- "^refs/tags/v*"
The indentation of pipeline_file and auto_promote_on is wrong – both need to be at the same level as name.

nativescript paytm plugin giving 404 Not Found Error nginx/1.6.2

I'm trying to integrate #nstudio/nativescript-paytm plugin into my app.
as a part the first step i have written code to generate checksum. now i'm getting checksum. if i passed this to further steps as I'm getting below error.
Error in console
chromium: [INFO:library_loader_hooks.cc(50)] Chromium logging enabled: level = 0, default verbosity = 0
06-22 07:31:56.479 2762 2762 I cr_BrowserStartup: Initializing chromium process, singleProcess=true
chromium: [ERROR:filesystem_posix.cc(89)] stat /data/user/0/org.nativescript.demo/cache/WebView/Crashpad: No such file or directory (2)
chromium: [ERROR:filesystem_posix.cc(62)] mkdir /data/user/0/org.nativescript.demo/cache/WebView/Crashpad: No such file or directory (2)
My order param is
var order = {
MID: "V************3",
ORDER_ID: "order1",
CUST_ID: "cust123",
INDUSTRY_TYPE_ID: "Retail",
CHANNEL_ID: "WEB",
TXN_AMOUNT: "100.12",
WEBSITE: "WEBSTAGING",
CALLBACK_URL: "https://pguat.paytm.com/paytmchecksum/paytmCallback.jsp",
CHECKSUMHASH: "NDspZhvSHbq44K3A9Y4daf9En3l2Ndu9fmOdLG+bIwugQ6682Q3JiNprqmhiWAgGUnNcxta3LT2Vtk3EPwDww8o87A8tyn7/jAS2UAS9m+c="
};
I'm using github sample of that plugin(javascript version i.e demo) i haven't modified the code.

isIncomplete(con) error when knitting pdf

I am able to run the following example script from the SWSamp package fine in the console, but I get an "isIncomplete(con)" error when knitting to PDF. This package requires use of at least 2 cores, and I'm wondering if this connection error is related to trying to run in parallel.
---
title: "Test"
output: pdf_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
```{r}
install.packages("http://www.statistica.it/gianluca/SWSamp/SWSamp_0.3.tar.gz", type="source", dependencies=TRUE, repos=NULL)
library(SWSamp)
```
```{r}
mu1=0.3
b.trt=-0.3875
sigma.e=1.55
J=5
K=20
sig.level=0.05
n.sims=10
rho=0.5
pow.cont <- sim.power(I=14, J=J, H=NULL, K=K, rho=rho, mu=mu1, sigma.e=sigma.e,
b.trt=b.trt, formula=NULL, n.sims=n.sims,
sig.level=sig.level, n.cores=2)
pow.cont$power
```
Quitting from lines 16-28 (test.Rmd) Error in isIncomplete(con) :
invalid connection Calls: ... evaluate_call ->
handle_output -> -> isIncomplete Quitting from lines 16-28
(test.Rmd) Error in isOpen(con) : invalid connection Calls:
... in_dir -> evaluate -> evaluate_call -> ->
isOpen Error in close.connection(con) : invalid connection Calls:
-> -> close -> close.connection Execution
halted
> sessionInfo()
R version 3.3.2 (2016-10-31)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: macOS Sierra 10.12.1
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] SWSamp_0.3 lme4_1.1-12 Matrix_1.2-7.1
loaded via a namespace (and not attached):
[1] Rcpp_0.12.8 knitr_1.15.1 magrittr_1.5 splines_3.3.2 MASS_7.3-45
[6] doParallel_1.0.10 lattice_0.20-34 foreach_1.4.3 minqa_1.2.4 stringr_1.1.0
[11] tools_3.3.2 parallel_3.3.2 grid_3.3.2 nlme_3.1-128 htmltools_0.3.5
[16] iterators_1.0.8 yaml_2.1.14 rprojroot_1.1 digest_0.6.10 nloptr_1.0.4
[21] codetools_0.2-15 evaluate_0.10 rmarkdown_1.3 stringi_1.1.2 compiler_3.3.2
[26] backports_1.0.4
The sim.power() function runs closeAllConnections(), which interferes with knitr according to this SO answer. The solution in this answer was to wrap the expression in quotes and the evaluate() function, but it did not work for me.
As a temporary solution, I redefined the sim.power() function with the closeAllConnections() call commented out. I don't know if this has adverse effects, but seems to run for me. Happy to accept better answers.

Resources