x[ is.na(x) ] - 0
should work in most cases i think.
Gabor
On Fri, Sep 14, 2007 at 10:08:19AM +0200, Alfredo Alessandrini wrote:
Hi,
how can I replace NA value with 0:
1991 217 119 103 109 137 202 283 240 146 NA
1992 270 174 149 144 166 239 278 237 275 NA
1993 146 111 104 89 98
On Fri, Sep 14, 2007 at 09:46:57AM +0100, S Ellison wrote:
Gabor Csardi [EMAIL PROTECTED] 14/09/2007 09:27:03
x[ is.na(x) ] - 0
should work in most cases i think.
... only you probably shouldn't be doing that at all. Words like 'bias'
spring to mind...
Woudn't it be better
I don't know a way of loading parts of an .RData file either,
but another solution is to use the envir argument of load to
load the data into a new environment:
x - 1
y - rnorm(3)
save.image(tmp.RData)
rm(x)
rm(y)
load(tmp.RData, env - new.env())
get(x, env)
[1] 1
get(y, env)
[1]
Johannes,
with the igraph package, this would be something like
library(igraph)
g - graph.data.frame( data.frame(from=data$acra,
to=data$acrb, weight=data$expab))
Gabor
On Sun, Sep 23, 2007 at 11:39:40AM -0400, Johannes Urpelainen wrote:
Hi,
I am trying to construct
You need to install the libc6-dev ubuntu package to be able
to compile programs.
sudo apt-get install libc6-dev
Gabor
On Thu, Oct 04, 2007 at 09:54:26AM -0400, Ricardo Pietrobon wrote:
I must be making some really basic mistake, since I keep getting an
error message when using
in the wine windows (not) emulator, so you
can use it on linux, OSX, etc. with some more effort.
Gabor
--
Csardi Gabor [EMAIL PROTECTED]MTA RMKI, ELTE TTK
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read
Paul,
if you have large graphs the igraph package might help,
it works very well with large sparse graphs. To convert an adjacency
matrix (A) to an igraph graph object (g) you can simply use
library(igraph)
g - graph.adjacency(A)
and then you can generate layouts with
Dieter,
there are a couple of ways to do this in igraph, eg.
you can decompose the graph into separate components with
g - erdos.renyi.game(100, 1/100)
graphs - decompose.graph(g)
and then you will have a list of graphs. If you assign some vertex
ids as vertex attributes then you can keep
Jonas, if you want the function to load really automatically,
without running source of anything, read
?Startup
Basically you need to create an .Rprofile file (its location depends
on your operating system) containing the R code you want to run
at startup.
Gabor
On Sat, Oct 27, 2007 at
On Sun, Oct 28, 2007 at 11:25:06AM -0700, Ben Bolker wrote:
Baoqiang Cao-2 wrote:
Dear All,
I'd like to know if there is anyway to download a certain structure file
from http://www.pdb.org/. I tried the following but failed:
tmp -
is.character(dd) length(dd) == 0
should do it i think.
Gabor
On Thu, Nov 15, 2007 at 04:54:45PM -0500, Gang Chen wrote:
I want to identify whether a variable is character(0), but get lost.
For example, if I have
dd-character(0)
the following doesn't seem to serve as a good
What exactly is the question? Selecting/permuting rows?
M[sample(length=nrow(M), count), ]
Selecting/permuting columns?
M[ , sample(length=ncol(M), count) ]
Permuting elements?
structure(sample(M), dim=dim(M))
Selecting elements?
sample(M, count)
Gabor
On Thu, Jan 31, 2008 at 09:10:11PM
I mean
On Thu, Jan 31, 2008 at 02:32:20PM +0100, Gabor Csardi wrote:
What exactly is the question? Selecting/permuting rows?
M[sample(length=nrow(M), count), ]
M[sample(seq(length=nrow(M)), count), ]
Selecting/permuting columns?
M[ , sample(length=ncol(M), count) ]
M[ , sample(seq
You don't need root access to compile a program (in mose cases).
Just a compiler and enough space.
Gabor
On Thu, Jan 31, 2008 at 03:45:51PM -0500, Wensui Liu wrote:
I think the unix is SunOS.
the secret is I don't have root priviledge. ^_^. So is there a possibility?
Thanks.
On Jan 31,
?save
?load
Gabor
ps. although i'm not sure what an Rdata-project means, so maybe you
need something else
On Fri, Feb 01, 2008 at 08:24:32AM +0200, Atte Tenkanen wrote:
Dear R-users,
How do you save a big table or matrix as an independent object and attach it
to your Rdata-project when
Actually, you don't need apply. If there are no NA's then it is
very easy:
m[] - y[ col(m) ]
If you want to keep the NA's then it is a bit more tricky:
m[] - 0*m + y[ col(m) ]
G.
On Thu, Jan 31, 2008 at 07:03:51PM -0800, dxc13 wrote:
useR's,
Consider:
y - c(20, 25, 30)
m -
Derek,
the 0*m part zeros out everything in the matrix, expect for the NA's,
0*NA=NA by definition. If we add this to the y[ col(m) ] matrix, then
NA+anything=NA, but 0+anything=anything.
G.
ps. please answer to the list (as well)
On Fri, Feb 01, 2008 at 08:52:50AM -0500, Derek Cyr wrote:
On Mon, Feb 04, 2008 at 03:21:10PM +0800, Ng Stanley wrote:
Hi,
Given a test matrix, test - matrix(c(1,2,3,NA,2,3,NA,NA,2), 3,3)
A) How to compute the counts of each column (excluding the NA) i.e., 3, 2, 1
apply(test, 2, function(x) sum(!is.na(x)))
B) How to compute the counts of each
You almost got it right. THe solution is
df[df$ind %in% subgr,]
See ?%in%
G.
On Tue, Feb 05, 2008 at 04:47:02PM +0100, Karin Lagesen wrote:
Hi!
I have a large dataframe that I want to extract a subset from. This
subset has a certain column value that matches elements in a vector I
have
This is a religion question in some sense. Personally, i used
CVS and a bit Subversion too, but arch and bazaar look much better.
Especially if you're not always in online connection with the central
repository, or you don't really want a central repository at all.
Gabor
On Thu, Feb 07, 2008 at
It is a good idea to start with RSiteSearch(Excel)
G.
On Fri, Feb 08, 2008 at 03:49:29PM -0500, Christine Lynn wrote:
This is the most basic question ever...I haven't used R in a couple years
since college so I forget and haven't been able to find what I'm looking for
in any of the manuals.
sub(-, --, v, fixed=TRUE)
See ?sub.
Gabor
On Sun, Feb 10, 2008 at 02:14:48PM -0500, Michael Kubovy wrote:
Dear R-helpers,
How do I transform
v - c('insd-otsd', 'sppr-unsp')
into
c('insd--otsd', 'sppr--unsp')
?
_
Professor Michael Kubovy
University of
Because you need
test = 0.2 | test 0.3
See ?|
Gabor
On Mon, Feb 11, 2008 at 09:12:57PM +0800, Stanley Ng wrote:
That works beautfully. Why using test=0.2 || test 0.3 gives error ?
-Original Message-
From: Gabor Csardi [mailto:[EMAIL PROTECTED]
Sent: Monday, February 11, 2008
which(apply(test=0.2, 1, all))
See ?which, ?all, and in particular ?apply.
Gabor
On Mon, Feb 11, 2008 at 06:22:09PM +0800, Ng Stanley wrote:
Hi,
Given a simple example, test - matrix(c(0.1, 0.2, 0.1, 0.2, 0.1, 0.1, 0.3,
0.1, 0.1), 3, 3)
How to generate row indexes for which their
It should be possible i think. You just supply all the arguments via
'...' and then cut off the last one. I don't see why this wouldn't work,
but maybe i'm missing something.
Gabor
On Tue, Feb 12, 2008 at 12:58:25PM -0600, Erik Iverson wrote:
Alistair -
I don't believe this is possible. The
I assume that data$Roman is character.
data[order(as.numeric(as.roman(data$Roman))),] should do it. Maybe
data[order(as.roman(data$Roman)), ] is enough too.
Gabor
On Tue, Feb 12, 2008 at 10:36:50AM +, Luis Ridao Cruz wrote:
R-help,
I have a data frame with one column containing roman
data - data[ , !apply(is.na(data), 2, all)]
(or something like that)
G.
On Thu, Feb 14, 2008 at 12:59:46PM +, Martin Waller wrote:
Hi,
I guess this might be a FAQ or something, and there's probably a nice
simple way to do it, but I can't think of it:
Given a matrix, I want to
RSiteSearch is your friend. E.g.:
http://finzi.psych.upenn.edu/R/Rhelp02a/archive/63365.html
and then click on 'Next in thread a couple of times
Gabor
On Thu, Feb 14, 2008 at 03:23:30PM -0600, Edna Bell wrote:
Dear R Gurus:
How do you get source for functions which say UseMethod when
I don't know php very well, but perhaps you need
?sub
Gabor
On Fri, Feb 15, 2008 at 03:54:19PM +0100, Dong-hyun Oh wrote:
Dear expeRt,
I would like to know whether a function similar to str_replace() in
php exists in R.
Looking forward to hearing from you.
Best,
.. (Counting to ten.)
The package is called 'convert'. It seems that this package is not
on CRAN, however. I think you should ask the person whose code you're
running.
Gabor
On Mon, Feb 18, 2008 at 10:17:41AM +0100, Schmitt, Corinna wrote:
Hallo,
I am running R-2.6. on Windows. I
Update: it is a Bioconductor package, so you need to do:
source(http://bioconductor.org/biocLite.R;)
biocLite(convert)
Gabor
On Mon, Feb 18, 2008 at 10:17:41AM +0100, Schmitt, Corinna wrote:
Hallo,
I am running R-2.6. on Windows. I have a code which uses
library(convert). Can anyone tell
?RSiteSeach is useful. It gives you this:
http://tolstoy.newcastle.edu.au/R/e2/help/07/09/25536.html
and then keep clicking on Next in thread.
Gabor
On Tue, Feb 19, 2008 at 12:33:21PM +0100, Alfonso Pérez Rodríguez wrote:
Hello, I'm sure that this question is too simple, but, I'm begining
I think you need -l:
R CMD check -l your_library your_package
Gabor
On Tue, Feb 19, 2008 at 02:00:38PM -, john seers (IFR) wrote:
[...]
I think this is because I install my packages in mylibrary and use
R_LIBS=C:/PROGRA~1/R/mylibrary in my Renviron.site file. If I move the
package to the
igraph is a package for graphs and networks. It has a C core and
uses a simple and fast graph representation allowing millions
of vertices and edges.
NEW FEATURES:
- We use the ARPACK library for graph related eigenvalue problems,
like Page Rank calculation, Kleinberg's hub and authority
It depends what you mean by 'hiding', you can start the function
names with a dot and then they are not listed by ls(), so this
is kind of hiding.
.a - function() TRUE
ls()
character(0)
.a
function() TRUE
Personally i would not do this though.
G.
On Sat, Feb 23, 2008 at 11:58:57AM +0100,
Similar experience, with snow MPI (LAM). Actually, plug and play.
G.
On Sat, Feb 23, 2008 at 10:57:22AM -0700, Eric W Anderson wrote:
Hi Dan,
I've had pretty good luck using Snow with with Rpvm. It's definitely
not what you'd call plug and play, but it does work. I'm using it on
a
It's in the 'limma' Bioconductor package.
Next time you can try
help.search(lmFit)
RSiteSearch(lmFit)
Gabor
On Sun, Feb 24, 2008 at 01:02:41PM -0800, Keizer_71 wrote:
Hi Everyone,
I am trying to use lmFit function; however, i cannot find it function
anywhere.
I have been trying to
Simone, they are currently ignored. Just like edge direction.
Gabor
On Thu, Feb 28, 2008 at 03:17:24PM +0100, Simone Gabbriellini wrote:
hello,
I have a last question on cohesive blocks: if there are multiple links
between some nodes in the graph, this is taken into account by
cohesive
colSums gives you exactly what you want, but the vector is *named*.
You can use it like a not-named numeric vector, without much trouble.
If you still want to get rid of the names see ?unname
G.
On Fri, Feb 29, 2008 at 12:02:46PM -0500, Jason Horn wrote:
Does anyone know how to get a vector of
I believe that R can export all formats that GNUplot can produce,
so i don't really see why you want to use GNUplot if you don't know it.
If you still want to then read ?write.table, that can export your data
into a spreadsheet-like ascii format which can be used from GNUplot
easily.
Btw,
On Sat, Mar 01, 2008 at 12:54:56AM +0100, Louise Hoffman wrote:
If you still want to then read ?write.table, that can export your data
into a spreadsheet-like ascii format which can be used from GNUplot
easily.
Very interesting.
So if I e.g. write:
ts.sim - arima.sim(list(order =
I'm not a statistician, but do i remember well that among all
distributions with a given mean and variance, the normal distribution
has the highest entropy? This is good enough for me to call it
normal
Gabor
On Sun, Mar 02, 2008 at 10:10:21AM -0600, roger koenker wrote:
A nice survey of
R FAQ 7.31. G.
On Mon, Mar 03, 2008 at 12:52:43PM -0500, Xuejun Qin wrote:
Hi, there,
I cannot get accurate value for calculation.
for example:
ld-sqrt(1*0.05*0.95*0.05*0.95)
0.05*0.95-ld=-6.938894e-18
0.05*0.95-ld==0 is False.
I met this problem in my program, how can I handle it.
options(width=120)
See ?options
G.
On Tue, Mar 04, 2008 at 12:04:54PM +0100, Martin Kaffanke wrote:
Hi there!
I use an gnome-terminal for using R. When I resize the termial to the
maximum size, R uses only the left side of the window. Can I tell R to
use the whole window somehow?
On Tue, Mar 04, 2008 at 01:18:43PM +0100, Martin Kaffanke wrote:
Am Dienstag, den 04.03.2008, 12:34 +0100 schrieb Peter Dalgaard:
Martin Kaffanke wrote:
Hi there!
I use an gnome-terminal for using R. When I resize the termial to the
maximum size, R uses only the left side of the
Bingo!
See ?exists
G.
On Tue, Mar 04, 2008 at 04:38:31PM +0100, Paul Hammer wrote:
hi members,
give it a function for requesting if a object, matrix, vector, variable
or whatever already exists?
e.g. if (*exists*(a) {print(yes) } else { print(no) }
thanks
paul
On Wed, Mar 05, 2008 at 02:27:21AM -0500, Charilaos Skiadas wrote:
[...]
Btw, you will likely want to take the betweenness call out, and call
it once and store the result, instead of calling it twice (well,
assuming the graph is largish). Or even better, use which.max:
Mark, graph.adjacency always preserves the order of the vertices,
so the vertex at row/column 1 will be vertex #0 in the igraph graph,
etc. I'll document this in a minute.
This means that you can always do
g - graph.adjacency(A)
V(g)$name - colnames(A)
But i completely agree that this should
On Thu, Mar 06, 2008 at 06:54:41PM -0500, Charilaos Skiadas wrote:
On Mar 6, 2008, at 1:49 PM, Mag. Ferri Leberl wrote:
Dear everybody!
Is there a command in \LaTeX to display the R-Logo or has anybody
made it up?
Thank you in advance.
Isn't it just an image? Hence you would
Jean,
this is nice, but 1) the logo is a bitmap, it is ugly if you
resize it, 2) you don't need a pdf version for pdflatex, it
handles jpg (and maybe also png as well), so you can
just use the logos at the R developer site.
It would be really nice to have a non-bitmap version, though.
If it
Jean,
On Fri, Mar 07, 2008 at 06:09:35PM +0100, Jean lobry wrote:
Gabor,
this is nice, but
1) the logo is a bitmap, it is ugly if you resize it
Sure, it's a bitmap, but the naked eye resolution is only
100 $\mu$m so that a vectorized solution is overkilling
in most common situations
cumsum( mapply(function(i,j) sum(a$data[i:j]), x, y) )
Is this what you want?
Gabor
On Thu, Mar 13, 2008 at 06:02:13AM -0700, yoo wrote:
Hi all, i have the following..
a - data.frame(data = seq(1,10))
i have indices:
x - c(1, 5, 3, 9)
y - c(2, 7, 4, 10)
I want the cumsum of
You want to do
thing - list()# empty thing
for ( i in 1:100 ) {
thing[[i]] - ?
}
But where is ? coming from? If you can index it with an integer
then it is exactly coming from the kind of object you want to create.
Chicken-egg problem. No?
G.
On Thu, Mar 13, 2008 at 09:04:11AM
Use %in%:
x [ x %in% y ]
G.
On Fri, Mar 14, 2008 at 12:37:45PM +0200, Rainer M Krug wrote:
Hi
Consider the following code
x - rep(1:13, 13)
y - 1:3
I want to select all elements in x which are equal to 1, 2 or 3.
I know that I could use
sel - x==y[1] | x==y[2] | x==y[3]
keep - apply( DATA, 1, min ) = 100
DATA - DATA[ keep, ]
See ?apply for more.
Gabor
On Fri, Mar 14, 2008 at 01:26:49PM +, IAIN GALLAGHER wrote:
Hi list.
I have a numerical dataset 22,000 rows deep and 43 columns wide. I would like
to remove those rows which contain only values less
Try
temp[1,,drop=FALSE]
See ?[ for the explanation.
Gabor
On Fri, Mar 14, 2008 at 04:46:10PM -0400, Gregory Gentlemen wrote:
Hi fellow R-users,
I have run into a problem when trying to identify the number of rows in a
matrix. Say we have an arbitrary 5 by 5 matrix called temp:
temp -
On Sat, Mar 15, 2008 at 04:33:32PM +0100, Christophe Genolini wrote:
Hi the list
Is it possible to create an empty matrix ? I do not mean an matrix with
a single value that is NA (which is not empty) but a real empty one,
with length=0.
Sure:
matrix(nrow=0, ncol=5)
[,1] [,2] [,3]
First 'c' and then 'paste' with 'collapse':
paste(collapse=, c(c(a, b, c), d))
See ?paste
G.
On Mon, Mar 17, 2008 at 04:26:17PM +0530, Ajay Shah wrote:
How does one convert objects c(a,b,c) and d into abcd?
paste(c(a,b,c), d)
of course yields
[1] a d b d c d
--
Ajay Shah
What about reading the very last four lines of any email
you get from the list? Like this one.
G.
On Wed, Mar 19, 2008 at 12:09:29PM -0400, ablukacz wrote:
Dear All,
Can someone please give me instruction on how to unsubscribe from this
list. I do not have the original emial that arrived
On Wed, Mar 19, 2008 at 12:56:13PM -0700, jeffreya wrote:
Hi.
I'm looking to create a user-friendly program built around some R methods
I've written. The program should be as easy to install and use as possible
and will be built around a GUI. This program will be cross-platform; that's
If you do
help.search(download)
you find
?download.file
G.
On Thu, Mar 20, 2008 at 04:51:22PM -0500, gilbert feng wrote:
Hi, everyone
I want to download a XML webpage and save it as a file in my local machine.
Is there any way to do it in R?
Thanks a lot
Gilbert
Read R FAQ 7.31 ?
http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f
Gabor
On Fri, Mar 21, 2008 at 04:17:28PM +0100, John Lande wrote:
dear all,
I report a problem very simple, that I does non know how to handle.
look at the following code:
May i ask what was the problem with symbols()?
G.
On Sun, Mar 23, 2008 at 04:10:38AM -0700, ermimi wrote:
Thank you very much for the help!!!
Felix Andrews wrote:
help.search(circle)
should point you to grid.circle in the grid package, at least in my
R version 2.6.1 (grid
On Sun, Mar 23, 2008 at 11:06:05AM -0400, Mark Leeds wrote:
In an earlier post, a person wanted to divide each of the rows of
rawdata by the row vector sens so he did below but didn't like it and
asked if there was a better solution.
rawdata - data.frame(rbind(c(1,2,2), c(4,5,6)))
Baptiste,
the igraph ARPACK interface is quite experimental, and igraph includes
only the ARPACK files (converted to C) that it needs to calculate
some graph measures on sparse graphs. Btw. the development version
of igraph is a bit better in this respect, I can send you a link to
the
Maybe I'm missing something, but where is the 3D here?
My tip is hist3d in package rgl. But there might be others,
it might worth to search the archive, I remember seeing this
question once.
Gabor
On Fri, Jun 20, 2008 at 08:55:36AM -0400, Richardson, Patrick wrote:
Try
?hist
-and-
Nina, these are not row NUMBERS, but row NAMES. Numbers are actually
reset, they always start with 1 and they are continuous. Just try
doing
T[1,]
on your table. If you want to reset row names, you can do this:
rownames(T) - seq(length=nrow(T))
or you can even remove them:
rownames(T) -
Some clarifications.
R's license (GPL v2) is not about money,
you can charge anyone as much as you wish.
If you create an R program (and don't modify R itself), then
you can distribute that program according to any license you wish.
If you modify R itself _and_ distribute the modified
Hmmm, this is not very good:
Vec - c(10:1,1)
Vec[ table(Vec) == 1 ]
[1] 9 8 7 6 5 4 3 2 1
and these are obviously not the unique values.
This one is better:
Vec [ ! duplicated(Vec) ! duplicated(Vec, fromLast=TRUE) ]
Gabor
On Wed, Jun 25, 2008 at 11:29:31AM -0500, Marc Schwartz wrote:
I'm sorry to say, but this one is wrong, too.
Maybe coffee really helps, I just had one. :)
Vec - c(20:30,20)
which(table(Vec) == 1)
21 22 23 24 25 26 27 28 29 30
2 3 4 5 6 7 8 9 10 11
You would actually need the names, but that would involve
some numberic - character - numeric
Wow, that is smart, although is seems to be overkill.
I guess 'duplicated' is better than O(n^2), is it really?
Gabor
On Wed, Jun 25, 2008 at 05:43:30PM +0100, Prof Brian Ripley wrote:
On Wed, 25 Jun 2008, Marc Schwartz wrote:
on 06/25/2008 11:19 AM Daren Tan wrote:
unique(c(1:10,1))
Wanding,
I'm the maintainer of igraph, but missed your previous email.
Yes, currently the released version of igraph fails to compile
with gcc 4.3.x. I made the required modifications to fix this,
but these are still in the igraph development tree, as there has been
no release since that.
paste(sep=, graf, 1:250, .jpg)
See ?paste,
G.
On Mon, Jun 30, 2008 at 11:58:51AM -0300, Leandro Marino wrote:
Hi list,
I want to make a lot of graphics to my end course project. So, i was using
this sintax:
jpeg(filename = graf01.jpg, width = 1024, height = 1024,
units = px,
I think there are many simple solutions, here is one:
lapply(1:92, function(x) c(2*x-1, 2*x))
Gabor
On Tue, Jul 01, 2008 at 02:46:07PM +0200, Boks, M.P.M. wrote:
Dear experts,
For the makeGenotype function I need a list as in the example. However,
since my list needs to be 184 long there
A data frame is a special list:
d - data.frame( A=numeric(), B=logical(), C=character() )
lapply(d, class)
$A
[1] numeric
$B
[1] logical
$C
[1] factor
Gabor
On Tue, Jul 01, 2008 at 03:50:18PM +0200, Dong-hyun Oh wrote:
Dear UseRs,
I would like to know the way to find classes of each
If this is about more than a handful files, then it is really painful
to do it with OpenOffice.org or LyX, I guess.
You can use imagemagick, this is fairly standard on Linux. Then it is
something like this, assuming you have bash:
for f in *.png; do convert $f ${f%png}pdf; done
for f in *.jpg;
Ooops, please ignore my previous mail, I did not read the
question carefully enough.
Gabor
On Tue, Jul 08, 2008 at 02:27:51AM -0700, Mark Difford wrote:
Hi Daren,
Can R (out)do Emacs? I think you just need to ?Sweave a little.
Mark.
Daren Tan wrote:
I have a folder
E.g.
plot(1:10,1:10,xlab=NA)
title(xlab=expression(mu*mol/10^6* cells))
Gabor
On Wed, Jul 09, 2008 at 11:21:46AM +0200, Dani Valverde wrote:
Hello,
I am creating a plot and I would like to know how to put this expression
to the y axis
Why don't you write it for yourself, it takes less time than writing
an email:
mysummary - function(x) {
require(plotrix)
require(e1071)
c(Mean=mean(x), Std.Error=std.error(x), Std.Deviation=sd(x),
Kurtosis=kurtosis(x))
}
Gabor
On Wed, Jul 09, 2008 at 08:15:00AM -0700, nmarti wrote:
It is called 'rev', see ?rev.
rev(1:10)
[1] 10 9 8 7 6 5 4 3 2 1
G.
On Thu, Jul 10, 2008 at 01:56:58PM +0200, Zroutik Zroutik wrote:
Dear R-users,
I'd like to turn a vector so it starts with it's end. For better
understanding, this set of commands will do what I need:
i -
I'm sure this is possible with 'network', but i'm not very familiar
with that package. In case you don't get an answer on how
to do it with network, here is how to do it with the 'igraph' package:
library(igraph)
M - matrix(runif(100)*2-1, 10, 10)
M[ lower.tri(M, diag=TRUE) ] - 0
M[ abs(M)
the names in
the nodes of the graph (currently it just shows the row number)?
Your help is much appreciated
Kind regards
Jonathan
-Original Message-
From: Gabor Csardi [mailto:[EMAIL PROTECTED]
Sent: 11 July 2008 14:33
To: Dry, Jonathan R
Cc: r-help@r-project.org
Subject: Re: [R
(gdata2)$name
Error in `V-`(`*tmp*`, value = 0:9) : invalid indexing
gdata2
Vertices: 10
Edges: 4
Directed: FALSE
Edges:
[0] 1 -- 5
[1] 2 -- 6
[2] 3 -- 7
[3] 4 -- 7
-Original Message-
From: Gabor Csardi [mailto:[EMAIL PROTECTED]
Sent: 11 July 2008 14:54
Maybe there is a simpler way, but this works fine:
l1 - 1
l2 -2
m -10
ls()
[1] l1 l2 m
rm(list=grep(^l.*, ls(), value=TRUE))
ls()
[1] m
You can supply a regular expression to grep.
Gabor
On Mon, Jul 14, 2008 at 10:45:13AM +0200, Oehler, Friderike (AGPP) wrote:
Dear Rusers,
how can
Hmmm, I did not follow this thread closely, sorry for that,
just want to share my 2c.
If it is about quality, then I create EPS files and use the
psfrag latex package to replace the PS fonts with TeX's fonts.
This has the following advantages:
1) The figures have the same font as the text
On Wed, Jul 16, 2008 at 04:48:28AM -0500, Gabor Csardi wrote:
[...]
I have a little script that automates this for .fig files (this is
based on figtex, another script that I found somewhere online and
can't find it any more)
[...]
Ok, it is called figfrag, and it is on CTAN
Senthil,
you can try the 'igraph' package. Export your two-column Excel file
as a .csv, use 'read.csv' to read that into R, then 'graph.data.frame'
to create an igraph graph from it. Finally, call 'betweenness' on
the graph. It is really just three/four lines, something like this:
tab -
-Original Message-
From: Gabor Csardi [mailto:[EMAIL PROTECTED]
Sent: Monday, July 21, 2008 1:57 AM
To: Senthil Purushothaman
Cc: jim holtman; r-help@r-project.org
Subject: Re: [R] Calculating Betweenness - Efficiency problem
Senthil,
you can try the 'igraph' package. Export
is smaller than 2 _AND_ larger than 3,
at least if we consider the usual ordering on numbers.
Best,
Gabor
[...]
--
Csardi Gabor [EMAIL PROTECTED]UNIL DGM
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do
On Thu, Jul 24, 2008 at 09:30:54AM -0700, Nordlund, Dan (DSHS/RDA) wrote:
[...]
a - c(rep(seq(1,4),4),NA,NA)
b - c(rep(seq(1,2),7),NA,NA,1,2)
Andreas,
what is wrong with
a[ (a 2 | a 3) b==1 ] - NA
? Isn't this what you want?
[...]
As I mentioned in my response
On Thu, Jul 24, 2008 at 10:39:34AM -0700, Nordlund, Dan (DSHS/RDA) wrote:
[...]
Yes, it does help. I was misunderstanding how logical values are
used for indexing. I assumed incorrectly that a value would be
returned only if the index expression evaluated as TRUE. It would
seem that the
Yes, it is exactly 'apply', and its friends. E.g. you can collect the
objects into a list and then do
sapply(mylist, is.matrix)
G.
On Wed, Apr 09, 2008 at 11:52:08AM -0400, Mon Mag wrote:
I would like to apply a simple function, like
is.matrix
to more than one data.frame
How can I call on
On Mon, Apr 14, 2008 at 08:32:55PM +0800, Ng Stanley wrote:
Hi,
Two questions:
A) Assuming OB is an object, how do I store 20 of OB in a vector or list ?
replicate(20, OB, simplify=FALSE)
B) Does R has something similar associative array to Perl ? For example,
%our_friends = ('best',
On Mon, Apr 14, 2008 at 09:47:49PM +0800, Ng Stanley wrote:
Hi,
Two questions:
A) I need to initialize many variables to NULL. So I created variable_names
- c(a1, a2). What can I do to variable_names so that variable a1 is
NULL and a2 is NULL ?
for (n in variable_names) assign(n, NULL)
)
Error in RG[[ABC]] - c(a, b) :
more elements supplied than there are to replace
On Mon, Apr 14, 2008 at 9:53 PM, Gabor Csardi [EMAIL PROTECTED] wrote:
On Mon, Apr 14, 2008 at 09:47:49PM +0800, Ng Stanley wrote:
Hi,
Two questions:
A) I need to initialize many variables
I'm sure you'll get a friendlier answer, but... see
?=
?==
Introduction to R
G.
On Tue, Apr 15, 2008 at 05:28:53AM -0700, Linn wrote:
Hi
Could anyone please explain to me the difference between the = and the ==?
I'm quite new to R and I've tried to find out but didn't get any wiser...
next
break
Another 'Introduction to R', or even ?for question
G.
On Fri, Apr 18, 2008 at 04:55:01PM +0800, Ng Stanley wrote:
Hi,
Is there any function to skip a loop in a for loop ?
Thanks
Stanley
[[alternative HTML version deleted]]
Hmm, my understanding is different,
m - matrix(sample(10*10), ncol=10)
m2 - rbind( m[1:5,], 1:10, m[6:10,] )
m3 - cbind( m[,1:8], 1:10, m[,9:10] )
G.
On Sun, Apr 20, 2008 at 10:21:47AM -0300, Henrique Dallazuanna wrote:
If I understand:
m - matrix(sample(10*10), ncol=10)
m[5:6, 8:9] - 1:4
On Sun, Apr 20, 2008 at 08:16:11PM +, David Winsemius wrote:
Gabor Csardi [EMAIL PROTECTED] wrote in
news:[EMAIL PROTECTED]:
Hmm, my understanding is different,
m - matrix(sample(10*10), ncol=10)
m2 - rbind( m[1:5,], 1:10, m[6:10,] )
m3 - cbind( m[,1:8], 1:10, m[,9:10] )
I
On Mon, Apr 21, 2008 at 12:50:08PM +, David Winsemius wrote:
[...]
Am I correct in assuming that after the creation of m by way of a
temporary matrix that the temporary matrix would then be available for
garbage collection, whereas if both m and m2 were created, there would
be more
1 - 100 of 147 matches
Mail list logo