Displaying 20 results from an estimated 2000 matches similar to: "summary: Sweave - documenting a long function"
2002 Nov 04
2
Sweave - documenting a long function
Hi,
I would like to use Sweave to document a long function.
Is it possible to split the function's code into chunks
such that Sweave will accept each chunk without complaining.
I have tried various approaches without sucess
but I feel sure that someone has done this already.
Here is one attempt
==============
% First, define the funciton header
<<defFunHdr, eval=FALSE>>=
x <-
2012 Jan 24
1
Sweave driver extension
Almost all of the coxme package and an increasing amount of the survival
package are now written in noweb, i.e., .Rnw files. It would be nice to
process these using the Sweave function + a special driver, which I can
do using a modified version of Sweave. The primary change is to allow
the following type of construction
<<coxme>>
coxme <- function(formula, data, subset, blah blah
2007 Jun 20
1
Help With Sweave:
Hi All,
I am running Ubuntu Feisty (7.04) on a Thinkpad T41. I've installed
the nowebm package for Ubuntu. Working from this HowTo:
http://www.ci.tuwien.ac.at/~leisch/Sweave/example-1.Snw
I try to compile the example *.Snw as in the Sweave manual:
mdj at lapmdj:~/Desktop/Sweave/example1$ noweb example-1.Snw
Can't open output file
Despite the error, a *.tex file is produced. Now I am
2011 Nov 18
1
couting events by subject with "black out" windows
I large datset that includes subjects(ID), Dates and events that need to be counted. Not every date includes an event, and I need to only count one event per 30days, per subject. So in essence, I need to create a 30-day "black out" period during which time an event cannot be "counted" for each subject. The reason is that a rule has been set up, whereby a subject can only be
2003 Nov 13
1
Can't get Sweave syntax highlighting with Emacs
I can't get Emacs to automatically do syntax highlighting of
Sweave files. I have followed Friedrich's suggestion for code
to insert into my .emacs file. The complete section from my .emacs
file is given below. When I load a *.Snw file, font is white until I press
M-x, then the first code and document chunks get highlighted, but not
the rest of the file. Latex and Noweb menus are
2011 Sep 29
2
String manipulation with regexpr, got to be a better way
Help-Rs,
I'm doing some string manipulation in a file where I converted a string date in mm/dd/yyyy format and returned the date yyyy.
I've used regexpr (hat tip to Gabor G for a very nice earlier post on this function) in steps (I've un-nested the code and provided it and an example of what I did below. My question is: is there a more efficient way to do this. Specifically is
2012 Aug 27
2
simplest way (set of functions) to parse a file
Hello,
What would be the best set of R functions to parse and transform a file?
My file looks as shown below. I would like to plot this data and I need to parse it into a single data frame that sorts of "transposes the data" with the following structure:
> df <- data.frame(n=c(1,1,2,2),iter=c(1,2,1,2),step=as.factor(c('Step 1', 'Step2', 'Step 1',
2003 Apr 23
1
Setting up Xemacs + Sweave
Dear list,
I have tried to setup my Xemacs for use with Sweave, which I indend to learn.
I have followed the instructions in the Sweave FAQ, that is to say, I put
(defun Rnw-mode ()
(require 'ess-noweb)
(noweb-mode)
(if (fboundp 'R-mode)
(setq noweb-default-code-mode 'R-mode)))
(add-to-list 'auto-mode-alist '("\\.Rnw\\'" . Rnw-mode))
(add-to-list
2011 Sep 09
2
NMDS plot and Adonis (PerMANOVA) of community composition with presence absence and relative intensity
Hi!
Thanks for providing great help in R-related statistics. Now, however I'm
stuck. I'm not a statistics person but I was recommended to use R to perform
a nmds plot and PerMANOVA of my dataset.
Sample(treatment) in the columns and species (OTU) in the rows. I have 4
treatments (Ambient Temperature, Ambient temperature+Low pH, High
temperature, High temperature+low pH), and I have 16
2004 Feb 26
2
Sweave and Xemacs on Windows2000?
Hallo!
Trying to configure Xemacs to work with .snw files on windows 2000. Tried to do it how it is described in the FAQ for Sweaves.
When starting xemacs with and Snw file
*ESS* buffer contains hundrets of lines and the few last ones.
(ess-loop-timeout . 500000) (inferior-ess-primary-prompt . ^) (inferior-ess-secondary-prompt . ^) (comint-use-prompt-regexp-instead-of-fields . t)
2004 Jul 05
1
Apparent conflict between \Sexpr in Sweave and R2HTML
I have come across an apparent bug in the operation of Sweave. If I
load the package R2HTML then execution of \Sexpr{} in an *.Rnw file no
longer works. The \Sexpr{} code is simply written to the *.tex file.
Below are my *.Rnw file, commands, and output.
The Sweave file, Sweave-test-1_short.Rnw:
% -*- mode: noweb; noweb-default-code-mode: R-mode; -*-
\documentclass{article}
\title{A Test
2013 Feb 15
1
Suggestion: Custom filename patterns for non-Sweave vignettes
Hi,
as far as I understand it, the new R devel feature of processing
non-Sweave vignettes will (a) locate any "[.][RrSs](nw|tex)$" or
".Rmd" files, (b) check for a registered vignette engine, (c) process
the file using the registered "weave" function, (d) and possibly post
process the generated weave artifact (e.g. a *.tex file).
I'd like to propose to extend
2002 Jul 17
1
editing Sweave files in xemacs with ess (noweb), auctex and reftex
I am having some trouble getting reftex, in particular the bibtex
related features, to work properly in xemacs when editing text in Sweave
files. I have added
(defun Rnw-mode ()
(noweb-mode)
(if (fboundp 'R-mode)
(setq noweb-default-code-mode 'R-mode)))
(add-to-list 'auto-mode-alist '("\\.Rnw\\'" . Rnw-mode))
(add-to-list 'auto-mode-alist
2003 Feb 10
0
calling sweave function from LaTex re directories, formatting
System info:
Mandrake 9.0
R Version 1.6.1
ESS 5.1.21
Emacs 21.2.1
-------------------
Colleagues
I have followed suggestions by David Whiting, Friedrich Leisch and Frank
Harrell, but have a few more queries.
1. On formatting:
I added the suggested sweave customization to my .emacs file
; Sweave customisation
(defun Rnw-mode ()
(require 'ess-noweb)
(noweb-mode)
(if (fboundp
2009 Jun 03
2
Regular expression \ String Extraction help
Dear all,
Is there a good way of doing the following conversion:
[YYYY]-[MM]-[DD] [Time] [Day] [Name][Integer].[Extention]
to become
C:\test\[Name]\[YYYY]-[MM]-[DD] [Time] [Day]\[YYYY]-[MM]-[DD] [Time]
[Day] [Name][Integer].[Extention]
i.e. these
2009-04-10 1400 Fri Foo1.txt
2009-04-10 1400 Fri Universities2.txt
2009-04-10 1400 Fri Hitchhikers Guide To The Galaxy42.txt
will become
2006 Mar 29
1
Help: Input of form 1 to hidden field in form 2?
Hi all I''m new to rails an i''m trying to build a step by step form /
process to gather data. For example:
form one:
User enters a 8 digit number
the submit button points to form 2.
form two:
the 8 digit number from form one becomes a hidden field in form 2.
The problem I have is that the entire hash from form 1 is showing up in
form two rather than just the input data.
2009 Jan 19
1
Sweave encoding problem
Hello,
Sweave seems to have trouble processing german letters in R.
For example, my noweb R-input looks like this.
<<>>=
Oberfl?chenfehler = c(4, 11, 6, 2, 7, 9)
@
If I send it through Sweave, I get the following error message.
error: chunk 1
Error in parse(text = chunk) : unexpected input in "Oberfl??"
extra: Warning message:
In readLines(f[1]) :
underfull last line in
2017 Nov 20
0
Reg an issue with smoothing factor in VAD implementation
Hi,
We are looking at the VAD implementation used in opus. We are looking at the code where speech probability is calculated based on which SNR is estimated. Below is the part of the code I am talking about.
/*********************************/
/* Speech Probability Estimation */
/*********************************/
SA_Q15 = silk_sigm_Q15( silk_SMULWB( VAD_SNR_FACTOR_Q16, pSNR_dB_Q7 ) -
2008 Jun 17
3
Sweave: problem with usepackage{C:/PROGRA~1/R/R-27~1.0/share/texmf/Sweave}
R users,
I'm at a loss with a problem considering running .tex files produced
by Sweave. When I run (R 2.7.0):
---------------------------------------------------
#Taken from ?Sweave
testfile <- system.file("Sweave", "Sweave-test-1.Rnw", package = "utils")
## enforce par(ask=FALSE)
options(device.ask.default=FALSE)
## create a LaTeX file
Sweave(testfile)
2007 May 10
1
how to pass "arguments" to a function within a function?
I have searched the r-help files but have not been able to find an answer to this question. I apologize if this questions has been asked previously.
(Please excuse the ludicrousness of this example, as I have simplified my task for the purposes of this help inquiry. Please trust me that something like this will in fact be useful what I am trying to accomplish. I am using R 2.4.1 in Windows XP.)