Displaying 20 results from an estimated 42 matches for "dxc13".
2007 Sep 10
5
finding the minimum positive value of some data
...8 8 9 9 10 10
> diff(sort(x))
[1] 1 0 1 1 0 1 1 0 0 1 1 1 0 1 0 1 0
> min(diff(sort(x)))
[1] 0
The minimum is given as zero, which is clearly true, but I am interested in
only the positive minimum, which is 1. Can I find this by using only 1 line
of code, like I have above? Thanks!
dxc13
--
View this message in context: http://www.nabble.com/finding-the-minimum-positive-value-of-some-data-tf4417250.html#a12599319
Sent from the R help mailing list archive at Nabble.com.
2008 Jul 29
3
finding a faster way to do an iterative computation
...x
[1] 1 2 3 4 5
> xk
[1] 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0
I want to do: abs(x-xk[i]) where i = 1 to length(xk)=13. It should result
in a 13 by 5 matrix or data frame. Does anyone have a "quicker" solution
than FOR loops or apply()?
Much appreciation and thanks,
dxc13
--
View this message in context: http://www.nabble.com/finding-a-faster-way-to-do-an-iterative-computation-tp18718233p18718233.html
Sent from the R help mailing list archive at Nabble.com.
2008 Jul 24
2
simple random number generation
useR's,
I want to randomly generate 500 numbers from the standard normal
distribution, i.e. N(0,1), but I only want them to be generated in the range
-1.5 to 1.5. Does anyone have a simple way to do this?
Thanks,
dxc13
--
View this message in context: http://www.nabble.com/simple-random-number-generation-tp18642611p18642611.html
Sent from the R help mailing list archive at Nabble.com.
2008 Jan 16
3
color ranges on a 2D plot
useR's
I am trying to color the points on a scatter plot (code below) with two
colors. Red for values 0.5 -1.0 and blue for 0.0 - .49. Does anyone know a
easy way to do this?
x <- runif(100, 0, 1)
y <- runif(100, 0, 1)
plot(y ~ x, pch=16)
Thanks,
dxc13
--
View this message in context: http://www.nabble.com/color-ranges-on-a-2D-plot-tp14893457p14893457.html
Sent from the R help mailing list archive at Nabble.com.
2009 May 24
2
Deleting columns from a matrix
...I know
I can use "mat[,-1]" to delete the first column, but I have a much larger
matrix where it is impossible to tell how many columns contain all missing
values and which don't.
Is there a function or something else that may be able to help me accomplish
this?
Thanks in advance.
dxc13
--
View this message in context: http://www.nabble.com/Deleting-columns-from-a-matrix-tp23695656p23695656.html
Sent from the R help mailing list archive at Nabble.com.
2009 May 04
2
A variation on the bar plot
...would be the corresponding values
for 2005. Even though values would be on the left side of the zero line, it
doesn't mean they are negative, I just want to compare changes in time.
>data
2005 2007
11.42 11.76
11.93 11.97
4.06 4.53
4.29 4.47
Hope this is clear,
Thanks in advance.
dxc13
--
View this message in context: http://www.nabble.com/A-variation-on-the-bar-plot-tp23374466p23374466.html
Sent from the R help mailing list archive at Nabble.com.
2009 May 19
3
how to calculate means of matrix elements
...nt is one matrix of size 4x4 in which position [1,1] is the
mean of position [1,1] of the given three matrices. The same goes for all
other positions of the matrix. If these three matrices are given in
separate text files, how can I write code that will get this result I need?
Thanks in advance,
dxc13
--
View this message in context: http://www.nabble.com/how-to-calculate-means-of-matrix-elements-tp23607694p23607694.html
Sent from the R help mailing list archive at Nabble.com.
2007 Sep 17
2
how to compare 2 numeric vectors
....
In general, I would like to find a way to do this for any number of given
positions between the two vectors that satisfy this. If no positions
satisfy this, then return '0'
I would like to store the results as an object.
If anyone has any ideas, I would greatly appreciate it. Thanks!
dxc13
--
View this message in context: http://www.nabble.com/how-to-compare-2-numeric-vectors-tf4469582.html#a12743842
Sent from the R help mailing list archive at Nabble.com.
2009 Apr 30
2
gridding values in a data frame
...ents of 5 degrees. If there are no temperatures
available to be put into a grid cell, than that cell should get a missing
value, NA, put into it.
Also, could the gridded result for each time be written to a text file
before processing the next time value?
Hope this is clear.
Thanks in advance.
dxc13
--
View this message in context: http://www.nabble.com/gridding-values-in-a-data-frame-tp23319190p23319190.html
Sent from the R help mailing list archive at Nabble.com.
2009 May 11
2
Plotting colors on a world map
...or scheme (low temperatures
in light blue to higher temperatures in dark red) and plot the temperature
colors in their respective grid cells on the map?
Take this data matrix as some example data:
T <- sample(-10:90, 2592, replace=TRUE)
mat <- matrix(T, nrow=36, ncol=72)
Thanks in advance,
dxc13
--
View this message in context: http://www.nabble.com/Plotting-colors-on-a-world-map-tp23484524p23484524.html
Sent from the R help mailing list archive at Nabble.com.
2008 Aug 30
1
help with "persp" function
...can't seem to get it to work. I want the length along x1 axis to be between
1 and 3 and the length along the x2 axis to be between 1 and 4. All z
values for x1 should be equal (say, z=1) because this is a plane, not a
cube. Below is my current code. Any help is appreciated
Thanks in advance
dxc13
x <- seq(from=1,to=3,by=.1)
y <- seq(1,4,by=.1)
f <- array(1,dim=c(21,1))
z <- as.matrix(cbind(x,y,f))
persp(x=x,y=y,z)
--
View this message in context: http://www.nabble.com/help-with-%22persp%22-function-tp19235739p19235739.html
Sent from the R help mailing list archive at Nabble.c...
2009 May 13
4
plotting a grid with color on a map
...ue, 21 to 50 green color,
51-70 orange, 71+ red colored cells. For any NAs, they should be colored
white.
I know how to create a map of the world using map() and add a grid to it
using map.grid(), but I can't color code the cells the way I need. Is there
a way to do this in R?
Thanks again.
dxc13 http://www.nabble.com/file/p23514804/time1test.txt time1test.txt
--
View this message in context: http://www.nabble.com/plotting-a-grid-with-color-on-a-map-tp23514804p23514804.html
Sent from the R help mailing list archive at Nabble.com.
2008 Feb 21
3
applying a function to data frame columns
...(v3) + .5, .5)
u <- do.call("expand.grid", list(uk1,uk2,uk3))
Here, there are 3 columns; instead of hard-coding this, can the function
given above, which will restrict the u data frame to values within the
ranges of each variable, be done with the apply function? Thanks in
advance.
dxc13
--
View this message in context: http://www.nabble.com/applying-a-function-to-data-frame-columns-tp15619657p15619657.html
Sent from the R help mailing list archive at Nabble.com.
2008 Jan 11
1
matching values in a list
...nt to take the average of
10 and 13. Then repeat the same process for the second column. The data
here is only a sample, but with the data I work with, there are many more
columns in each matrix in the list. Does anyone know a efficient way to do
this? Maybe using lapply()? Thanks in advance.
dxc13
--
View this message in context: http://www.nabble.com/matching-values-in-a-list-tp14767170p14767170.html
Sent from the R help mailing list archive at Nabble.com.
2008 Feb 20
2
intersecting rows of a matrix
useR's,
First, I would like to say thanks to John Fox for providing this segment of
code to perform intersection for multiple sets:
intersection <- function(x, y, ...){
if (missing(...)) intersect(x, y)
else intersect(x, intersection(y, ...))
}
I want to execute this function on the rows of a matrix I have:
Ik.mat.test <- matrix(c(2,3,6,1,2,6,6,1,2),byrow=T,nrow=3)
> Ik.mat.test
2007 Dec 18
3
creating a database
useR's,
I am writing a program in which the input can be multidimensional. As of
now, to hold the input, I have created an n by m matrix where n is the
number of observations and m is the number of variables. The data that I
could potentially use can contain well over 20,000 observations.
Can a simple matrix be used for this or would it be better and more
efficient to create an external
2008 Sep 05
1
smoothing with the Gaussian kernel
useR's,
Does anyone know what function or package allows one to specify use of the
Gaussian kernel to smooth a data set, or is this just the default for most
functions?
Thanks,
dxc13
--
View this message in context: http://www.nabble.com/smoothing-with-the-Gaussian-kernel-tp19323294p19323294.html
Sent from the R help mailing list archive at Nabble.com.
2009 Nov 25
1
interior and exterior colors of a map
...a
map('usa'). The image is basically a large rectangular of various colors.
When I overlay the United States map, the full rectangle of the image plot
is visible, but I only want to display the image WITHIN the United States
boundary.
Does anyone know a way to do this?
Thanks in advance,
dxc13
--
View this message in context: http://old.nabble.com/interior-and-exterior-colors-of-a-map-tp26507134p26507134.html
Sent from the R help mailing list archive at Nabble.com.
2008 Oct 24
1
Errors in R CMD check for R 2.8.0
...data for non-ASCII characters ... OK
* creating kzs-Ex.R ... OK
* checking examples ... ERROR
Running examples in 'kzs-Ex.R' failed.
I have no idea how to solve the first problem with references the tcltk
package and I do not know why my examples won't run. Any help is
appreciated.
dxc13
--
View this message in context: http://www.nabble.com/Errors-in-R-CMD-check-for-R-2.8.0-tp20150565p20150565.html
Sent from the R devel mailing list archive at Nabble.com.
2008 Jan 30
1
re stricting points in a data frame
...s
condition needs to be satisfied for both points, not just one of them; i.e.,
if an x1 point satisfies this, but its corresponding x2 point does not, then
this point should be removed.
Does anyone know a way to do this, in general, for any data frame?
Hope this is not confusing.
Thanks in advance
dxc13
--
View this message in context: http://www.nabble.com/restricting-points-in-a-data-frame-tp15184381p15184381.html
Sent from the R help mailing list archive at Nabble.com.