similar to: sweave/help

Displaying 20 results from an estimated 2000 matches similar to: "sweave/help"

2005 Oct 11
2
Sweave and Rnews
Hello list, I am writing a paper for Rnews. I use Sweave to do it. I did not find information about writing a paper for Rnews using Sweave and have some questions: - Is there a problem to use the environment 'Sinput' in the place of 'example' or 'smallexample'. It works fine but perhaps there are some technical/editorial problems ? - I have some long lines of code in
2005 Nov 11
1
A 'sweave' strange problem !!!
Hello list, I have found a problem (bug?) with Sweave. I hope that someone could help me. Try this little example : \documentclass[a4paper]{article} \title{toto} \author{toto} \begin{document} \maketitle <<ni1, fig=T, eval=TRUE, echo=TRUE, debug=TRUE, results=verbatim, include =FALSE, width=7, height=7>>= a<-rnorm(1)+1 a plot(1:10) @ patati <<ni2, fig=F, eval=TRUE,
2003 Nov 04
2
real eigenvectors
Hello list, Sorry, these questions are not directly linked to R. If I consider an indefinte real matrix, I would like to know if the symmetry of the matrix is sufficient to say that their eigenvectors are real ? And what is the conditions to ensure that eigenvectors are real in the case of an asymmetric matrix (if some conditions exist)? Thanks in Advance, St?phane DRAY
2004 Sep 20
4
Multiple operations on list
Hello, suppose I have a list with matrices: a=list(x1=matrix(rnorm(10),5,2),x2=matrix(rnorm(10),5,2),x3=matrix(rnorm(10),5,2)) I want to compute for all combination of xi and xj (x1,x2 x1,x3 and x2,x3) a value. This value is given for the pair x1,x2 by trace(x1%*%t(x1)%*%x2%*%t(x2)) / trace(x1%*%t(x1))*trace(x2%*%t(x2)) I know that product matrices t(xi)%*%xi can be obtained by:
2005 Apr 20
1
Negative argument for head() and tail()
Dear R developers, I'm a former APL programmer. In that language, the "take" (up arrow) and "drop" (down arrow) operators were extensively used to, well, take and drop elements of vectors. Functions head() and tail() are equivalents in R for the "take" operator, but nothing seems to mimic the "drop" operator. I think it would be useful. For
2006 Jan 31
2
Announce: Contributed Documentation
[Version fran??aise plus bas] To the R community, A quick word to announce the publication of my document "Introduction ?? la programmation en S". It is available in the French section of the Contributed Documentation page of CRAN. Many of the documents or books currently available on S-Plus and/or R present the software in a statistical analysis context. My document rather focuses
2004 Mar 31
3
scan seems to modify the data
Hello list, I have used scan function to import data into R. I have done some analysis and find strange results. I have found my problem : when importing data with scan, this can slightly modify the data : > write(c(0.251,3.399,-0.481,0.266),"essai.txt") > scan("essai.txt") Read 4 items [1] 0.251 3.399 -0.481 0.266 > print(scan("essai.txt"),17) Read
2004 Jul 06
2
Generate a matrix Q satisfying t(Q)%*%Q=Z and XQ=W
Hello, I have a question that is not directly related to R ... but I try to do it in R ;-) : I would like to generate a matrix Q satisfying (for a given Z, X and W) the two following conditions: t(Q)%*%Q=Z (1) XQ=W (2) where: Q is m rows and r columns X is p rows and m columns D is p rows and r columns C is r rows and r columns with m>p,r e.g: m=6, p=2 r=3
2004 Feb 23
2
orthonormalization with weights
Hello List, I would like to orthonormalize vectors contained in a matrix X taking into account row weights (matrix diagonal D). ie, I want to obtain Z=XA with t(Z)%*%D%*%Z=diag(1) I can do the Gram-Schmidt orthogonalization with subsequent weighted regressions. I know that in the case of uniform weights, qr can do the trick. I wonder if there is a way to do it in the case of non uniform
2004 Jun 29
2
binding rows from different matrices
Hello list, I have 3 matrices with same dimension : > veca=matrix(1:25,5,5) > vecb=matrix(letters[1:25],5,5) > vecc=matrix(LETTERS[1:25],5,5) I would like to obtain a new matrix composed by alternating rows of these different matrices (row 1 of mat 1, row 1 of mat 2, row 1 of mat 3, row 2 of mat 1.....) I have found a solution to do it but it is not very pretty and I wonder if I
2006 Sep 17
2
Building the call of an arbitrary function
Hy all, Is there a direct way to build the complete function call of an arbitrary function? Here's what I want to do. A function will build a function which will itself call a probability density function for some law given in argument to the first function: > f("gamma", 1000) will return, say, function(x, shape, rate, scale = 1/rate) dgamma(x + 1000, shape, rate,
2004 Mar 24
7
binding vectors or matrix using their names
Hello list, I have two vectors x and x2: x=runif(10) x2=runif(10) and one vectors with their names : my.names=c("x","x2") I would like to cbind these two vectors using their names contained in the vector my.names. I can create a string with comma ncomma=paste(my.names,collapse=",") and now, I just need a function to transform this string into a adequate
2004 Oct 22
4
Evaluate a function for various value of parameters
Hello list, I have a problem ... and do not know how to solve it. I would like create a function that estimate the quality of the fit of different functions with different values of parameters. This problem is related to the following one: I would like to create a function "evaluatemyfunction" which evaluate a function f for different values of parameters. For instance, if
2004 Oct 01
1
cumsum over a list or an array
Hello list, my question is related to svd of a matrix: b=matrix(rnorm(50),10,5) mysvd=svd(b) I would like to compute each xi where xi = di* ui %*% t(vi). I do it by : xlist=sapply(1:ncol(b), function(x1,y) y$d[x1]*y$u[,x1]%*%t(y$v[,x1]),y=mysvd,simplify=F) # result is a list xarray=array(sapply(1:ncol(b), function(x1,y) y$d[x1]*y$u[,x1]%*%t(y$v[,x1]),y=mysvd),c(nrow(b),ncol(b),ncol(b))) #
2007 Nov 16
1
Efficient way to compute power of a sparse matrix
Dear all, I would like to compute power of a square non symmetric matrix. This is a part of a simulation study. Matrices are quite large (e.g., 900 by 900), and contains many 0 (more than 99 %). I have try the function mtx.exp of the Biodem package: library(Biodem) m <- matrix(0, 900, 900) i <- sample(1:900, 3000, replace = T) j <- sample(1:900, 3000, replace = T) for(x in 1:3000)
2006 Jul 05
2
Compilation of R packages
Le Mercredi 5 Juillet 2006 09:41, Dirk Eddelbuettel a ?crit?: > Salut Vincent, > > On 4 July 2006 at 23:27, Vincent Goulet wrote: > | I'm currently following your procedure suggested on R-SIG-Debian > | (https://stat.ethz.ch/pipermail/r-sig-debian/2006-June/000095.html) to > | compile and install the latest version of R on Kubuntu. It is my > | understanding that I
2006 Oct 12
2
avoiding a loop?
I have a vector, (not a list) > repeated.measures.FACTOR.names [1] "Insp1" "Insp2" "Insp3" "Insp4" "Insp5" "Insp6" "Insp7" "Insp8" "Insp9" and would like to convert this into a single string "Insp1,Insp2,Insp3,Insp4,Insp5,Insp6,Insp7,Insp8,Insp9" I can do that with a loop, but isn't there
2005 Feb 22
2
estimate the parameter of exponential distribution, etc.
Given a numeric vector of observations, does R have any generic way to estimate the parameters of commonly used distributions (exponential, gamma, etc.) without numerically optimizing the likelihood function? Thanks, David _______________________________________ David R. Bickel http://davidbickel.com Research Scientist Pioneer Hi-Bred International Bioinformatics & Exploratory Research 7250
2005 Oct 25
3
making an inicator variable
Hello, I am almost a total novice, and I am sure there must be an easy (and basic) way to turn a variable of 1's and 2's into a variable of zeros and ones. This is in a data frame, but if I could do it with vectors, that's all I need. Can someone tell me how? Thanks so much, Jen
2005 Sep 20
5
Add function to histogram?
Is there any neat way to add a curve (frequency function or the like) to a histogram or other plots? I haven't found one yet... Robert