Displaying 20 results from an estimated 10000 matches similar to: "Enlightenment sought and a possible buglet in vector.Rd"
2005 Jul 24
1
Buglet in src/appl/splines.c (PR#8030)
--AZaLVt6Pw+
Content-Type: text/plain; charset=us-ascii
Content-Description: message body text
Content-Transfer-Encoding: 7bit
Dear all,
I was looking at "splinefun" and the underlying C code and believe
that there is a memory access error in the C routine "spline_eval".
Specifically, on line 368 and following the following code appears:
if(ul < x[i] || x[i+1] < ul)
2011 Aug 03
1
expand.gird with constraints?
Hi, R users,
Here is an example.
k <- c(1,2,3,4,5)
i <- c(0,1,3,2,1)
if k=1, then j=0 from i
if k=2, then j=0, 1 from i
if k=3, then j=0, 1, 2, 3 from i
if k=4, then j=0, 1, 2 from i
if k=5, then j=0, 1 from i
so i'd like to create a list like below.
> list
k j
1 1 0
2 2 0
3 2 1
4 3 0
5 3 1
6 3 2
7 3 3
8 4 0
9 4 1
10 4 2
11 5 0
12 5 1
I tried expand.grid, but I
2005 Nov 16
2
Bug or a feature that I completely missed?
Dear all,
while looking at some R-code submitted by students in a unit that I
teach, I came across constructs that I thought would lead to an error.
Much to my surprise, the code is actually executed.
A boiled down version of the code is the following:
> tt <- function(x, i){
+ mean(x[i,2])/mean(x[i,1])
+ }
> dat <- matrix(rnorm(200), ncol=2)
> mean(dat[,2])/mean(dat[,1])
[1]
2006 Feb 09
1
List Conversion
Hello,
I have a list (mode and class are list) in R that is many elements long and of the form:
>length(list)
[1] 5778
>list[1:4]
$ID1
[1] "num1"
$ID2
[1] "num2" "num3"
$ID3
[1] "num4"
$ID4
[1] NA
I'd like to convert the $ID2 value to be in one element rather than in two.?? It shows up as c(\"num2\", \"num3\") if I try to use
2008 Aug 24
1
Extracting formula from an lm object
I want to extra the part of the formula not including the response
variable from an lm object. For example if the lm object ABx.lm was
created by the call
ABx.lm <- lm( y ~ A + B + x, ...)
Then ACx.lm is saved as part of a workspace.
I wish to extract "~ A + B + x". Later in my code I will fit another
linear model of the form z ~ A + B + x for some other response variable z.
I
2010 Apr 01
2
pdf files in loops
I need to make a bunch of PDF files of histograms. I tried
gatelist = unique(mdf$ArrivalGate)
for( gate in gatelist) {
outfile = paste("../", airport, "/", airport, "taxiHistogram", gate,
".pdf", sep="")
pdf(file = outfile, width = 10, height=8, par(lwd=1))
title=paste("Taxi time for Arrival Gate", gate, "by
2005 Mar 29
1
improved pairs.formula?
Dear all,
I would like to suggest changing the pairs.formula command such that a
command like
pairs(GNP ~ . - Year - GNP.deflator, longley)
would behave in a similar fashion as
lm(GNP ~ . - Year - GNP.deflator, longley)
i.e., make a pairwise scatterplot of GNP and all other variables in
the (longley) dataframe except for Year and GNP.deflator. The above
command, with the
2004 May 21
1
Buglet/omission in nls package (PR#6901)
Dear all,
I noticed the following under R 1.8.1 (when nls was still a separate
package) but the same problem occurs under R 1.9.0 (where most (all?)
of nls is now in the stats package):
> data(Puromycin)
> fm <- nls(rate~SSmicmen(conc,b0,b1), Puromycin, subset = state=="treated")
> coef(summary(fm))
NULL
The problem seems to be that summary.nls uses the name
2009 Mar 25
3
Converting a Matrix to a Vector
Say I have:
> set.seed( 1 )
> m <- matrix( runif(5^2), nrow=5, dimnames = list( c("A","B","C","D","E"),
> c("O","P","Q","R","S") ) )
> m
O P Q R S
A 0.2655087 0.89838968 0.2059746 0.4976992 0.9347052
B 0.3721239 0.94467527 0.1765568
2008 Apr 24
2
problem with "which"
Hi,
I'm having trouble with the "which" or the "seq" function, I'm not sure.
Here's an example :
> lat=seq(1,2,by=0.1)
> lat
[1] 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0
> which(lat==1)
[1] 1
> which(lat==1.1)
[1] 2
> which(lat==1.2)
[1] 3
> which(lat==1.3)
[1] 4
> which(lat==1.4)
[1] 5
> which(lat==1.5)
[1] 6
>
2008 Jul 16
1
NAMESPACE vs internal.Rd
Hi the list,
When we use package.skeleton, it create some file in the man
directorie. - If we use package.skeleton with namespace=FALSE, it
create a file toto-internal.Rd
- If we use package.skeleton with namespace=TRUE, it does not create
the file toto-internal.Rd
Why is that ?
Christophe
2005 Jul 13
2
Kronecker matrix product
Hi
I want to write a little function that takes a matrix X of size
m-by-n, and a list L of length "m", whose elements are matrices all
of which have
the same number of columns but possibly a different number of rows.
I then want to get a sort of dumbed-down kronecker product in which
X[i,j] is replaced by X[i,j]*L[[j]]
where L[[j]] is the j-th of the "m" matrices. For
2005 Dec 02
3
extracting rows of a dataframe
Hi
look at the following session, in which I have a dataframe,
and I want to extract the second row, without the first column.
Everything works as expected until the last line, where I set
the names of x to NULL, and get a non-desired object (I
want c(4,3).).
Three questions:
(1) why is as.vector(a[2,-1]) not a vector?
(2) How come setting names to NULL gives me bad weirdness?
(3) Can I
2006 Feb 18
3
Bug in Sweave? -- scoping problem? (PR#8615)
I have found a strange scoping problem in Sweave. The following Rnw
file doesn't produce the same output in Sweave as it does if I produce
an R file using Stangle and execute that:
\documentclass[12pt]{article}
\begin{document}
<<R>>=
election <- data.frame(A=1:3, B=9:7, C=rep(0,3))
partytotal <- rep(0, ncol(election))
for (i in 1:ncol(election)) {
partytotal[i] <-
2006 Jul 23
3
Making a patch
Dear R developers,
is there a preferred format or strategy for making a patch to
contribute to a package that is maintained by R-core? Berwin Turlach
and I have written a very minor extension to lmeControl to allow it to
pass an argument to nlminb for the maximum number of evaluations of
the objective function. I've edited the nlme/R/lme.R and
nlme/man/lmeControl.Rd files. I can diff the
2003 Oct 06
4
Apply and its friends
Hi,
Forgive a very basic question...
I need to take two lists-of-lists, and apply a function to each pair of elements in the lists to return a single list...
For example
l1 <- list(1:5,6:10,2:15)
l2 <- list(1:8,4:12,1:19,4:20)
I could easily do an lapply across each of them, but is there a function that does a sort-of pairwise-apply across both together?
Does anybody know of a good
2020 Feb 08
4
Development version of R fails tests and is not installed
G'day all,
I have daily scripts running to install the patched version of the
current R version and the development version of R on my linux box
(Ubuntu 18.04.4 LTS).
The last development version that was successfully compiled and
installed was "R Under development (unstable) (2020-01-25 r77715)" on
27 January. Since then the script always fails as a regression test
seems to fail.
2003 Jun 13
1
lars - lasso problem
hello
I tried to use lars() but neither with my own data nor with the sample data it
works. I get in both cases the following error prompt:
> data(diabetes)
> par(mfrow=c(2,2))
> attach(diabetes)
> x<-lars(x,y)
Error in one %*% x : requires numeric matrix/vector arguments
> x<-lars(x,y, type="lasso")
Error in one %*% x : requires numeric matrix/vector arguments
2003 Aug 21
1
R is mentioned on Linux Today
Hi all,
people who don't follow Linux Today regularly may want to check out:
http://linuxtoday.com/developer/2003082000626OSSVDV
My apologies if this is considered spam.
Cheers,
Berwin
========================== Full address ============================
Berwin A Turlach Tel.: +61 (8) 9380 3338 (secr)
School of Mathematics and Statistics +61
2016 Jan 12
3
Small inaccuracy in the Writing R Extensions manual
G'day all,
In Chapter 1.4 (Writing package vignettes) the Writing R Extensions
manual states:
By default @code{R CMD build} will run @code{Sweave} on all
Sweave vignette source files in @file{vignettes}. If
@file{Makefile} is found in the vignette source directory, then
@code{R CMD build} will try to run @command{make} after the
@code{Sweave} runs, otherwise @code{texi2pdf} is run on