On Wed, Sep 30, 2009 at 8:40 PM, Michael Knudsen wrote:
>> a = seq(0.1,0.9,by=0.1)
>> a
> [1] 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9
>> a[1] == 0.1
> [1] TRUE
>> a[2] == 0.2
> [1] TRUE
>> a[3] == 0.3
> [1] FALSE
A friend of mine just pointed out a possi
e to but
> not equal to 1/10 (because 1/10 is not exactly representable in R), so you
> got something different.
Well, the problem is that I don't know how seq is implemented. I just
assumed that it wouldn't behave like this.
--
Michael Knudsen
micknud...@gmail.com
http://si
lternative
> a = (1:9)/10
works just fine. Are there any good guides out there on how to deal
with issues like this? I am normally aware of rounding errors, but it
really surprised me to see that an elementary function like seq would
behave in this way.
Thanks,
Michael Knudsen
--
Micha
paper
http://www.ploscompbiol.org/article/info%3Adoi%2F10.1371%2Fjournal.pcbi.1000482
some days ago. It's quite interesting, and it links to some excellent
slides that look great as templates for making your own R course.
Best,
Michael
--
Michael Knudsen
micknud...@gmail.com
http://lifeofknu
On Fri, Sep 11, 2009 at 7:15 PM, carol white wrote:
> It might be a primitive question but how it is possible to determine if a
> variable is initialized in an environment?
What about this?
> "x" %in% ls()
[1] FALSE
> x = 41
> "x" %in% ls()
[1] TRUE
Best,
M
lmed by enthusiasm:
http://lifeofknudsen.blogspot.com/2009/07/most-of-work-i-do-in-r-has-to-do-with.html
It's very basic, but maybe you'll find it useful.
Best,
Michael Knudsen
--
Michael Knudsen
micknud...@gmail.com
http://lifeofknudsen.blogspot.com/
___
On Sun, Aug 23, 2009 at 8:53 PM, Bogaso wrote:
> No no, I actually want following result :
>
> 7, 14, 21, 6, 13, 20, 5, 12, 19,
How about this?
x = c()
for (i in 7:1) x = c(x,mat[i,])
Guess that would do the trick.
Best,
Michael
--
Michael Knudse
is
the case, maybe the package "bigmemory" can alleviate your pain.
Best,
Michael
--
Michael Knudsen
micknud...@gmail.com
http://lifeofknudsen.blogspot.com/
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PL
On Tue, Aug 18, 2009 at 6:59 PM, David Winsemius wrote:
> ITYM:
>
> plot(data$V6, data$V5, col="red")
Yup! My mistake.
--
Michael Knudsen
micknud...@gmail.com
http://lifeofknudsen.blogspot.com/
__
R-help@r-project.org
On Mon, Aug 17, 2009 at 12:51 PM, e-letter wrote:
> I have tried to add the delta (δ) symbol to the y axis label and the
> result is &D, using the command:
>
> ...ylab="δt"...
Try ylab = expression(delta*t) instead.
Best,
Michael
--
Michael Knudsen
On Sun, Aug 16, 2009 at 9:19 PM, malcolm
Crouch wrote:
>> plot(V6,V5, col="red")
> or
>> plot(V6,V5)
It seems that V5 and V6 are column names in your data matrix. If your
matrix is called data, you should use
plot(x$V6,x$V5,col="red")
instead.
Best,
M
ees
> according to the output and identical results when you set the seed before
> the call. While results are expected to be similar they should not be
> identical if the number of trees was actuallly changed.
Oops! You have written n.tree instead of ntree.
Best,
Michael
--
Michael
rest algorithm is very robust and apparently 500 trees
are usually more than enough. Therefore you don't get better results
by using 2000 trees, and often it doesn't affect the performance if
you use fewer trees (e.g. 200).
Best,
Michael
--
Michael Knud
On Thu, Aug 13, 2009 at 3:07 PM, Gabor
Grothendieck wrote:
> See the split argument in ?sink
Thanks! I actually did check the manual for sink (it's true!) but
somehow I managed to overlook the split argument.
--
Michael Knudsen
micknud...@gmail.com
http://lifeofknudsen.blog
= function(X)
{
N = length(X)
if (N==2) return(X[[1]]+X[[2]])
else return(matrixSum(X[[1:(N-1)]],X[[N]]))
}
I guess that one should do the trick.
Best,
Michael
--
Michael Knudsen
micknud...@gmail.com
http://lifeofknudsen.blogspot.com/
__
R-help@r
Hello!
Using the sink function, output from R may be written to a file
instead of the screen. I would really like to write my output to a
file while running an R script and at the same time view the output
"live" on my screen. Is there are way to do that?
Thanks,
Michael
--
Micha
e
100 random entries from x?
sample(sample(1:5,115,replace=TRUE),100,replace=FALSE))
--
Michael Knudsen
micknud...@gmail.com
http://lifeofknudsen.blogspot.com/
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read
ical "NULL" value. Thoughts?
I would like to test it myself, but I haven't succeeded in copying
your data to a text file readable by R. If you can email it to me,
I'll give it a try.
--
Michael Knudsen
micknud...@gmail.com
http://lifeofknudsen.blogspot.com/
_
On Wed, Jul 22, 2009 at 9:37 PM, Chuck Cleland wrote:
> How about this?
>
> which(x %in% c(2,3))
Thanks to you all! I had never thought about using %% in this context.
--
Michael Knudsen
micknud...@gmail.com
http://lifeofknudsen.blogspot.com/
___
guess was
y=c(2,3)
which(x==y)
integer(0)
which doesn't work. I haven't found any clue in the R manual.
Thanks!
--
Michael Knudsen
micknud...@gmail.com
http://lifeofknudsen.blogspot.com/
__
R-help@r-project.org mailing list
https://stat.
hat cmd+/ will make a
block comment. By default it adds '//' instead of '#', but I guess
that it can be fixed somehow.
--
Michael Knudsen
micknud...@gmail.com
http://lifeofknudsen.blogspot.com/
__
R-help@r-project.org mailing list
htt
self. It seems that the
answer is negative, so I have ended up using
if (1==0)
{
# code goes here
}
although is not really nice to look at.
--
Michael Knudsen
micknud...@gmail.com
http://lifeofknudsen.blogspot.com/
__
R-help@r-project.org
can send me the matrix as a text file -- ready to import in R
-- I can give it a try.
Best,
Michael
--
Michael Knudsen
micknud...@gmail.com
http://lifeofknudsen.blogspot.com/
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r
e
> write(tmp,file="tmp.xls")
You have to add an ncolumns option like
write(tmp,file="tmp.xls",ncolumns=100). The default is five columns.
--
Michael Knudsen
micknud...@gmail.com
http://lifeofknudsen.blogspot.com/
__
R-help@r-pro
eN = list_of_prices[[N]]
you could easily define a recursive function to do the job for you.
Would it difficult for you to read the data into a list?
When dealing with only a few sets, numbering objects as you do is no
problem, but for many objects it can become very cumbersome.
--
Michae
2009/7/21 Markus Mühlbacher :
> So just that I understand right. x and y are the scalings of the x and y axis
> and the matrix represents the color of the points at each gridpoint?
Precisely! Try ?image for more details.
--
Michael Knudsen
micknud...@gmail.co
I just don't get the point of the mahalanobis() function in R.
It looks quite weird to me :-(
--
Michael Knudsen
micknud...@gmail.com
http://lifeofknudsen.blogspot.com/
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-hel
g required package: bigmemory
> kmeans.big.matrix
Error: object 'kmeans.big.matrix' not found
Does anybody know how to get the kmeans.big.matrix() function? Are
there other cluster algorithms out there ready to accept a big.matrix
as input?
Thanks!
--
Michael Kn
2009/7/20 Markus Mühlbacher :
> Gives the attached image. Again I am missing the white diagonal. Is there
> some kind of sorting that I do not consider?
Maybe col=c("white",heat.colors(100)) will do the trick?
--
Michael Knudsen
micknud...@gmail.com
http://lifeofknud
d be fairly easy to fit your data into that one. I guess that
this should work:
x = 1:length(activity.matrix)
y = 1:length(activity.matrix)
image(x, y, activity.matrix, col=heat.colors(100))
--
Michael Knudsen
micknud...@gmail.com
http://lifeofknudsen.blogspot.com/
___
I guess that the matrix is therefore
considered non-invertible by R. Recall that S must be invertible
http://en.wikipedia.org/wiki/Mahalanobis_distance
to work as a covarinace matrix in the definition of the Mahalanobis distance.
--
Michael Knudsen
micknud...@gmail.com
http://lifeofknu
g up now, so cross your fingers
:-)
--
Michael Knudsen
micknud...@gmail.com
http://lifeofknudsen.blogspot.com/
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org
% instead of %do%, if you want to
take advantage of multiple cores. While being totally ecstatic after
discovering foreach, I wrote the following (very simple) guide:
http://lifeofknudsen.blogspot.com/2009/07/most-of-work-i-do-in-r-has-to-do-with.html
Maybe you'll find it useful, m
art of your data.
--
Michael Knudsen
micknud...@gmail.com
http://lifeofknudsen.blogspot.com/
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.ht
On Mon, Jul 20, 2009 at 10:23 AM, Michael Knudsen wrote:
> Thanks! The shared.big.matrix was exactly what I needed. It still
> remains for me, though, to check if I run into memory problems anyway.
> It doesn't seem as if there's a "don't return anything" opti
l
remains for me, though, to check if I run into memory problems anyway.
It doesn't seem as if there's a "don't return anything" option in the
foreach function (also mentioned in my previous post in this thread).
Best,
Michael
--
Michael Knudsen
m
be able to build the matrix row by row in a parallel way.
Best,
Michael
--
Michael Knudsen
micknud...@gmail.com
http://lifeofknudsen.blogspot.com/
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the pos
mbine option. I have checked out the big.matrix manual, but I can't
find a function suitable for just that.
Actually, I wouldn't even know how to do it for a usual matrix. Any clues?
Thanks!
--
Michael Knudsen
micknud...@gmail.com
http://lifeofknudsen.blogspot.com/
___
On Fri, Jul 17, 2009 at 10:37 PM, PDXRugger wrote:
> So i need to replace the the #NULL! with 0. I have tried:
>
> Props_pct_vacant<-Props_pct_vacant[Props_$pct_vacant !="#NULL!"]
Try this instead:
Props_$pct_vacant[which(Props_$pct_vacant=="#NULL!")]
x1 = rep(1,times=length(y1))
x2 = rep(2,times=length(y2))
plot(c(x1,x2),c(y1,y2),xaxt="n")
axis(side=1,at=c(1,2),labels=c("label1","label2"))
It looks like a hack, but it should work.
--
Michael Knudsen
micknud...@gmail.com
http://lifeofknudsen.blogspot.com/
__
ver want to do that.
> Here the proposed by R-guy solution
>
> mydata <- data.frame(W21)
Where is your function, and what is W21?
--
Michael Knudsen
micknud...@gmail.com
http://lifeofknudsen.blogspot.com/
__
R-help@r-project.org mailing list
-04
That it a vector of length 15.
> How is it possible to transform the data to get a vector as following
>
> 10 0.017511063
> 11 0.017819918
> 12 0.017944472
That looks like a 3x2 matrix. How do you get that from the vector above?
--
Michael Knudsen
m
ou can just type
read.table("school.txt",...)
I would, however, suggest that you move your files to a directory
specifically dedicated to your R project in order not to clutter up
your desktop.
--
Michael Knudsen
micknud...@gmail.com
http://lifeofknud
On Thu, Jul 16, 2009 at 3:04 PM, Marc Schwartz wrote:
> Actually, by default, the OSX HFS+ file system is not case sensitive:
Sorry. I just took that for granted, as Mac (at least in a terminal)
is very similar to Linux.
--
Michael Knudsen
micknud...@gmail.com
http://lifeofknudsen.blogspot.
ernatively you could write:
/Users/username/Desktop/schools.txt
--
Michael Knudsen
micknud...@gmail.com
http://lifeofknudsen.blogspot.com/
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posti
you want to calculate the
greatest common divisor of.
--
Michael Knudsen
micknud...@gmail.com
http://lifeofknudsen.blogspot.com/
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-
On Tue, Jul 14, 2009 at 2:29 PM, Gabor
Grothendieck wrote:
> seq. <- function(from, to) seq(from = from, length = max(0, to - from + 1))
Really nice! Thank you!
--
Michael Knudsen
micknud...@gmail.com
http://lifeofknudsen.blogspot.com/
__
R-
ession
(1:N^2)[which((1:N^2)!=seq(0,(N-1)*N,by=N)+(1:N))]
to get the indices of the non-diagonal entries of a matrix :-)
--
Michael Knudsen
micknud...@gmail.com
http://lifeofknudsen.blogspot.com/
__
R-help@r-project.org mailing list
https://stat.e
#
This mail is forwarded from Mark Leeds (markle...@verizon.net) who is
experiencing troubles sending to the list himself.
#
Hi: I went through Soren Buhl's documentation for installing and
running R2WinBUGS in linux. Thank you Soren for
the nice documentation. I installed wine
On Tue, Jul 14, 2009 at 8:20 AM, Michael Knudsen wrote:
> What do you mean? It looks a like a very general solution to me.
Just got an email suggesting using the functions col and row. For example
temp = matrix(c(1:36),nrow=6)
which(col(temp)>row(temp))
This gives the indices (in the
ot the general solution, (...)
What do you mean? It looks a like a very general solution to me.
--
Michael Knudsen
micknud...@gmail.com
http://lifeofknudsen.blogspot.com/
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEA
than B is in R interpreted as the numbers
from B to A in reverse order.
Is there a clever way to make nested loops like the one above in R?
--
Michael Knudsen
micknud...@gmail.com
http://lifeofknudsen.blogspot.com/
__
R-help@r-project.org mailing list
teresting question, I didn't know the answer to, so I tried to look
it up. There might be some help towards the bottom of this page:
http://www.statmethods.net/advgraphs/parameters.html
It seems to be specific for Windows, so I can't test it myself.
--
Michael Knudsen
micknu
[which(is.na(x))]
--
Michael Knudsen
micknud...@gmail.com
http://www.google.com/profiles/micknudsen
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-
54 matches
Mail list logo