See ?ave and try this:
a[as.numeric(ave(a[,1], a[,1], FUN = length)) > 1, ]
On Sun, Aug 31, 2008 at 2:19 AM, Yuan Jian <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have a matrix.
>>a<-cbind(c("a","b","a"),c(4,3,6))
> [,1] [,2]
> [1,] "a" "4"
> [2,] "b" "3"
> [3,] "a" "6"
>
> I want to remove r
DF<-cbind(c("a","b","a"),c(4,3,6))
DF[(DF[,1] %in% names(which(table(DF[,1]) >= 2))),]
On Sun, Aug 31, 2008 at 2:19 AM, Yuan Jian wrote:
Hi,
�
I have a matrix.
a<-cbind(c("a","b","a"),c(4,3,6))
[,1] [,2]
[1,] "a"� "4" [2,] "b"� "3" [3,] "a"� "6"
I want to remove rows in matrix a whos
Dear jayuan2008,
See ?subset. If I understand your description below, something like this
could do the job:
a1<-data.frame(x=c("a","b","a","b","a"),y=c(4,3,6,1,2))
subset(a1,y>2)
x y
1 a 4
2 b 3
3 a 6
BTW, I think that the final result you described in your post is incorrect.
HTH,
Jorge
Hi,
I have a matrix.
>a<-cbind(c("a","b","a"),c(4,3,6))
[,1] [,2]
[1,] "a" "4"
[2,] "b" "3"
[3,] "a" "6"
I want to remove rows in matrix a whose first column has frequency less than 2.
in about example matrix a becomes
[,1] [,2]
[1,] "a" "4"
[2,] "a" "6"
[[
Yes, this works nicely. Thank you!
jholtman wrote:
>
> Is this what you want to do:
>
> x <- seq(from=1,to=3,by=.1)
> y <- seq(1,4,by=.1)
> z <- matrix(1, length(x), length(y))
> persp(x=x,y=y,z,zlim=c(0,2))
>
>
> On Sat, Aug 30, 2008 at 2:08 PM, dxc13 <[EMAIL PROTECTED]> wrote:
>>
>> Dear L
Hello ALL,
I'm unsure how to interpret partial dependence plots and had 2 questions:
Does the randomForest library scale partial dependence plots such that zero
on the y axis is mean(y)? I am also unclear as to why the range of y on
these plots is smaller than what is in the dataset.
Also I
Is this what you want to do:
x <- seq(from=1,to=3,by=.1)
y <- seq(1,4,by=.1)
z <- matrix(1, length(x), length(y))
persp(x=x,y=y,z,zlim=c(0,2))
On Sat, Aug 30, 2008 at 2:08 PM, dxc13 <[EMAIL PROTECTED]> wrote:
>
> Dear List,
>
> I am trying to draw a rectangular plane using the persp function, ho
On 30/08/2008 10:10 AM, Steven Shafer wrote:
I am using the RGL library in scripted (non-interactive) mode, but wish to
give the data analyst an opportunity to exam the 3D plots. The "data
analysts" understand the data, but not R. My intent is to provide simple
Windows (XP) batch files that call
you can combine write and write.table, using append=TRUE.
e.g.,
write1 <- function(txt, mat, filename) {
for(i in 1:length(txt)) {
write(txt[i], file=filename, append=i!=1)
write.table(mat[[i]], file=filename, append=TRUE,sep ="\t")
}
}
t <- c("text1", "text2", "text3")
m <- list(mat
I have been trying to specify a different color palette to the image
method in plot.Design. My model has crossed two rcs() arguments and
one two-level gender argument. The goal which appears to have been
mostly achieved is to produce separate bivariate plots for men and women
The call to
Hi,
I want a function to write some of its output into a text file with
the following format:
'some text'
output matrix A
'some more text'
output matrix B
'some other text still'
output matrix C
...
The dimensions of matrices A, B, ... are different and the total
number of matrices
that I w
Dear List,
I am trying to draw a rectangular plane using the persp function, however I
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 plan
If this is the case then how to I take a list of numbers (residuals in this
case) and create anothe list that is longer and padded by zeros? Maybe fft
already does this for me but as I understood it I need to pass an vector to the
fft that is of a power of 2 length. If I still need to do this th
I am using the RGL library in scripted (non-interactive) mode, but wish to
give the data analyst an opportunity to exam the 3D plots. The "data
analysts" understand the data, but not R. My intent is to provide simple
Windows (XP) batch files that call R and automatically pass scripts to it,
and thu
Try this:
> library(gsubfn)
> strapply(x, "[0-9]+| +[^ ]+ *")[[1]]
[1] "2" " Value " "34" " a-c " "45" " t"
which keeps the spaces around the non-numeric entries as in
your example; however, if keeping the spaces is not important
then its even easier:
> strsplit(x, " ")[[1]]
[1
Dear list,
I am trying to split a string using regexp:
x <- "2 Value 34 a-c 45 t"
strsplit(x, "[0-9]")
[[1]]
[1] "" " Value " "" " a-c " "" " t"
But I don't want to lose the digits (pattern), the result
should be:
[[1]]
[1] "2" " Value " "34" " a-c " "45" " t"
Thanks for any tipp
Pat
On Fri, Aug 29, 2008 at 6:46 PM, David Huffer <[EMAIL PROTECTED]> wrote:
> I'm looking for something along the lines of
>
> which ( table ( x ) == max ( table ( x ) ) )
>
> to find the most common level of one factor
> by several other factors. For instance, I've got
> > X <- data.frame (
> +
Brian Lunergan wrote:
Evening all:
Stepping away from the stats methodology questions for a moment, I have
a housekeeping question for when it comes time to make the jump to v2.7.2.
I'm running v2.7.1 on an XP system. I have a suspicion that, by way of
experimentation with a couple of shel
Kurapati, Ravichandra (Ravichandra) wrote:
Hi
str<-"50.20"
as.numeric(str)
[1] 50.2
But I want 50.20 as o/p
For output formatting, see ?formatC, for example.
Uwe Ligges
How can I get
Thanks
K.Ravichandra
[[alternative HTML version delete
[EMAIL PROTECTED] wrote:
I am calling fft and getting a "non-numeric" error:
+ fit <- lm(Quantity ~ DayOfYear, .sublist)
+ # Make the time series
+ x <- as.numeric(rep(0,512))
+ x <- merge(residuals(fit), x)
+ # Transform range to -pi - pi
+ x <-
Estaré ausente de la oficina desde el 29/08/2008 y no volveré hasta el
07/09/2008.
Responderé a su mensaje cuando regrese.
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
Brian Lunergan ncf.ca> writes:
>
> I am stuck with a problem and I need help
> ---
> R has a defined function sum()
>
> I by chance defined a function with same name
>
> sum<-function(type='public')
> {
> ...
>
> }
>
> and now I m not able to get rid of my sum() f
Original Message
Subject: ***HTML***R help
Date: Sat, 30 Aug 2008 14:30:48 +0530
From: sayeed hussain <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Hello there
I am stuck with a problem and I need help
---
R has a defined function sum()
I by chance defined
Adrian Dusa wrote:
Adrian Dusa gmail.com> writes:
[...snip...]
f[which(f %in% names(table(f))[table(f) >= 2]), drop=TRUE]
[1] a a
Levels: a
Or, more simple:
f[f %in% names(table(f))[table(f) >= 2], drop=TRUE]
[1] a a
Levels: a
Adrian
Also see the combine.levels function in the Hmisc pa
Adrian Dusa gmail.com> writes:
> > [...snip...]
> > f[which(f %in% names(table(f))[table(f) >= 2]), drop=TRUE]
> [1] a a
> Levels: a
Or, more simple:
> f[f %in% names(table(f))[table(f) >= 2], drop=TRUE]
[1] a a
Levels: a
Adrian
__
R-help@r-project.o
Yuan Jian yahoo.com> writes:
> [...snip...]
>
> I want to remove level b because level b has less than 2.
> > f
> [1] a a
> Levels: a
> f[which(f %in% names(table(f))[table(f) >= 2]), drop=TRUE]
[1] a a
Levels: a
HTH,
Adrian
__
R-help@r-project.or
Hi
> str<-"50.20"
> as.numeric(str)
[1] 50.2
>
But I want 50.20 as o/p
How can I get
Thanks
K.Ravichandra
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailma
If you do
?read.table
you would most likely find the answer on your own.
Have a look at the description of the as.is and colClasses argument.
The column sn.rnc has been automatically recognised as being numeric.
After
Df1<-read.table("Dbfile",colClasses="character",header=TRUE)
you will see
28 matches
Mail list logo