Re: [R] Get a percent variable based on group

2013-01-16 Thread arun
Hi, Is it this? aggregate(iris$Sepal.Length,by=list(iris$Species),FUN=function(x) sum(x)/sum(iris$Sepal.Length)*100) Group.1    x 1 setosa 28.55676 2 versicolor 33.86195 3  virginica 37.58129 A.K. From: Karine Charlebois

[R] matrix manipulation with its rows

2013-01-16 Thread Kathryn Lord
Dear R users, I have a question about matrix manipulation with its rows. Plz see the simple example below sample - list(matrix(1:6, nr=2,nc=3), matrix(7:12, nr=2,nc=3), matrix(13:18,nr=2,nc=3)) sample [[1]] [,1] [,2] [,3] [1,]135 [2,]246 [[2]] [,1] [,2]

[R] dendrogram stops!

2013-01-16 Thread Ibrahim Sobh
Dear I am using the 'as.dendrogram' function from the 'stats' library to convert from an hclust object to a dendrogram with a dataset of size ~3 (an example code is below). I need the dendrogram structure to use the dendrapply and attributes functions and to access the child nodes, I do

Re: [R] dendrogram stops!

2013-01-16 Thread Milan Bouchet-Valat
Le mercredi 16 janvier 2013 à 07:29 +0200, Ibrahim Sobh a écrit : Dear I am using the 'as.dendrogram' function from the 'stats' library to convert from an hclust object to a dendrogram with a dataset of size ~3 (an example code is below). I need the dendrogram structure to use the

Re: [R] Can not load Rcmdr

2013-01-16 Thread Milan Bouchet-Valat
Le mardi 15 janvier 2013 à 22:49 +, Esformes, Carley M. a écrit : I am getting the error message: library(Rcmdr) Loading required package: car Loading required package: MASS Loading required package: nnet Error : .onAttach failed in attachNamespace() for 'Rcmdr', details:

[R] Aligning labels to bars in barplot

