On Sun, 23 Nov 2008, jim holtman wrote:
You are right. union used 'unique(c(x,y))' and I am not sure if
'unique' preserves the order, but the help page seems to indicate that
"an element is omitted if it is identical to any previous element ";
this might mean that the order is preserved.
It s
One way is to 'paste' together the values in a column and then use
'table' to count them.
'duplicated' can probably do the same thing with the MARGIN option to
find the duplicated one. You still them have to find the original
ones.
On Sat, Nov 22, 2008 at 3:42 PM, Salas, Andria Kay <[EMAIL PROTE
You are right. union used 'unique(c(x,y))' and I am not sure if
'unique' preserves the order, but the help page seems to indicate that
"an element is omitted if it is identical to any previous element ";
this might mean that the order is preserved.
On Sat, Nov 22, 2008 at 11:43 PM, Stavros Macra
On Sat, Nov 22, 2008 at 10:20 AM, jim holtman <[EMAIL PROTECTED]> wrote:
> c.Factor <-
> function (x, y)
> {
>newlevels = union(levels(x), levels(y))
>m = match(levels(y), newlevels)
>ans = c(unclass(x), m[unclass(y)])
>levels(ans) = newlevels
>class(ans) = "factor"
>ans
>
Sorry, you wanted a vector not a matrix.
Here are several possibilities. (If you are
willing to hard code the levels then they
can be shortened by replacing sort(unique(y))
or levels(factor(y)) with its value -- in this
case 1:3)
c(outer(sort(unique(y)), y, "=="))+0
c(outer(levels(factor(y)), y,
The package Kendall computes the p-value when there are ties in one
ranking. This often happens with trend testing with environmental data. I
get about 5-10 emails per year from scientists using Kendall for that
purpose who don't know how to use R very well. I suspect this means there
are many user
On Sat, 22 Nov 2008 10:00:18 -0800 (PST)
zerfetzen <[EMAIL PROTECTED]> wrote:
> Goal:
> Suppose you have a vector that is a discrete variable with values
> ranging from 1 to 3, and length of 10. We'll use this as the example:
>
> y <- c(1,2,3,1,2,3,1,2,3,1)
>
> ...and suppose you want your new
Try this:
outer(y, sort(unique(y)), "==")+0
On Sat, Nov 22, 2008 at 3:37 PM, zerfetzen <[EMAIL PROTECTED]> wrote:
>
> Goal:
> Suppose you have a vector that is a discrete variable with values ranging
> from 1 to 3, and length of 10. We'll use this as the example:
>
> y <- c(1,2,3,1,2,3,1,2,3,1)
On Sat, Nov 22, 2008 at 12:00 PM, zerfetzen <[EMAIL PROTECTED]> wrote:
>
> Goal:
> Suppose you have a vector that is a discrete variable with values ranging
> from 1 to 3, and length of 10. We'll use this as the example:
>
> y <- c(1,2,3,1,2,3,1,2,3,1)
>
> ...and suppose you want your new vector (
Goal:
Suppose you have a vector that is a discrete variable with values ranging
from 1 to 3, and length of 10. We'll use this as the example:
y <- c(1,2,3,1,2,3,1,2,3,1)
...and suppose you want your new vector (y.new) to be equal in length to the
possible discrete values (3) times the length (1
It seems that there is no Hong Kong in maps' world cities.
>world.cities[substr(world.cities$name,1,3)=="Hon",]
namecountry.etcpop latlong capital
14623 Honami Japan 26040 33.61 130.68 0
14624 Honaz Turkey 8073 37.75 2
I need help determining the unique columns of a matrix and the numbers of each
unique column. For example, let's say I have a matrix with 6 columns, 2 of
these are filled with the value of 1 and the other 4 are filled with the value
of 0. I would then like to have a command that tells me what
On Nov 21, 2008, at 11:28 AM, Douglas Bates wrote:
> As tempting as it may be to want to have several dials and knobs on
> statistical models to tune their behavior, we still need to be careful
> to specify a mathematical model that is consistent.
-- Douglas Bates
Yet another
?get
names <- c('c', 'cc')
for (i in names){
print(nrow(get(i)))
}
On Sat, Nov 22, 2008 at 4:06 PM, Georg Ehret <[EMAIL PROTECTED]> wrote:
> Dear R community,
>I am trying to apply a simple operation to several dataframes (e.g.
> nrow) and cannot get the looping to work. My objective is
Dear R community,
I am trying to apply a simple operation to several dataframes (e.g.
nrow) and cannot get the looping to work. My objective is to get an output
that indicates me the number of rows for every dataframe.
> c
V1 V2 V3 V4 V5 V6 V7 V8 V9 V10
1 1 11 21 31 41 51 61 71 81 91
2 2
On Sat, Nov 22, 2008 at 9:04 AM, Martin Maechler
<[EMAIL PROTECTED]> wrote:
>SM> I believe Kendall tau is well-defined for this case...
>
> The real question is *WHY* there needs to be a separate package 'Kendall'
> when R itself does everything you want and does not show any problems?
Than
No, it only needed closer attention to the example:
This gets you to the point where you need to fix the y scale settings
but the values are properly cycled through.
barchart(Tuberize~Family|factor(Year)*factor(Hr),data=tuber,
panel = function(y,x,...){
To follow Dieter's comment,
You can in fact fit a data to a sine in Excel using LINEST. I've done
it. I don't recommend it :-) .
What I did was create columns containing sin(x) and cos(x) , roughly
speaking, and fit using
LINEST([y=values],{sines, cosines},...)
Ya need the cosines or som
On second look I see that although values appear in every panel, they
are the same in every panel as well. Some sort of use of the
subscripting facility probably needs to be employed.
--
David Winsemius
On Nov 22, 2008, at 1:05 PM, David Winsemius wrote:
Following the example in
https://sta
Following the example in
https://stat.ethz.ch/pipermail/r-help/2006-January/086985.html
You might want to try something like:
> barchart(Tuberize~Family|factor(Year)*factor(Hr),data=tuber,
+ panel = function(y,x,...){
+ panel.barchart(x,y,...)
+
Thanks a lot for the pointer to rgl.pop() - that works (as does
looking at the examples!)
On Nov 22, 2008, at 10:28 AM, Duncan Murdoch wrote:
On 21/11/2008 2:30 PM, Rajarshi Guha wrote:
Hi, I'm using rgl to generate a 3D surface plot and I'm struggling
to get the lighting correct. Currentl
Try something like the code below. Unfortunately I cannot remember who wrote
the code.
===
my.values=10:15
x <- barplot(my.values, ylim=c(0,11))
text(x, my.values, "wibble", pos=3) # always does what you want
#
On 22/11/2008 2:01 AM, Kyle Matoba wrote:
List,
I would like to set a variable to hold, say, the size of my plots in a
Sweave document. i.e. something like the following in my '.Rnw' file:
==
smallPlotSize = 4
<>=
dat
You can try this also:
unlist(list(f1, f2))
On Fri, Nov 21, 2008 at 3:15 PM, udi cohen <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I hope it's not too trivial for the list - I'm trying to concatenate
> two factor arrays, and obtain the following:
>
> > f1<-factor(c("a","a","b"))
> > f1
> [1] a a b
On Thu, 2008-11-20 at 19:43 -0800, Andrew J. Rominger wrote:
> Dear list,
>
> First off, let me offer my apologies, I know this is a very basic
> question. After amassing a large number of objects (from multiple
> projects) in one working directory, I'd like to be able to start using
> different
On 21/11/2008 2:30 PM, Rajarshi Guha wrote:
Hi, I'm using rgl to generate a 3D surface plot and I'm struggling to
get the lighting correct. Currently the surface gets plotted, but is
very 'shiny'. On rotating the view, I get to see parts of the surface
- but overall I don't see much detail b
Here is a function I have used. I got it from the list, and
unfortunately don't remember who to credit:
c.Factor <-
function (x, y)
{
newlevels = union(levels(x), levels(y))
m = match(levels(y), newlevels)
ans = c(unclass(x), m[unclass(y)])
levels(ans) = newlevels
class(ans)
I am not sure exactly what you mean with your question. If you have a
named list and want to access the 'name' within the 'for' along with
the value, then you can do something like this:
for (i in names(myList)){
value <- myList[[i]] # get the values
plot(values, main=paste("Plot of", i
Hi
Wondering if anyone knows of a package that does Nested Clade Analysis?
Thanks
--
View this message in context:
http://www.nabble.com/Nested-Clade-Analysis-tp20637180p20637180.html
Sent from the R help mailing list archive at Nabble.com.
__
R-hel
You need to also provide the data that your code is using since the
error message indicates that the problem is probably in the way that
the object 'a' is defined and there is no indication of what it looks
like. You should either provide the output of "str(a)", or the output
of 'dput(a)' so we ha
> "SM" == Stavros Macrakis <[EMAIL PROTECTED]>
> on Fri, 21 Nov 2008 14:44:37 -0500 writes:
>> library(Kendall) Kendall(1:3,1:3)
SM> WARNING: Error exit, tauk2. IFAULT = 12 << tau = 1,
SM> 2-sided pvalue =1
SM> I believe Kendall tau is well-defined for this case an
2008/11/22 RON70 <[EMAIL PROTECTED]>:
>
> I want to draw following plot, given here
> http://www.2shared.com/file/4327128/830b82c4/pic.html
> for the following data :
>
> dat <- cbind(rnorm(100), sample(c(1:4), 1000, T))
> colnames(dat) <- c("data","level")
>
> Here x-axis should be on "data" and y
I thought I'd share a few workaround routes I've considered (my
attempt at using Amos' Fortran routines failed miserably -- if anyone
is interested i can explain what I tried),
- Ryacas seems to provide a very simple way to evaluate bessel
functions with complex argument,
yacas("N(Besse
A short addendum, resulting from an off-list discussion:
The reason why Colleen's code failed was raising a negative base to a
fractional exponent in the third state equation for certain sets of
parameters, esp. fractional values of beta.
Old versions of odesolve broke down, and recent versio
Dear R guru,
I am Saikat Sarkar working as a researcher of Economics in Tampere
University, Finland. I am trying to estimate some Garch related tests with
Bayesian analysis by R programme.
I am not good in R but trying to survive.
Anyway I have the coding but not working properly. I have tried
List,
I would like to set a variable to hold, say, the size of my plots in a
Sweave document. i.e. something like the following in my '.Rnw' file:
==
smallPlotSize = 4
<>=
dat <- read.table("
http://www.stanford.edu/~xi
I have question: how can I put the value on the bar chart.
This my code:
barchart(Tuberize~Family|factor(Year)*factor(Hr),data=tuber)
This's my data:
Year Hr Family Tuberize
1 2007 20 A 0.26
2 2007 20 B 6.08
3 2007 20 C 0.00
4 2007 20 D 0.27
5 2008 20
Hi R users,
I am doing some image analysis and I'd like to know if anyone knows of:
1. a way to specify a rectangle (using xy coordinates) within an image to
have R evaluate using xy pixel coordinates and
2. a way to get brightness readings for that part of the image.
If there's some way to c
I want to draw following plot, given here
http://www.2shared.com/file/4327128/830b82c4/pic.html
for the following data :
dat <- cbind(rnorm(100), sample(c(1:4), 1000, T))
colnames(dat) <- c("data","level")
Here x-axis should be on "data" and y-axis is for "level" and z-axis should
be to display
Try str(ss) to see what it really looks like. You probably want:
fn <- function(i) c(i, i^2)
On Sat, Nov 22, 2008 at 4:54 AM, megh <[EMAIL PROTECTED]> wrote:
>
> I need one more clarification here :
>
> Here I did :
>
> fn <- function(i) return(list(i, i^2))
> ss = sapply(1:4, fn)
>
> Here the
megh wrote:
I need one more clarification here :
Here I did :
fn <- function(i) return(list(i, i^2))
ss = sapply(1:4, fn)
Here the object "ss" should be a matrix object :
is.matrix(ss)
However I feel it lacks some the matrix object properties. For example the
syntax "min(ss[1,])" generates an
I need one more clarification here :
Here I did :
fn <- function(i) return(list(i, i^2))
ss = sapply(1:4, fn)
Here the object "ss" should be a matrix object :
is.matrix(ss)
However I feel it lacks some the matrix object properties. For example the
syntax "min(ss[1,])" generates an error :
"Err
cruz wrote:
Hi,
I am residing in Taipei, Taiwan. My windows has English R (2.7.2)
installed. I noticed that the CRAN mirror for Taipei is Taiwan
(Taipeh), Is Taipeh a Deutsch or English name?
A quick googling suggests that it is a German spelling (which makes
sense because Germans by and lar
On Fri, Nov 21, 2008 at 5:50 AM, Gerit Offermann <[EMAIL PROTECTED]> wrote:
> Dear list,
>
> thanks to your help I managed to find means of analysing my data.
>
> However, the whole data set contains 264 variables. Of which some are
> factors, others are not. The factors tend to be grouped, e.g.
>
Hi,
I am residing in Taipei, Taiwan. My windows has English R (2.7.2)
installed. I noticed that the CRAN mirror for Taipei is Taiwan
(Taipeh), Is Taipeh a Deutsch or English name?
Thanks,
cruz
__
R-help@r-project.org mailing list
https://stat.ethz.ch/m
On Fri, 2008-11-21 at 22:37 -0800, subbudas wrote:
> hello everyone ,
> i have written some code in R for jump diffusion model.
> the code generates answer as
> " NaN
> There were 50 or more warnings (use warnings() to see the first 50)"
> my code is
>
> mu<-0.2
> sig<-0.2
> S0<-100
> j<-0.2
>
i tried to run your code, this is how/why you got NaN:
> mu<-0.2
> sig<-0.2
> S0<-100
> j<-0.2
> dt<-1/252
> int<-0.1
> i<-0
> is.nan
function (x) .Primitive("is.nan")
> k<-rnorm(1,0,1)
> k
[1] 0.3214954
> theta<-ifelse((k<(int*dt)),1,0)
> theta
[1] 0
> m<-rnorm(1)
> m
[1] -0.4525731
> ga
47 matches
Mail list logo