Displaying 20 results from an estimated 10000 matches similar to: "Is it possible to open a specific file in the HTML browser like help(htmlhelp=TRUE) does?"
2002 Mar 06
3
Loading tcltk package fails on WinMe/Cygwin but works with Rgui
I am investigating how well R/tcltk is supported on different system and I
ran into the same problem as Christian Schulz reported on February 7, 2002.
I am using [R] v1.4.1 on WinMe and ActiveTcl 8.3.2. Loading tcltk within
Rgui works just fine and both demo(tkdensity) and demo(tkttest) works as
expected. However, when I start R from my Cygwin terminal dyn.load() fails
to load the library:
% R
2002 May 21
4
setClass() and packages
Where should the setClass() ('methods' package) calls be placed in a
package? I try to follow a one-class-one-file principe, but since
setClass("ClassA", "ClassB") has to come a after setClass("ClassB", [snip])
it is not possible to fully follow this rule. So the best I can do now is to
put all setClass() calls in a file named "000.R" (I know this
2001 Sep 24
3
Trailing "/" makes file.exists() return FALSE (PR#1098)
Full_Name: Henrik Bengtsson
Version: 1.3.1
OS: WinMe
Submission from: (NULL) (130.235.2.229)
I found the following bug on WinMe (I call it a bug, since the behavior is
different on WinMe than for instance Sun Solaris):
When calling file.exists() with an existing directory name ending with a "/"
(slash) [R] on WinMe will return FALSE, but when doing the same without the
ending
2002 Jan 06
1
How to get setGeneric() to work?
Dear all, I can't see how setGeneric() works. I know perfectly well how to
define
library(methods);
setClass("Square", representation(side="numeric"));
# Will become the default method.
getArea <- function(object) {
stop(paste("Method getArea() is not defined for this class:",
data.class(object)));
}
setMethod("getArea",
2002 Feb 26
1
abs() on data frames?!
I might be wrong, but didn't the following work before R v1.4.x?
R --vanilla
> df <- data.frame(-10:10)
> abs(df)
Error in abs(df) : non-numeric argument to function
I have tried this on both Rv1.4.1 on WinMe and Rv1.4.0 on Solaris 8. I
regexp searched bugs.r-project.org on "abs" but I found nothing about this.
I can't see why abs(df) shouldn't work when sqrt(df),
2002 Feb 26
1
abs() on data frames?!
I might be wrong, but didn't the following work before R v1.4.x?
R --vanilla
> df <- data.frame(-10:10)
> abs(df)
Error in abs(df) : non-numeric argument to function
I have tried this on both Rv1.4.1 on WinMe and Rv1.4.0 on Solaris 8. I
regexp searched bugs.r-project.org on "abs" but I found nothing about this.
I can't see why abs(df) shouldn't work when sqrt(df),
2002 Jun 27
2
Fastest way to find the last index k such that x[k] < y in a sorted vector x?
Hi, I am trying to find the fastest way to
"find the last index k such that x[k] < y in a *sorted* vector x"
These are my two alternatives:
x <- sort(rnorm(1e4))
y <- 0.2
# Alt 1
k <- max(1, sum(x < y))
# Alt 2 "divide and conquer"
lastIndexLessThan <- function(x, y) {
k0 <- 1; k1 <- length(x)
while ((dk <- (k1 - k0)) >
2002 Jan 24
3
Best way to check/assert a certain version of or a package
When loading a package with library(APkg) or require(APkg) I would like to
make sure that (1) the correct version of [R] is installed. If not an
informative error message should be given. I would also like to make sure
that (2) another required package which is loaded from within the APkg
package (by require(OtherPkg)) is of a certain version or later.
First of all, I believe that the check
2001 Sep 10
3
Offline change detection methods?
Dear [R] people, I am looking for a method to test if there are any
changes (jump points) in a time series data set or not. If there are, I
would like to identify the jump points. All the data is available from the
beginning so an offline method could be used.
The current data set that I have could be seen as a time series with
five almost equally sized segments that stands out to have different
2002 Feb 20
2
How to get the penalized log likelihood from smooth.spline()?
I use smooth.spline(x, y) in package modreg and I would like to get
value of penalized log likelihood and preferable also its two parts. To
make clear what I am asking for (and make sure that I am asking for the
right thing) I clarify my problem trying to use the same notation as in
help(smooth.spline):
I want to find the natural cubic spline f(x) such that
L(f) = \sum_{k=1}{n} w[k](y[k] -
2002 Feb 06
4
Weighted median
Is there a weighted median function out there similar to weighted.mean()
but for medians? If not, I'll try implement or port it myself.
The need for a weighted median came from the following optimization
problem:
x* = arg_x min (a|x| + sum_{k=1}^n |x - b_k|)
where
a : is a *positive* real scalar
x : is a real scalar
n : is an integer
b_k: are negative and positive scalars
2002 Jun 25
1
commandArgs: feature request
Dear R-core Team,
As Thomas Lumley pointed out in one of his e-mails one can use commandArgs()
to get a copy of the command line arguments supplied when R session was
invoked and then use grep to extract parameters of interest.
His solution works very well if the custom options are passed by names, e.g.
--my-option=value, but what if one wants to pass parameters by their
positions. Then it's
2002 Feb 28
2
Failed file("foo", "r") keeps file open? (PR#1333)
Full_Name: Henrik Bengtsson
Version: R v1.4.0
OS: Solaris 8
Submission from: (NULL) (130.235.3.49)
When I am trying the following on Rv1.4.0 on Solaris 8, I get that the
"cannot close output sink connection":
% R --vanilla
tmpfile <- tempfile() # Create a filename that does not exist
for(k in 1:100) {
cat(k, ": ");
try(fh <- file(tmpfile, "r"))
2001 Sep 15
1
Command-line history not working...
I am trying to build [R] v1.3.1 *locally* on a Sun Solaris 8 machine.
One problem I am currently struggeling with is to make the command-line
history function to work. I have installed GNU readline version 4.2
(latest version). Looking at the "config.log" file it seems that all
readline related checks, e.g. "readline/history.h", passes (they did not
before installing GNU
2001 Dec 27
1
Binaries of R-1.4.0 for Windows
A binary distribution of R-1.4.0 to run on Windows 95, 98, NT4.0, 2000
and XP on Intel/clone chips is available at
http://sirio.stat.unipd.it/RWin
It will be mirrored at a CRAN site near you in a couple of days.
See http://sirio.stat.unipd.it/RWin/CHANGES for a list of
Windows-specific changes.
guido masarotto
2001 Dec 27
1
Binaries of R-1.4.0 for Windows
A binary distribution of R-1.4.0 to run on Windows 95, 98, NT4.0, 2000
and XP on Intel/clone chips is available at
http://sirio.stat.unipd.it/RWin
It will be mirrored at a CRAN site near you in a couple of days.
See http://sirio.stat.unipd.it/RWin/CHANGES for a list of
Windows-specific changes.
guido masarotto
2004 Jul 27
2
Incorrect display of b[hat((a))] expression in plots
Hi, I am not sure if this is a bug or a non-implement feature of
text-drawing functions with TeX-style expression, but hat() and some of its
equals does not get the right "bounding boxes" if they are put in sub- or
superscripts. For instance, for the expression 'b[hat(a)]' the hat() seems
to shift 'hat(a)' too much to the right of 'b'. Try the below example and
2002 Jul 08
2
Methods/package for working with sets and intervals
Before reinventing the wheel, is there a package for working on (nice)
sets and intervals, where one can for instance check if a set of intervals
contains a scalar, taking the union and intersection of some intervals
etc?
Example:
# Defining the set i = [1,2) + [3.5, 10]
i <- c(1,2, 3.5, 10)
attr(i, "include") <- c(TRUE, FALSE, TRUE, TRUE)
x <- 0:12
# Get
2004 Oct 15
1
Building package compatible w/ R v1.9.1 and R v2.0.0?
Hi,
just in the process of updating my packages for R v2.0.0 and I have not had
time to followed the R v2.0.0 discussions so maybe my questions have already
been answered.
A concern I have is that when creating packages they should be backward
compatible with R v1.9.x for a while until all users and computers has
migrated to R v2.0.x. It is pretty straightforward to setup my packages so
that
2002 Aug 18
1
Adding argument 'flush' to read.table() too...
What about adding the argument 'flush=FALSE' to read.table() for the option
to ignore trailing elements on each row? This feature already exists in
scan(), which is called internally by read.table():
flush: logical: if `TRUE', `scan' will flush to the end of the line
after reading the last of the fields requested. This allows
putting comments after the last