Where to find the schema (.xsd file) for Microsoft docx format [closed] - docx

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
Consider a user that needs a text of docx document without the headers and footers for processing in R.
If a file.docx is renamed as file.zip and the document document.xml is analyzed - it is a well formed XML document with the text.
Did Microsfot (or other developer) publish a schema for this document.xml subfile in the ZIP package of docx file?
The file looks like this:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
- <w:document xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape" mc:Ignorable="w14 wp14">
- <w:body>
- <w:p w:rsidR="00F447D7" w:rsidRPr="00C63308" w:rsidRDefault="00F447D7">
- <w:pPr>

From wikipedia:
The format was initially standardised by Ecma (as ECMA-376) and, in
later versions, by ISO and IEC (as ISO/IEC 29500).
You can find various versions of the XSD in the ECMA-376 downloads
document.xml conforms to the WordprocessingML part of the schemas (look for wml.xsd).

I think this might be the location: http://msdn.microsoft.com/en-us/library/hh643329(v=office.12).aspx
This is version 5.2. On this page you can find a link to version 5.1.

Related

Reading arrays from binary file: "read end of file" error [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 1 year ago.
Improve this question
I am reading/writing an array to file in Julia. For example:
test_arr=zeros(3,3)
io = open("logs/test","w")
write(io,test_arr)
close(io)
To read the file I do:
load_arr=Array{Float64}(undef,3,3)
io = open("logs/test","w")
read!(io,load_arr)
close(io)
This gives a "read end of file" error.
I am a bit perplexed as this is how I have been writing/reading other arrays to/from binary files without issue. But this time I get an error.
When opening the IOStream again, I think we want a read instead of another write:
io = open("logs/test","r")
For completeness from the comments above, opening a file with just w will truncate the file, so attempting to read from it will lead to an EOF error. More examples of what different modes do can be found here: https://docs.julialang.org/en/v1/base/io-network/#Base.open

RStudio: Section numbers not knitting but will via command line [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 2 years ago.
Improve this question
have a RMarkdown document that I can convert at the command line with Pandoc and the --number-sections switch. The section numbers render 100% in the converted HTML.
However, I want to knit in the R chunks.
When I try and do a Knit to HTML in RStudio on the same file with the YAML header:
the sections numbers are not rendered. What am I doing wrong with the YAML?
Selecting the Knit with parameters option also says there are no parameters, should it not read the YAML header and see them?
Should be an underscore, i.e. number_sections: TRUE. (;
See https://bookdown.org/yihui/rmarkdown/html-document.html

How to get the basic example Shiny app working? [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
I can't make the first example of the first Shiny Tutorial to work.... on windows 10, R 3.6.1
I followed : https://shiny.rstudio.com/tutorial/written-tutorial/lesson1/
I get some part of the app : title / input field... no CSS, not working... only the title as shown below : :-(
The issue was coming from one special caracter in my username !
My usernmae "stéphane" was transformed by R into "stiphane"... was led to a wrong path name for the shiny files...
Creating another Windows user without any accentuated caracter wolved the problem...

Text editor support for rmarkdown documents [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I was a bit surprised that this question hasn't been asked before. (If it has, apologies!) I am trying to find a good text editor with support for rmarkdown documents. Here are my criteria (in no particular order):
syntax highlighting (for both R code and markdown syntax)
ability to send code from document to console for evaluation
free & open source
autocompletion for bibtex entries
cross-platform
I can't seem to find anything that fits the bill. Sublime Text can do all of this, but it's neither free nor open source...
I know a lot of people use RStudio, but its support for actually writing is not very good at all (e.g. bad spellcheck, no support for navigating a file, etc)...
The answer to any question involving editors is of course ... Emacs. In all seriousness:
ESS for R
Polymode (by one of the ESS authors) for mixed mode
markdown mode by Jason Blevins (which is IIRC bundled with recent Emacs versions)
work well for me. I still go back to latex for 'real' papers with bibtex, but folks do this with markdown too so there will surely be a mode. And yes, it is cross-platform.
I use these on Ubuntu, and maintain the ESS package for Debian. So that one is always current. For polymode I just go to Github. It all works of course with MELPA and Emacs package archives.
Atom is free, extensible, and open source.
The only thing I can't get it to do is R code syntax inside a code chunk of an Rmd file (similar to Sublime).
If you have experience with Vim, you should check out Vim-R. I use it exclusively; it sends code to R, and has loads of other awesome features. In terms of syntax highlighting, I don't know if there is any specifically for rmarkdown, but there are vim plugins for markdown, and the syntax highlighting for R files is quite good with Vim-R.
I actually never use markdown in any form, but create .Rnw files and use knitr to create PDF's (via pdflatex). Vim-R will also send relevant knitr commands; e.g., if you want to knit pdf, you type (in vim) \kp. If you want to run it through biblatex, you type \kb.
EDIT: I'm not sure if there is autocompletion for bibtex entries, though. There probably is in vim-latex, but of course that isn't R related. However, you might be able to install both plugins and incorporate that command for your own uses.

User defined function to R library function like avg() [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I created a user defined function in R for checking whether a given number is prime or not. How can I make that user defined function as library function like avg or sd?
library(numbers)
isPrime(561)
# [1] FALSE
You will have to change the startup script. Use this site for more information. Customizing R:startup.
There is an Rprofile file that then refers to a .First() function. That user added functions to the .First function. I looked for it on my system and found an Rprofile file in the R folder, but did not find the latter.
I started going through the system files to do it myself. But not knowing exactly what I'm doing can cause more damage in the long run. Screwing something there may require reinstallation of the program.
Perhaps someone knows an easier way. Try it and report back, but I wouldn't recommend messing with system files unless you are very careful and the functions are absolutely necessary to your working environment startup. gl
Update
I found the Rprofile.site file in the R/etc directory. I added a .First() function. On opening RStudio in the next session, the packages I added loaded, but the function I put in it did not.
Update 2
I got it to work. I added this .First function to the Rprofile.site file in the etc folder.
.First <- function(){
library(dplyr)
library(stringr)
source('path/myfinctions.R')
}
And it loaded the packages and the functions that I have in the 'myfunctions.R' file. Thanks for asking this question as I have a place to save the functions that I want to define and load into R automatically. : )

Resources