Displaying 20 results from an estimated 20000 matches similar to: "Bug in merge() in R-2.0.0 alpha"
2001 Nov 21
2
distances from points to line
Dear all,
I have discovered that there are many things that I used to do in my GIS
which are easily done directly in R, for example calculating interpoint
distances using geoR and pick out points inside a polygon using splancs.
I now wonder, is there a function to create a line object like a
watercourse and then calculate the distances between many points in space
and this line?
I couldn't
2002 Jun 21
1
naming things in functions
Hello,
I'm working with R version 1.5.0 in Windows. I've written a function
(SummaryMat, segment below) which uses a loop to
repeatedly call another function (PercentsMat, segment below).
PercentsMat creates a matrix and adds rows to it each time it is called.
I use deparse(substitute(...)) to get the names of the lists sent to
PercentsMat to use them as row names in the generated
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
2009 Nov 04
4
unexpected results in comparison (x == y)
Dear readers of the list,
I have a problem a comparison of two data from a vector. The comparison
yields FALSE but should be TRUE. I have checked for mode(), length() and
attributes(). See the following code (R2.10.0):
-----------------------------------------------
# data vector of 66 double data
X =
2013 Feb 26
2
merging or joining 2 dataframes: merge, rbind.fill, etc.?
#I want to "merge" or "join" 2 dataframes (df1 & df2) into a 3rd
(mydf). I want the 3rd dataframe to contain 1 row for each row in df1
& df2, and all the columns in both df1 & df2. The solution should
"work" even if the 2 dataframes are identical, and even if the 2
dataframes do not have the same column names. The rbind.fill function
seems to work. For
2008 May 22
1
tests/ok-errors.R ## bad infinite recursion
I've come across a handful of tests that
fail at our site. I consider this one the
worst because the process does not return.
The patch below simply bypasss the test,
but the errors in the out file are included
as well. I suspect this is due to more or
tighter ulimits on this system.
But I'm not sure if this is result of
different expectations (kernel/userland) of
what should be done in
2009 Sep 06
3
[Hmisc] Latex to pdf
I would like to print some tables and figures to a PDF device on a CentOS 5
vps. However, I cannot seem to get the latex function from Hmisc working. I
followed the example, and got an error: sh: xdvi: command not found. I tried
installing the 'tetex-xdvi' linux package, and now it returns: Error: Can't
open display. I guess the reason for this is that the machine is a VPS
terminal, so
2003 Jun 18
1
suggestion for make.names
I would like to suggest a modification to the make.names() function.
The current implementation has two problems:
1. It doesn't check if a name matches an R keyword (like "function").
2. The uniqueness algorithm is not invariant to concatenation.
In other words,
make.names(c("a","a","a"),unique=T) !=
2003 Jun 18
1
suggestion for make.names
I would like to suggest a modification to the make.names() function.
The current implementation has two problems:
1. It doesn't check if a name matches an R keyword (like "function").
2. The uniqueness algorithm is not invariant to concatenation.
In other words,
make.names(c("a","a","a"),unique=T) !=
2008 Nov 17
1
An array of an array of boxplots in lattice
Using the data set fgl in MASS the following code
layout(matrix(1:9,3,3))
for(i in 1:9){
boxplot(fgl[,i] ~ type, data = fgl,main=dimnames(fgl)[[2]][i])}
produces a 3 by 3 array of plots, each one of which consists of six
boxplots.
Is it possible to do this in lattice?
Steve
"R version 2.7.2 (2008-08-25)" on Ubuntu 6.06
2009 Oct 14
1
using mapply to avoid loops
Hello, I would like to use mapply to avoid using a loop but for some reason, I can't seem to get it to work. I've included copies of my code below. The first set of code uses a loop (and it works fine), and the second set of code attempts to use mapply but I get a "subscript out of bounds" error. Any guidance would be greatly appreciated. Xj, Yj, and Wj are also lists, and s2,
2008 Aug 10
1
help using outer function
Hi,
I would like to use the R's outer function on y below so that I can subtract
elements from each other. The resulting dataframe is symmetric, save for the
negative signs on the other half of the numbers. I would like to get only
half of the dataframe. Here is the code I wrote (it is returning only the
first line of the all elements I want. Please help).
2011 Aug 01
2
Errors, driving me nuts
Greetings all,
I am getting this error that is driving me nuts... (not a long trip, haha)
I have a set of files and in these files I want to calculate ttests on
rows 'compareA' and 'compareB' (these will change over time there I
want a variable here). Also these files are in many different
directories so I want a way filter out the junk... Anyway I don't
believe that this is
2009 Mar 19
1
Overriding Queue Wrapup Time
Is there a way to override the queue wrapup time on the fly?
I would like to allow a longer wrapup time for my agents, but if they
are already done with closing up the call ticket, I would like them to
be able to dial an extension or something to override the wrapup.
Is there a way to do that?
--
Regards,
Robert Broyles
2009 Oct 29
3
Weird error: Error in xj[i] : invalid subscript type 'list'
I got the error. I haven't been able to get a stand along case so that
I can show it here. But could somebody give some clue on what could
cause this error? Since I never defined xj[i], I don't understand
where this error come from.
Error in xj[i] : invalid subscript type 'list'
2008 Jul 01
1
[.data.frame speedup
Below is a version of [.data.frame that is faster
for subscripting rows of large data frames; it avoids calling
duplicated(rows)
if there is no need to check for duplicate row names, when:
i is logical
attr(x, "dup.row.names") is not NULL (S+ compatibility)
i is numeric and negative
i is strictly increasing
"[.data.frame" <-
function (x, i, j,
2011 Mar 22
1
how to convert a data.frame to a list of dist objects for individual differences MDS?
I have a 45 x 16 data frame consisting of dissimilarities among 10
colors, giving in each
column the 45 = 10*9/2 pairwise judgments for one of 16 subjects. The
rownames
identify each pair of colors, e.g, "AC" = ("A","C"), and the pairs are
ordered by columns
in the lower triangle of each distance matrix.
> helm.raw <-
2006 Dec 02
0
fixup for debug package and R2.4.0
A number of users have spotted a terminal problem with the 'debug' package under R2.4.0, along the lines of
> mtrace(x)
> x()
Error in attr(value, "row.names") <- rlabs :
row names must be 'character' or 'integer', not 'double'
This arose from a bug in 'rbind.data.frame' in R2.4.0 itself. The bug is fixed in R2.4.0 patched, so the
2011 Nov 03
2
optimising a loop
Dear R community,
I'm trying to remove a loop from my code but I'm stock and I can't find a good way to do it. Hopefully one of you will have something clever to propose.
Here is a simplified example:
I have a squared matrix:
> nom.plac2 <- c("102", "103", "301", "303","304", "403")
> poids2 <- matrix(NA, 6,6,
2004 May 24
1
as.matrix.data.frame() in R 1.9.0 converts to character when it should (?) convert to numeric
Conversion of a data frame to a matrix using as.matrix() when a
column of the data frame is POSIXt and all other columns are numeric
has changed in R 1.9.0 from R 1.8.1. The new behavior issues a
warning message and converts to a character matrix. In R 1.8.1, such
an object was converted to a numeric matrix.
Here is an example.
#### R 1.9.0 ####
> foo <- data.frame(