: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
--
Michael Knudsen
micknud
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://sites.google.com/site
On Wed, Sep 30, 2009 at 8:40 PM, Michael Knudsen micknud...@gmail.com 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 possible solution:
a=seq(0.1,0.9,by=0.1
read this 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
overwhelmed 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 Fri, Sep 11, 2009 at 7:15 PM, carol white wht_...@yahoo.com 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,
Michael
--
Michael Knudsen
On Sun, Aug 23, 2009 at 8:53 PM, Bogasobogaso.christo...@gmail.com 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
-- if that 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
On Sun, Aug 16, 2009 at 9:19 PM, malcolm
Crouchmalcolm.crouc...@gmail.com 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,
Michael
--
Michael
On Mon, Aug 17, 2009 at 12:51 PM, e-letter inp...@gmail.com 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
micknud...@gmail.com
http
On Tue, Aug 18, 2009 at 6:59 PM, David Winsemiusdwinsem...@comcast.net 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 mailing list
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 Knudsen
micknud...@gmail.com
http://lifeofknudsen.blogspot.com
trees
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 Knudsen
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
--
Michael Knudsen
)
{
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
to sample
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
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/
__
R-help@r-project.org
. 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 mailing list
that 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
https://stat.ethz.ch
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.ethz.ch/mailman
On Wed, Jul 22, 2009 at 9:37 PM, Chuck Clelandcclel...@optonline.net 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
2009/7/21 Markus Mühlbacher muehli...@yahoo.com:
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.com
http
]]
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.
--
Michael Knudsen
micknud...@gmail.com
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-project.org mailing list
https
!
If you 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
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 posting guide http
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
micknud...@gmail.com
http://lifeofknudsen.blogspot.com
(ks.test(first_x,second_x)$statistic)
}
y = attach.big.matrix(desc)
y[i,] = these_distances
}
The error message from R was:
*** caught segfault ***
address (nil), cause 'memory not mapped'
/Michael
--
Michael Knudsen
micknud...@gmail.com
http://lifeofknudsen.blogspot.com
? They are outliers and part 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
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, maybe not.
--
Michael Knudsen
micknud...@gmail.com
http
is slowly waking 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
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
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
2009/7/20 Markus Mühlbacher muehli...@yahoo.com:
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
: 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 Knudsen
micknud...@gmail.com
http
zero.
Maybe 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
On Fri, Jul 17, 2009 at 10:37 PM, PDXRuggerj_r...@hotmail.com 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!)] = 0
--
Michael Knudsen
micknud
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/
__
R-help
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
https://stat.ethz.ch/mailman
,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/
__
R-help@r
/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 posting guide http://www.R-project.org/posting-guide.html
On Thu, Jul 16, 2009 at 3:04 PM, Marc Schwartzmarc_schwa...@me.com 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
to
Desktop, you 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://lifeofknudsen.blogspot.com
8.528219e-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
micknud...@gmail.com
http
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
.
This is not 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
(in the matrix viewed as a vector) of the
above-diagonal entries.
--
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
expression
(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
On Tue, Jul 14, 2009 at 2:29 PM, Gabor
Grothendieckggrothendi...@gmail.com 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
))]=a[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
Interesting 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
micknud...@gmail.com
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
https
52 matches
Mail list logo