Displaying 20 results from an estimated 300 matches similar to: "Generating list of vector coordinates"
2002 Nov 22
2
Need help with pipe()
Hello.
I have an R program that calls gawk (GNU Awk 3.06 for Windows) from
within pipe() to preprocess a large file before it is read into a data
frame with read.table().
I've recently upgraded from Win98SE to WinXP, and have also upgraded
from R1.5.0 to R1.6.1 over the past month or so. This program worked
before the upgrade(s), but now fails. I observe the following sort of
behavior with
2003 Aug 16
2
Prediction Intervals (reposting)
(I'm reposting this message because the original has not appeared after
about 2 days. Sorry if it shows up twice.)
Hello.
First, thanks to those who responded to my recent inquiry about using
contour() over arbitrary (x,y) by mentioning the interp() function in
the akima package. That worked nicely. Now for a new question:
I would like to use a pair of prediction intervals to
2008 Mar 24
1
Cannot allocate large vectors (running out of memory?)
Hi.
As shown in the simplified example below, I'm having trouble allocating
memory for large vectors, even though it would appear that there is more
than enough memory available. That is, even with a memory limit of 1500 MB,
R 2.6.1 (Win) will allocate memory for a first vector of 285 MB, but not for
a second vector of the same size. Forcing garbage collection does not seem
2002 Jul 21
3
Date arithmetic fails (PR#1819)
Full_Name: Ronnen Levinson
Version: 1.5.1
OS: Mac OS 10.1
Submission from: (NULL) (12.232.201.92)
The value returned by strptime behaves badly after arithmetic operation and/or
combination.
> a=strptime("2002-06-01 12:15:01","%Y-%m-%d %H:%M:%S")
> a
[1] "2002-06-01 12:15:01"
> a+0
[1] "1932-04-25 21:46:45"
> a+3600
[1] "1932-04-25
2003 Aug 13
1
Contour plot for arbitrary (x,y,z)
Hello.
Is there an easy-to-use contour plot function analogous to scatterplot3d
that can draw handle a dataset of arbitrary (x,y,z) triplets? That is,
say x, y, and z are each measured quanties, and exhibit neither order
nor regularity.
I looked at the lattice package function "contourplot" but it seems
complicated, and it's not clear from the documentation whether it can
2005 Mar 26
1
Trouble with expression() in R-win 2.0.1
Hi.
The following statement works fine in R-win 1.8.0, but yields a syntax
error in R-win 2.0.1 (and possibly in other versions after 1.8.0):
plot(c(1,2),main=expression(a==b==c))
I note that the following workaround executes successfully in both
versions of R...
plot(c(1,2),main=expression(a*"="*b*"="*c))
...but I don't really understand
2008 Mar 28
3
Error: cannot allocate vector of size 3.0 Gb
Hello,
I have read recent posts on this topic (Dr. Ronnen Levinson's Monday 02:39:55
pm), but before I install a 64 bit system, and purchase more RAM, I want to
make sure I understand this interesting issue.
I was attempting to plot a data frame containing Dow Jones stock information:
> length(Date)
[1] 19957
> length(Close)
[1] 19957
> head(DowJones)
Date Open High
2005 Apr 19
2
indexing an array using an index-array, but one entry being ', '
Hi
I have the following array:
test <- array(c(1:16), dim = c(3,4,3))
test
## I call some enries using an index array
test.ind <- array(rbind(c(1,2,1), c(3,3,2)), dim = c(2,3))
test[test.ind]
## suppose I want all values in the 2nd row and 4th col over
## all three 3rd dimensions
test[2,4,]
how to specify a test.ind array with the last index left with ',' i.e
test.ind should be
2002 Aug 23
1
Legends and Fonts
Hello.
Is it possible to set specify the font used by legend()? I would like to
specify a fixed-width font so that I can line up parts of vertically
stacked curve labels. For example, it would be nice if I could align the
names, ages, and weights in the following three curve labels:
Bob age=7 weight=100
Alexander age=13 weight=150
Susan age=20 weight=130
Is there perhaps a clever
2006 Sep 08
2
Multiple matrix multiplication with two 3-dimensional arrays
Hi,
I need to do several matrix multiplications with
the corresponding matrices forming two
3-dimentional arrays. To illustrate my problem,
let's say I have the following 3-dimensional arrays:
array1 <- array(1:30,dim=c(3,2,5))
array2 <- array(1:20,dim=c(2,2,5))
I know that I can get what I want with the following computation :
result <- array(dim=c(dim(array1)[1],
2002 Aug 05
3
Formatting POSIXt values in plot axis labels
Hello.
I have an XYY series that I would like to graph with matplot() or some
other single function that will do the trick.
The X in question is a vector of POSIXt values obtained from strptime().
Is it possible to tell matplot() how to handle POSIXt x values?
I have examined the examples at
http://lark.cc.ukans.edu/~pauljohn/R/statsRus.html#5.22 , but would
prefer not have to overlay the
2005 Apr 27
1
Closing RGui help windows
Hi.
I often wind up with many help windows cluttering my RGui screen when
running Windows R 2.0.1. Is there an R instruction to close one or more
help windows, or an RGui command to close all help windows?
Yours truly,
/Ronnen.
/P.S. E-mailed CC:s of posted replies appreciated.
[[alternative HTML version deleted]]
2009 Apr 27
1
Plotting polynomial fit
Hi.
Is there an analog to abline() that can be used to plot a polynomial fit?
For example, I can draw the straight-line fit
fit <- lm(y ~ x)
via
abline(coef=fit$coef)
but I'm not sure how to draw the polynomial fit
fit <- lm(y ~ poly(x,2))
I do see the function curve(), but not how to prepare an expr for
curve() based on the coefficients returned by the polynomial
2002 Jul 21
2
Trouble With Dates; Recommended Reference?
Hi.
I'm having a little difficulty with R1.5.1. To wit:
(1) Can anyone explain the following behavior?
> a=strptime("2002-06-01 12:15:01","%Y-%m-%d %H:%M:%S")
> a
[1] "2002-06-01 12:15:01"
> a+0
[1] "1932-04-25 21:46:45"
> a+3600
[1] "1932-04-25 22:46:45"
(2) Can anyone recommend an introductory R text other than that
2009 Jul 19
1
Can I use "mcnemar.test" for 3*3 tables (or is there a bug in the command?)
Hello all,
I wish to perform a mcnemar test for a 3 by 3 matrix.
By running the slandered R command I am getting a result but I am not sure I
am getting the correct one.
Here is an example code:
(tt <- as.table(t(matrix(c(1,4,1 ,
0,5,5,
3,1,5), ncol = 3))))
mcnemar.test(tt, correct=T)
#And I get:
McNemar's Chi-squared
2005 Oct 21
1
read.fwf(...,header=TRUE,...) (PR#8236)
Full_Name: Giovanni Bonafe'
Version: 2.2.0
OS: Linux
Submission from: (NULL) (195.62.164.225)
If the file "example.dat" is like this:
aaa bbb ccc
3.4 1.2 5.6
4.6 10 32
667 343 1.7
With the older 1.9.1, as expected:
> data<-read.fwf(file = "example.dat",widths=c(3,4,4),header=TRUE)
> data
aaa bbb ccc
1 3.4 1.2 5.6
2 4.6 10.0 32.0
3 667.0 343.0
2012 Apr 01
1
Error in xy.coords(x, NULL, log = log) : (list) object cannot be coerced to type 'double'
Hi there,
When I run the code below I get the error
Error in xy.coords(x, NULL, log = log) :(list) object cannot be coerced to
type 'double'
Any tips how I can resolve this?
>
> library("waveslim")
>
> vols=read.csv(file="C:/Users/ocuk/My Documents/Abs Vol.csv", header=TRUE,
> sep=",")
> x<-c(vols[,1])
> #x
> #data(ibm)
>
2009 Apr 01
2
Matrix multiplication - code problem
Hi listers,
I am having some trouble in a matrix multiplication...
I have already checked some posts, but I didn't find my problem...
I have the following code...
But I am not getting the right multiplication...
I checked the dimension and they are fine...
id_y <- array(1:10,dim=c(2,1,5))
id_yt<-aperm(id_y,c(2,1,3))
m_id<-array(dim=c(dim(id_y)[1],dim(id_y)[1],dim(id_y)[3]))
for (i in
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
2010 Oct 08
2
Count values in a dataframe with respect to groups
Dear all,
I am looking for a function to count values belonging to a class within a dataframe (and ignore NAs).
grp = c(1,1,1, 1,2, 2,2)
val = c(2,1,5,NA,3,NA,1)
dta = data.frame(grp=grp, val=val)
The result should look like:
grp count
1 3
2 2
At the moment, I am trying to find a function for FUN in aggregate, but with no success. Can anybody help me?
Thanks in advance.
Marcus