similar to: Dummy newbie question

Displaying 20 results from an estimated 10000 matches similar to: "Dummy newbie question"

2007 Oct 16
1
Chronological data manipulation question
Hi all, I currently work on a survey which contains biographical data stored in a chronological way, ie something like : id year variable 001 2000 0 001 2001 0 001 2002 1 001 2003 0 002 1996 0 002 1997 0 002 1998 1 002 1999 0 002 2000 0 where id is a person identifier, year the year of observation and variable the
2005 Feb 09
6
randomisation
Dear useRs I am looking for a way to randomise the values within a matrix: the conditions are that the sums of the rows and the sums of the columns should remain the same as in the original matrix. Any help would be appreciated Cheers Yann
2007 Feb 25
3
If you had just one book on R to buy...
Hi, I am starting a new job as a study analyst for a social science research unit. I would really like to use R as my main tool for data manipulation and analysis. So I'd like to ask you, if you had just one book on R to buy (or to keep), which one would it be ? I already bought the Handbook of Statistical Analysis Using R, but I'd like to have something more complete, both on the
2008 Jan 24
3
store variable as tab-del. txt-file
Hallo, how can I store a variable as a tab-delimited txt-file? I crated a variable with the following commands: > fit12<-lmFit(qrg[,1:2]) > t12<-toptable(fit12,adjust="fdr",number=25,genelist=qrg$genes[,1]) > t12 ID logFC t P.Value adj.P.Val B 522 PLAU_OP -6.836144 -8.420414 5.589416e-05 0.01212520 2.054965 1555 CD44_WIZ -6.569622
2006 May 06
7
New Ajax and Rails tutorial
Hi, I just published the first version of a small tutorial I''ve written on Ajax and Rails. It is called "How to paginate, sort and search a table with Ajax and Rails" (sorry, I didn''t manage to find a longer title !) and is available at : http://dev.nozav.org/rails_ajax_table.html There is nothing really new in it, it''s rather a compilation and
2008 Apr 17
2
CRAN packages hosting policy
Hi to all, I recently created a small package which contains some simple R functions in order to help students in my research unit to use R. The package is pure R, it passes R CMD check, but it is really designed for internal use and, moreover, it is entirely documented in french. Is it possible to upload and to host this kind of package to CRAN ? Or is it better, as it is quite a private tool
2010 Sep 27
1
stacked area chart
Dear R-ers! Asking for your help with building the stacked area chart for the following simple data (several variables - with date on the X axis): ### Creating a data set my.data<-data.frame(date=c(20080301,20080402,20080503,20090301,20090402,20090503,20100301,20100402,20100503), x=c(1.1,1.0,1.6,1,2,1.5,2.1,1.3,1.9),y=c(-4,-3,-6,-5,-7,-5.2,-6,-4,-4.9),
2007 Jul 07
2
random sampling with some limitive conditions?
I want to gain thousands of random sampling data by randomizing the presence-absence data. Meantime, one important limition is that the row and column sums must be fixed. For example, the data "tst" is following: site1 site2 site3 site4 site5 site6 site7 site8 1 0 0 0 1 1 0 0 0 1 1 1 0 1 0 1 1 0 0 0 1 0 1 0 0 0 0 1 0 1 0 1 1 0 1 0 0 0 0 0 0 1 0 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 1 0 1 0
2008 Dec 08
1
French IRC channel and mailing list ?
Dear all, For some time now, R is becomming more and more popular in more and more countries. France is for sure one of them, but french people being french one of the obstacle they might tackle is the lack of documentation and support in their native language. To offer this support in french an IRC channel (#Rfr on irc.freenode.net) was created some months ago, beside the official english
2010 Nov 28
4
how to divide each column in a matrix by its colSums?
Hi, I have a matrix, say m=matrix(c( 983,679,134, 383,416,84, 2892,2625,570 ),nrow=3 ) i can find its row/col sum by rowSums(m) colSums(m) How do I divide each row/column by its rowSum/colSums and still return in the matrix form? (i.e. the new rowSums/colSums =1) Thanks. Casper -- View this message in context:
2005 Apr 21
1
colSums and rowSums with arrays - different classes and dim ?
Hi, I'm using colSums and rowSums to sum the first dimensions of arrays. It works ok but the resulting object is different. See > a3d <- array(rnorm(120, mean=2), dim=c(20,6,1)) > dim(colSums(a3d)) [1] 6 1 > dim(rowSums(a3d)) NULL > class(colSums(a3d)) [1] "matrix" > class(rowSums(a3d)) [1] "numeric" I was expecting rowSums to preserve the array
2009 Nov 30
2
command similar to colSums for rowSums?
Working with an NxMxO sized matrix, currently I can do this in my code: if (max(colSums(array)) >= number) But to get an equivalent result using rowSums, I have to do: for (i in 1:10) { if (max(rowSums(array[,,i])) >= number) } I'm running both in a much larger loop that loops millions of times, so speed and such is quite a big factor for me. Currently, the colSums line uses about
2002 Aug 14
3
t-test via matrix operations
I need to calculate a large number of t statistics, and would like to do so via matrix operations. So far I have figured out a way to calculate the mean of each row of the matrix: d <- matrix(runif(100000,1,10), 1000, 10) # some test data s <- rep(1,ncol(d)) # a sum vector to use for matrix multiplication means <- (d%*%s)/ncol(d) This is at least 1 order of magnitude faster than
2010 Oct 04
1
adding a legend to the plot (but outside of it)
Hello! My code below creates a data frame and a plot for it. However, I can't figure out how to add a legend that is not ON the plot itself, but outside of it (e.g., to the right of my graph or below it). I tried something: I put a line par(xpd=T, mar=par()$mar+c(0,0,0,4)) right before my plot command), but that screwed up all my gridlines - they covered all graph and do not coincide with
2010 Dec 02
1
Arrange elements on a matrix according to rowSums + short 'apply' Q
Greetings, My goal is to create a Markov transition matrix (probability of moving from one state to another) with the 'highest traffic' portion of the matrix occupying the top-left section. Consider the following sample: inputData <- c( c(5, 3, 1, 6, 7), c(9, 7, 3, 10, 11), c(1, 2, 3, 4, 5), c(2, 4, 6, 8, 10), c(9, 5, 2, 1, 1) ) MAT <- matrix(inputData,
2010 Oct 04
1
reducing distances between tickmarks
Hello, everybody! I have a code below that creates a data set and then a stacked bar chart based on that data set. No need to look at it - just notice please that my horizontal axis is a date varible (x=my.data$date). I have a question about the last 2 lines of this code: grid(nx=NULL,ny=NULL,col = "lightgray", lty = "dotted",lwd = par("lwd")) axis(1, las = 2) Could
2008 Dec 16
1
Introduction to R (in french)
Hi all, I recently put a new version of my french introduction to R online. It is more specifically targeted at social sciences students and researchers, but could be interesting for beginners who are not really familiar with statistics and coding. The document is available (in french) in PDF, as well as the Sweave source code, from the following page : http://alea.fr.eu.org/j/intro_R.html
2008 Apr 28
2
X11 window title setting in X11() Device (PR#11325)
--=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, I think I have found a very little bug in the new version of the X11() device in R 2.7.0, more precisely in the devX11.c file. The problem is that when you open a new window with X11(), the title of the window (the WM_NAME property) is not immediately set. It seems that the window is created, then it
2007 Apr 16
1
colSum() in Matrix objects
Hi, I'd like to simply add column-wise using Matrix objects (Csparse). It looks like one can apply mosty any base function to these objects (i.e., apply, colSums), but there is a nasty conversion to traditional matrix objects if one does that. Is there any workaround? I can see colSum listed in the help for Class 'CsparseMatrix' , but I wonder whether I'm using the default
2007 Apr 13
2
Two basic data manipulation questions (counting and aggregating)
Dear R users, I hav two basic data manipulations questions that I can't resolve. My data is a data frame which look like the following : id type 10002 "7" 10061 "1" 10061 "1" 10061 "4" 10065 "7" 10114 "1" 10114 "1" 10114 "4" 10136 "7" 10136 "2" 10136 "2" First, I