2013-01-16 Thread David Arnold
Hi, Consider: x=c(2,4,5,10,13,73) names(x)=c(American\nIndian, No\ncategory\nlisted, Hispanic, African-\nAmerican, Asian, White) barplot(x,main=Undergraduate Enrollment by Race, xlab=Race, ylab=Percent,

[R] function approx interpolation of time series data sets

2013-01-16 Thread e-letter
Readers, Am trying to use the function 'approx' to interpolate time series data sets: data1: 01:23:40 5 01:23:45 10 01:23:50 12 01:23:55 7 data2: 01:23:42 01:23:47 01:23:51 01:23:54 The objective is to obtain interpolated values of 'data1' column 2 (5, 10, 12, 7) for the times shown in data2.

Re: [R] Aligning labels to bars in barplot

2013-01-16 Thread Jim Lemon
On 01/16/2013 07:48 PM, David Arnold wrote: Hi, Consider: x=c(2,4,5,10,13,73) names(x)=c(American\nIndian, No\ncategory\nlisted, Hispanic, African-\nAmerican, Asian, White) barplot(x,main=Undergraduate Enrollment by Race,

Re: [R] matrix manipulation with its rows

2013-01-16 Thread PIKAL Petr
Hi with your specific example you can use remat-function(mat) { mt-t(mat) mt-c(mt[1:3], rep(0,6), mt[4:6]) matrix(mt, 2,6, byrow=TRUE) } lapply(sample, remat) Regards Petr -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of

Re: [R] matrix manipulation with its rows

2013-01-16 Thread Patrick Burns
Not a great solution, I don't think, but: kronecker(diag(2), matrix(1:6, 2, byrow=TRUE))[c(1,4),] [,1] [,2] [,3] [,4] [,5] [,6] [1,]123000 [2,]000456 So using a function that does this in 'lapply' should solve the problem you state. I'm

[R] Overplotting in GGPLOT

2013-01-16 Thread Nick Duncan
Dear All, I am struggling to jitter the labels in this plot: p-ggplot(centbev,aes(x=bet,y=eig,label=rownames(centbev),colour=res, size=abs(res)))+xlab(Betweenness Centrality)+ylab(Eigenvector Centrality) p+geom_text()+labs(title=Key Actor Analysis AD FD Network) When I try this without

Re: [R] function approx interpolation of time series data sets

2013-01-16 Thread Rui Barradas
Hello, Like this? data1 - read.table(text = 01:23:40 5 01:23:45 10 01:23:50 12 01:23:55 7 ) data2 - read.table(text = 01:23:42 01:23:47 01:23:51 01:23:54 ) approx(as.POSIXct(data1$V1, format = %H:%M:%S), y = data1$V2, xout = as.POSIXct(data2$V1, format = %H:%M:%S)) Hope this helps,

Re: [R] removing loops from code in making data.frame

2013-01-16 Thread Biau David
thanks, it goes a lot faster. Just one thing though, when I apply the code to my data, both data.frames end up differente. Or at least identical(df1, df2) if false however when i do which(df1!=df2) it says 'integer (0)'. Could that be due to the class of the vectors or some thing of the sort?

[R] read tab delimited file from a certain line

2013-01-16 Thread Christof Kluß
Hi I would like to read table data from a text-files with extra informations in the header (of unknown line count). Example: informations (unknown count of lines) ... and at some point the table -- year month mday value 2013 1 16 0 ... If it was an excel

Re: [R] Using table to get frequencies of several factors at once

2013-01-16 Thread S Ellison
You could use a variant of apply(), probably sapply For example d - as.data.frame( matrix(sample(0:1, 200, replace=TRUE), ncol=5)) head(d) sapply(d, table) S Ellison -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Pancho

Re: [R] Codetools Query (repost)

2013-01-16 Thread luke-tierney
You really don't want to use internals like isBaseVar as there is no guarantee they will continue to exist. Even collectUsage and otehr things mentioned on the same page may need to change if this is reimplemented. The most robust approach is to use findGlobals and omit what you don't want,

[R] Mean calculation by two variables

2013-01-16 Thread Raoni Rodrigues
Hello All, I have a data frame (dput information below) with food item weight for fish species. I need to calculate the Mean proportion by weight of each food item for each specie, as show in solution data frame (dput information below). I use the ddply function (plyr package) in two steps.

[R] Changing frequency values to 1 and 0

2013-01-16 Thread Andrea Goijman
Dear list, I'm working with a large data set, where I grouped several species in one group (guild). Then I reshaped my data as shown below. Now, I just want to have Rep only as 1 or 0. I'm not being able to change the values of rep=1 to 1... tried many things and I'm not being successful!

Re: [R] read tab delimited file from a certain line

2013-01-16 Thread Rui Barradas
Hello, Read the file using readLines, then grep ^year. You can then use a textConnection to read.table: x - readLines(con = textConnection( informations (unknown count of lines) ... and at some point the table -- year month mday value 2013 1 16 0 )) # This is it i - grep(^year, x)

Re: [R] Mean calculation by two variables

2013-01-16 Thread Rui Barradas
Hello, If you want to calculate the mean weight by Specie and Food.item, you can use ?aggregate. In what follows, I've named your EXAMPLE ex and your SOLUTION sol. Note that the result is different from sol. (No exemplo não há Peixe, é Fish, e os números são outros.) aggregate(Weight ~ Specie

Re: [R] Changing frequency values to 1 and 0

2013-01-16 Thread Jessica Streicher
Sorry, but i don't get the problem at all. Could you provide a bit of y by using dput()? Can you provide an example of how you want the data to look like after the transformation? On 16.01.2013, at 16:42, Andrea Goijman wrote: Dear list, I'm working with a large data set, where I grouped

Re: [R] Changing frequency values to 1 and 0

2013-01-16 Thread Jose Iparraguirre
Dear Andrea I may have not understood the question properly, but I guess it has to do with replacing values before and after casting. The molten object ('melting') is a data frame, whilst the cast object ('y') is an array. Crucially, the values of the variable Rep in the 'melting' data

Re: [R] Changing frequency values to 1 and 0

2013-01-16 Thread Andrea Goijman
Sure! Although I'm not sure how to use dput() Here is more detail and some data what I want is that the repetitions in Y (at the end) only have 1 or 0... library(reshape) library(car) ###Read in the occurence data occ.data - read.table(Occ_short.csv, header=TRUE,sep=,,na.strings=TRUE)

Re: [R] Recursive file Download from FTP

2013-01-16 Thread Peter Maclean
I want to download and unzip many files from the FTP and create variables for year, month, and day for each file based on the naming mechanism. I am stack with the following lines and any help will be appreciated.   library(RCurl) # Download the files for 1985. url =

Re: [R] removing loops from code in making data.frame

2013-01-16 Thread arun
Hi, In my first solution, you would get FALSE for identical(res,tutu) if you don't convert `res` columns to numeric. Both res1, and tutu were matrix.  You can check the column class by:   apply(res1,2,class) Also try:  all.equal(res1,tutu) #[1] TRUE A.K.

[R] How to change levels?

2013-01-16 Thread paladini
Hello! I have got a dataframe with 10 columns and 100 rows. The seventh column consists of a lot of country names. When I use newdata=subset(data, data[, 7]==United Kingdom|data[, 7]==Germany) I get just the rows where the country name is UK or Germany. But the level information doesn`t

Re: [R] matrix manipulation with its rows

2013-01-16 Thread arun
HI, You could also do this:  lapply(sample1,function(x) {mat1-cbind(matrix(0,nrow=2,ncol=3),x); mat1[cbind(rep(1,3),1:3)]- mat1[cbind(rep(1,3),4:6)]; mat1[cbind(rep(1,3),4:6)]-0; mat1}) A.K. - Original Message - From: Kathryn Lord kathryn.lord2...@gmail.com To: r-help@r-project.org

Re: [R] random effects model

2013-01-16 Thread rex2013
Hi I tried removing the missing values and installing plyr. Still error message appears with ggplot2 Btw, did you get the attachments with my earlier mail? Ta. On Wed, Jan 16, 2013 at 3:16 AM, arun kirshna [via R] ml-node+s789695n4655612...@n4.nabble.com wrote: Hi, Check these links:

[R] setting the legend scale in contour plots

2013-01-16 Thread Sarah Magozzi
Hi, I'd like to compare SST data for year 2000 with SST for year 2001. I managed to get filled contour plots showing monthly SST for both years (12 plots for each year, 24 plots in total). In order to compare year 2000 and year 2001, however, I'd need to have the same legend scale (same color

[R] Help with a parallel process

2013-01-16 Thread David Zamora Ávila
Hi R-Core, i am using nnet and DEoptim, Xcc=matrix(rnorm(100,0.5,0.08),50,2) Ycr=matrix(rnorm(50,0.2,0.05),50,1) pred_regm1 - function(A) { A1=A[1] A2=A[2] A3=A[3] regm1 - nnet(Xcc,Ycr,entropy=T,size=A1,decay=A2,maxit=2000,trace=F,Hess=T,rang=A3,skip=T)

[R] Problems regarding the package BRugs

2013-01-16 Thread moumita chatterjee
Respected Sir, With reference to my mail to you dated 8th January,2013, and the reply by you dated 9th January, 2013, I am sending this mail to you. I had a problem regarding running a program in the latest version of the BRugs package in R 2.15.1 and 2.15.2. I want to mention

[R] How to cut the time format short

2013-01-16 Thread Yuan, Rebecca
Hello all, I have a time format looks like 31JAN2002:00:00:00.000 How could I cut it to 31JAN2002 ? I tried with format() but not work. Thanks, Rebecca -- This message, and any attachments, is for the intended

[R] R and Windows 8

2013-01-16 Thread Claire Oswald
Hello: I'd like to know if R will run under Windows 8? Thank you, CJO [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] R and Windows 8

2013-01-16 Thread Duncan Murdoch
On 13-01-16 11:06 AM, Claire Oswald wrote: Hello: I'd like to know if R will run under Windows 8? As far as I know, it has not been tested there. Duncan Murdoch __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] How to change levels?

2013-01-16 Thread Ista Zahn
Hi, see ?droplevels and/or the stringsAsFactors section of ?options Best, Ista On Wed, Jan 16, 2013 at 4:56 AM, paladini palad...@beuth-hochschule.de wrote: Hello! I have got a dataframe with 10 columns and 100 rows. The seventh column consists of a lot of country names. When I use

Re: [R] R and Windows 8

2013-01-16 Thread Gabor Grothendieck
On Wed, Jan 16, 2013 at 11:06 AM, Claire Oswald claire.j.osw...@gmail.com wrote: Hello: I'd like to know if R will run under Windows 8? I am running R on Windows 8 with no apparent problems. -- Statistics Software Consulting GKX Group, GKX Associates Inc. tel: 1-877-GKX-GROUP email:

Re: [R] Aligning labels to bars in barplot

2013-01-16 Thread David Arnold
Nice, worked very well. But because of the realignment, I now need to lower by xlab a bit. Any suggestions? David. -- View this message in context: http://r.789695.n4.nabble.com/Aligning-labels-to-bars-in-barplot-tp4655701p4655749.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] read tab delimited file from a certain line

2013-01-16 Thread arun
Lines1 - readLines(con = textConnection( informations (unknown count of lines) ... and at some point the table -- year month mday value 2013 1 16 0 ))   indx-seq(match(regmatches(Lines1,regexpr(^year.*,Lines1)),Lines1),length(Lines1)) read.table(text=Lines1[indx],sep=,header=TRUE) #  year

Re: [R] Changing frequency values to 1 and 0

2013-01-16 Thread arun
Hi, May be this helps you. source(Andreadata.txt)  head(occ.data)  melting- melt(occ.data,id.var=c(Point, Site, Rep, Año),measure.var=Pres)  y-cast(melting,Site~Rep~Point~Año)  dim(y) #[1] 10  5 25  6 y[,,25,6] #  Rep #Site   1 2 3 4 5  # 1021 0 0 0 0 0  # 1022 0 0 0 0 0  # 1051 0 0 0 0 0  

Re: [R] Changing frequency values to 1 and 0

2013-01-16 Thread Andrea Goijman
Thanks!! that should work!! On Wed, Jan 16, 2013 at 1:03 PM, arun smartpink...@yahoo.com wrote: HI, Saw ur post in Nabble. occ.data-read.table(text= Año Punto Especie Pres Ruta_com Point Site Rep guild 1 201230TYSA1 10830 1086 5 OTHER 2 201226VACH1

Re: [R] Changing frequency values to 1 and 0

2013-01-16 Thread arun
HI, Saw ur post in Nabble. occ.data-read.table(text= Año Punto Especie Pres Ruta_com Point Site Rep guild 1  2012    30    TYSA    1  108    30 1086   5 OTHER 2  2012    26    VACH    1  108    26 1086   1 OTHER 3  2012    27    VACH    1  108    27 1086   2 OTHER 4  2012    26   

Re: [R] How to cut the time format short

2013-01-16 Thread S Ellison
I have a time format looks like 31JAN2002:00:00:00.000 How could I cut it to 31JAN2002 You have several options depending on what form the data are in. Assuming it is character data, you could use substr: substr(31JAN2002:00:00:00.000, 1, 9) or gsub: gsub((.{9}).+, \\1,

Re: [R] R and Windows 8

2013-01-16 Thread Prof Brian Ripley
On 16/01/2013 16:06, Claire Oswald wrote: Hello: I'd like to know if R will run under Windows 8? We have students running it under Windows 8, 32- and 64-bit OS. -- Brian D. Ripley, rip...@stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/

Re: [R] Log scale on y axis of parallel coordinate plot (lattice)

2013-01-16 Thread Patrick Connolly
On Mon, 07-Jan-2013 at 10:21PM +1100, Roland Seubert wrote: | Hello all, | | I would like to make a parallel coordinate plot with lattice. The | plot should have vertical log scale axes, and should in principle | look like this one (I put less chemical elements in my example | below): | |

Re: [R] R and Windows 8

2013-01-16 Thread Leandro Marino
I'm using R 64 in Win8 64 without problems. Only the StatET plugin for eclipse is not working. 2013/1/16 Prof Brian Ripley rip...@stats.ox.ac.uk On 16/01/2013 16:06, Claire Oswald wrote: Hello: I'd like to know if R will run under Windows 8? We have students running it under Windows 8,

Re: [R] How to cut the time format short

2013-01-16 Thread Yuan, Rebecca
Hello Ellison, Thanks very much! I use the substr() and it works! Have a great day! Cheers, Rebecca -Original Message- From: S Ellison [mailto:s.elli...@lgcgroup.com] Sent: Wednesday, January 16, 2013 1:35 PM To: Yuan, Rebecca; R help Subject: RE: How to cut the time format short

Re: [R] Problems regarding the package BRugs

2013-01-16 Thread Uwe Ligges
On 16.01.2013 12:13, moumita chatterjee wrote: Respected Sir, With reference to my mail to you dated 8th January,2013, and the reply by you dated 9th January, 2013, I am sending this mail to you. I had a problem regarding running a program in the latest version of the

Re: [R] configure/build R on Windows

2013-01-16 Thread Uwe Ligges
On 15.01.2013 22:24, Beto . wrote: Hello, Does anyone knows if there is a Documentation or any wiki that could help me to configure and build R using cygwin with the Intel Compilers on Windows? No, cygwin is an unsupported platform. Best, Uwe Ligges Thanks, Humberto.

Re: [R] Help with a parallel process

2013-01-16 Thread Uwe Ligges
On 16.01.2013 17:13, David Zamora Ávila wrote: Hi R-Core, i am using nnet and DEoptim, Xcc=matrix(rnorm(100,0.5,0.08),50,2) Ycr=matrix(rnorm(50,0.2,0.05),50,1) pred_regm1 - function(A) { A1=A[1] A2=A[2] A3=A[3] regm1 -

Re: [R] setting the legend scale in contour plots

2013-01-16 Thread Uwe Ligges
On 16.01.2013 12:00, Sarah Magozzi wrote: Hi, I'd like to compare SST data for year 2000 with SST for year 2001. I managed to get filled contour plots showing monthly SST for both years (12 plots for each year, 24 plots in total). In order to compare year 2000 and year 2001, however, I'd need

Re: [R] configure/build R on Windows

2013-01-16 Thread peter dalgaard
On Jan 16, 2013, at 20:24 , Uwe Ligges wrote: On 15.01.2013 22:24, Beto . wrote: Hello, Does anyone knows if there is a Documentation or any wiki that could help me to configure and build R using cygwin with the Intel Compilers on Windows? No, cygwin is an unsupported platform.

Re: [R] Log scale on y axis of parallel coordinate plot (lattice)

2013-01-16 Thread ilai
On Wed, Jan 16, 2013 at 12:05 PM, Patrick Connolly p_conno...@slingshot.co.nz wrote: On Mon, 07-Jan-2013 at 10:21PM +1100, Roland Seubert wrote: | Hello all, | | I would like to make a parallel coordinate plot with lattice. The | plot should have vertical log scale axes, and should in

Re: [R] configure/build R on Windows

2013-01-16 Thread Uwe Ligges
On 16.01.2013 20:44, peter dalgaard wrote: On Jan 16, 2013, at 20:24 , Uwe Ligges wrote: On 15.01.2013 22:24, Beto . wrote: Hello, Does anyone knows if there is a Documentation or any wiki that could help me to configure and build R using cygwin with the Intel Compilers on Windows?

Re: [R] Log scale on y axis of parallel coordinate plot (lattice)

2013-01-16 Thread ilai
On Wed, Jan 16, 2013 at 12:46 PM, ilai ke...@math.montana.edu wrote: Oops... That's require(latticeExtra) c(parallelplot(~ df_n, horizontal.axis = FALSE, scales=list(x = list(log = TRUE))) , parallelplot(~ df_n, horizontal.axis = FALSE)) or you'll get the full printout of the two objects.

[R] Rscript on Mac : specify R64 over R (32-bit version)

2013-01-16 Thread Matthew Pettis
Hi, I have both R and R64 installed on Mac OSX 10.8 Mountain Lion (64-bit). When I run the command sessionInfo() from within Rscript, I get: R version 2.15.2 (2012-10-26) Platform: i386-apple-darwin9.8.0/i386 (32-bit) Is there a way to make Rscript point at the R64 rather than R (32-bit)?

Re: [R] Read.dta and Write.dta Binary Data Error

2013-01-16 Thread Orvalho Augusto
We have the same problem. And we reported as bug: https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=15166 Hope someone can help Orvalho On Wed, Jan 16, 2013 at 8:05 PM, voldermatt matt.pece...@gmail.com wrote: Thanks in advance. I pass data sets between R and Stata and think dta files

Re: [R] Rscript on Mac : specify R64 over R (32-bit version)

2013-01-16 Thread Prof Brian Ripley
On 16/01/2013 20:16, Matthew Pettis wrote: Hi, I have both R and R64 installed on Mac OSX 10.8 Mountain Lion (64-bit). When I run the command sessionInfo() from within Rscript, I get: R version 2.15.2 (2012-10-26) Platform: i386-apple-darwin9.8.0/i386 (32-bit) Is there a way to make

Re: [R] Codetools Query (repost)

2013-01-16 Thread Saptarshi Guha
thanks much. Saptarshi __ 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 and provide commented, minimal, self-contained, reproducible code.

[R] equivalent code that doesn't return same results?

2013-01-16 Thread cwladis
I need to automate changing the reference value for factors in analysis, and it is my understanding that the following two sets of code should produce identical results, but they do not: 1)dataset$method 2)eval(parse(text=paste(dataset,IVcat[k],sep=$)))(in this case I have IVcat[k]=method,

Re: [R] equivalent code that doesn't return same results?

2013-01-16 Thread William Dunlap
eval(parse(text=paste(dataset,IVcat[k],sep=$)))-relevel(eval(parse(text=paste(dataset,IVcat[k],sep=$))),ref=online) This code returns the following error: Error in eval(parse(text = paste(dataset, IVcat[k], sep = $))) - relevel(eval(parse(text = paste(dataset, : target of assignment expands

Re: [R] Recursive file Download from FTP

2013-01-16 Thread Peter Maclean
  I want to download and unzip many files from the FTP and create variables for year, month, and day for each file based on the naming mechanism. I am stack with the following lines and any help will be highly appreciated. I want to create a spreadsheet file with lat lon and estimate as

Re: [R] Recursive file Download from FTP

2013-01-16 Thread Rui Barradas
Hello, You have an extra argument to getURL that is _not_ an argument: ftp://ftp.use.epsv/ To get the list of files just do url - ftp://ftp.cpc.ncep.noaa.gov/fews/AFR_CLIM/ARC2/DATA/1985/; filenames - getURL(url, dirlistonly = TRUE) fn - unlist(strsplit(filenames, \r\n)) # To download the

[R] Equivalent of box() in grid graphics

2013-01-16 Thread p_connolly
Paul Murell's article What's in a Name in The R Journal Vol 4/2 gives an interesting example of editing a stacked barplot of the barley data. Using the method described in that article, it's easy to do something along the lines of grid.edit(plot_01.border.strip.1, grep=TRUE,

[R] error installing KEGGSOAP

2013-01-16 Thread array chip
Hi, I am new to bioconductor, trying to install KEGGSOAP package, but got warnings() when installing and error message when trying to load the package, can anyone suggest what went wrong? many thanks John source(http://bioconductor.org/biocLite.R;) Bioconductor version 2.11 (BiocInstaller

Re: [R] error installing KEGGSOAP

2013-01-16 Thread Jeff Newmiller
What went wrong? You cross-posted. Don't ask about bioconductor packages on R-help. --- Jeff NewmillerThe . . Go Live... DCN:jdnew...@dcn.davis.ca.usBasics: ##.#. ##.#.

Re: [R] create block diagonal with each rows

2013-01-16 Thread Andrew Robinson
Hi Kathryn, take a look at the kronecker function. Cheers Andrew On Thu, Jan 17, 2013 at 1:11 PM, Kathryn Lord kathryn.lord2...@gmail.comwrote: Dear R users, I'd like to create a block diagonal matrix with each rows in a matrix. Here is a simple example. (In fact, the matrix is big)

[R] exporting simulated data

2013-01-16 Thread Ray Cheung
Dear All, I wrote a function datagen to simulate a dataset. I would like to generate 1000 datasets and export them with file names from data0001.dat to data1000.dat. Would anybody please provide some useful codes on this? Thank you very much. Best Regards, Ray [[alternative HTML version

Re: [R] create block diagonal with each rows

2013-01-16 Thread arun
Hi, May be this helps: library(Matrix) res1-lapply(split(x,1:nrow(x)),function(y) sparseMatrix(i=rep(1:4,each=5),j=1:(4*5),x=y))  do.call(rbind,lapply(seq_along(res1),function(i) res1[[i]][i,])) # [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14] #[1,]    1    5    9  

Re: [R] random effects model

2013-01-16 Thread arun
HI, In the same link at the bottom of the page, All is well now after updating all packages with the following: update.packages() It may or may not solve your problem. I got your attachments. You should post those questions in (r-sig-mixed-mod...@r-project.org). I suggest you to read lme4

[R] How to plot this simple step function?

2013-01-16 Thread Bornin1992
Hi everyone, I am trying to graph a step function in R Studio. I just learned about R today and decided to try it! The following is what I want it to look like. I graphed it using x - 0:5 y - c(0, .2, .3, .6, .9, 1.0) plot(x, y, type = s) And used Microsoft Paint to get it to how I wanted

Re: [R] Mean calculation by two variables

2013-01-16 Thread Raoni Rodrigues
Hello Rui! Thanks a lot for your help! Sorry for make mistake with the factor's name, was inattention during data preparation for the asking mail. Unfortunately, it not simple mean calculation, because same individual could have more than one row, if it eat more than a food item. In example

[R] How to change R file in stats?

2013-01-16 Thread Ibrahim Sobh
Dear I have changed some code in R file inside the stats package (dendrogram.R). Now I wan to test and run the stats package with the new updated code, what should I do in detail? RegardsIbrahim Sobh [[alternative HTML version deleted]]

Re: [R] How to change R file in stats?

2013-01-16 Thread Suzen, Mehmet
On 17 January 2013 07:03, Ibrahim Sobh im_s...@hotmail.com wrote: Dear I have changed some code in R file inside the stats package (dendrogram.R). Now I wan to test and run the stats package with the new updated code, what should I do in detail? For testing the simplest thing you can do

Re: [R] [BioC] error installing KEGGSOAP

2013-01-16 Thread Martin Morgan
On 01/16/2013 05:58 PM, array chip wrote: Hi, I am new to bioconductor, trying to install KEGGSOAP package, but got warnings() when installing and error message when trying to load the package, can anyone suggest what went wrong? many thanks John

Re: [R] How to plot this simple step function?

2013-01-16 Thread Jeff Newmiller
Base Graphics: plot(x,y,type=n) segments(x[-length(x)],y[-length(x)],x[-1],y[-length(x)]) points(x[-length(x)],y[-length(x)],pch=16) points(x[-1],y[-length(x)],pch=1) Ggplot graphics: library(ggplot2) dta - data.frame( x= x[-length(x)],y=y[-length(x)], xend=x[-1], yend=y[-length(x)] ) ggplot(

Re: [R] How to change R file in stats?

2013-01-16 Thread Jeff Newmiller
Sorry, this is not the place for a detailed answer to this question. For testing you can load modified R functions into an R session by loading the original package using the library function and then pasting the new function definition at the command line. When R goes looking for that function

Re: [R] How to change levels?

2013-01-16 Thread PIKAL Petr
Hi or you can just call factor function after subsetting newdata[,7] - factor (newdata[,7]) Regards Petr -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Ista Zahn Sent: Wednesday, January 16, 2013 6:36 PM To: paladini Cc:

Re: [R] How to plot this simple step function?

2013-01-16 Thread Jeff Newmiller
Sorry, missed a parenthesis: ggplot( dta, aes( x=x, y=y, xend=xend, yend=yend )) + geom_segment()+ geom_point( shape=16, size=4 ) + geom_point( aes( x=xend, y=yend ), shape=1, size=4 ) If you have questions about base graphics or lattice, this forum is good. If you have questions about ggplot2,

[R] RESOLVED: Using table to get frequencies of several factors at once

2013-01-16 Thread Pancho Mulongeni
Thanks, I hereby declare this thread as resolved. -Original Message- From: S Ellison [mailto:s.elli...@lgcgroup.com] Sent: Wednesday, January 16, 2013 4:27 PM To: Pancho Mulongeni; R help Subject: RE: Using table to get frequencies of several factors at once You could use a variant of