Re: [R] Creating bibtex file of all installed packages?

2009-12-11 Thread Romain Francois
On 12/11/2009 08:41 AM, Achim Zeileis wrote: On Fri, 11 Dec 2009, Rainer M Krug wrote: Hi is there an easy and fast way, to generate a BibTeX file of all installed / loaded packages and R? I know about toBibtex(citation()) to extract the BibTeX for a single package, but how can I generate a

Re: [R] How to draw three line on the same picture ?

2009-12-11 Thread Patrick Connolly
On Thu, 10-Dec-2009 at 10:14PM -0800, z_axis wrote: | | The following is sampling data: | No V1 V2 V3 | 1 0.23 0.12 0.89 | 2 0.11 0;56 0.12 | ... | | I just want to draw three lines on same picture according to value of V1, V2 | and V3. ?lines --

[R] copyING directories and files

2009-12-11 Thread Paul Evans
Hi, I am using the windows version of R. I wanted to copy a directory (containing several files) to another directory. Is there any command in R that will let me do this (something like the 'cp' command in UNIX)? I have looked at 'file.copy', but as the name implies I think it only copies one

Re: [R] Creating bibtex file of all installed packages?

2009-12-11 Thread Rainer M Krug
On Fri, Dec 11, 2009 at 9:41 AM, Achim Zeileis achim.zeil...@wu-wien.ac.atwrote: On Fri, 11 Dec 2009, Rainer M Krug wrote: Hi is there an easy and fast way, to generate a BibTeX file of all installed / loaded packages and R? I know about toBibtex(citation()) to extract the BibTeX for a

Re: [R] How to figure out which the version of split is used?

2009-12-11 Thread Karl Ove Hufthammer
On Thu, 10 Dec 2009 13:56:12 -0600 Peng Yu pengyu...@gmail.com wrote: type data.frame, split.data.frame will be called? Is it the case that if the argument is not of type data.frame, Date or POSIXct, split.default will be called? Yes. See ?UseMethod I tried it. But I'm not sure how to

[R] Gamma correlation

2009-12-11 Thread Manuel Jesús López Rodríguez
Dear all, does anybody know if it is possible, and how, to compute the Gamma correlation in R? Thank you very much in advance! Manuel __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] How to draw three line on the same picture ?

2009-12-11 Thread z_axis
thanks for your answer ! Would you mind giving me an example using my data ? Sincerely! Patrick Connolly-4 wrote: On Thu, 10-Dec-2009 at 10:14PM -0800, z_axis wrote: | | The following is sampling data: | No V1 V2 V3 | 1 0.23 0.12 0.89 | 2 0.11 0;56 0.12 | ... | |

Re: [R] mutlidimensional in.convex.hull (was multidimensional point.in.polygon??)

2009-12-11 Thread baptiste auguie
2009/12/10 Charles C. Berry cbe...@tajo.ucsd.edu: [snipped] Many? set.seed(1234) ps - matrix(rnorm(4000),ncol=4) phull -  convhulln(ps) xs - matrix(rnorm(1200),ncol=4) phull2 - convhulln(rbind(ps,xs)) nrp - nrow(ps) nrx - nrow(xs) outside - unique(phull2[phull2nrp])-nrp done - FALSE

Re: [R] How to get the runtime as well as the result?

2009-12-11 Thread Uwe Ligges
Peng Yu wrote: On Thu, Dec 10, 2009 at 7:03 PM, Dirk Eddelbuettel e...@debian.org wrote: On 10 December 2009 at 18:12, Peng Yu wrote: | If I use system.time() to measure the runtime of an expression, I will | not get the result. Is there a way to measure the runtime and get the | result as

Re: [R] Greek symbols on ylab= using barchart() {Lattice}

2009-12-11 Thread Gavin Simpson
On Wed, 2009-12-09 at 18:46 +0100, baptiste auguie wrote: barchart(1:2, ylab=expression(Concentration (*mu*g/m^3*))) or barchart(1:2, ylab=expression(Concentration ~ (mu*g/m^3))) That way you don't have to worry about quoting parts of the expression. G 2009/12/9 Peng Cai

Re: [R] Warning for data.table (with ref)?

2009-12-11 Thread Uwe Ligges
This is the intended startup message for that package (and not a warning), nothing to fix. Uwe Ligges Peng Yu wrote: I have following the message dim(refdata) and dimnames(refdata) no longer allow parameter ref=TRUE, use dim(derefdata(refdata)), dimnames(derefdata(refdata)) instead when I

Re: [R] How to draw three line on the same picture ?

2009-12-11 Thread jim holtman
try this: x - read.table(textConnection(No V1 V2 V3 1 0.23 0.12 0.89 2 0.11 0.56 0.12), header=TRUE) matplot(x[,1], x[,-1], type='l') On Fri, Dec 11, 2009 at 3:39 AM, z_axis z_a...@163.com wrote: thanks for your answer ! Would you mind giving me an example using my data ?

Re: [R] copyING directories and files

2009-12-11 Thread Uwe Ligges
I'd use a shell() command to call xcopy or robocopy, or cp given you have some unix tools installed. Uwe Ligges Paul Evans wrote: Hi, I am using the windows version of R. I wanted to copy a directory (containing several files) to another directory. Is there any command in R that will let

Re: [R] Recoding factor labels that are lists into first element of list

2009-12-11 Thread jim holtman
try this: x - data.frame(a=c('cat', 'cat,dog', 'dog', 'dog,cat')) x a 1 cat 2 cat,dog 3 dog 4 dog,cat levels(x$a) [1] cat cat,dog dog dog,cat # change the factors x$a - factor(sapply(strsplit(as.character(x$a), ','), '[[', 1)) x a 1 cat 2 cat 3 dog 4 dog

Re: [R] Help with beanplot fromatting

2009-12-11 Thread Uwe Ligges
Easiest way is probably to make grouprep a factor and insert a level without observations such as in: mydata$grouprep - factor(mydata$grouprep, levels = paste(rep(LETTERS[1:5], each=2), paste(grp, 1:2, sep=))) beanplot(val~grouprep, data = mydata, ll = 0.04, main = example, ylab = Size,

Re: [R] copyING directories and files

2009-12-11 Thread Romain Francois
What about this as a start : dir.copy - function( source = getwd(), target ){ files - list.files( source, recursive = TRUE ) dirs - unique( gsub( /[^/]+$, , files[grepl(/, files)] ) ) if( !file.exists( target ) ){ dir.create( target )

Re: [R] Reducing the dimension of a list object

2009-12-11 Thread Uwe Ligges
Bogaso wrote: Please consider following code : set.seed(1) res - vector(list) for (i in 1:5) { res1 - vector(list) res1[[1]] - letters[1:5] res1[[2]] - rnorm(5) res1[[3]] - rnorm(5); res[[i]] - res1 } res[[1]] # Now I want to reduce the dimension of res through creating a data

Re: [R] Recoding factor labels that are lists into first element of list

2009-12-11 Thread Gabor Grothendieck
Or this which removing the comma and everything thereafter in each level that has a comma: levels(x$a) - sub(,.*, , levels(x$a)) On Fri, Dec 11, 2009 at 5:21 AM, jim holtman jholt...@gmail.com wrote: try this: x - data.frame(a=c('cat', 'cat,dog', 'dog', 'dog,cat')) x        a 1     cat 2

[R] Literature analysis

2009-12-11 Thread Schwan
Dear all, i am new in R. I am writing a review paper about batteries. However, i am interested in analyzing all the papers by keywords, author, references and year. This could be done by refviz a software, which is only running on windows machines and which is not free. So my question to you

Re: [R] copyING directories and files

2009-12-11 Thread Paul Evans
Thanks Romain, Uwe! From: Romain Francois romain.franc...@dbmail.com To: Uwe Ligges lig...@statistik.tu-dortmund.de Sent: Fri, December 11, 2009 5:35:57 AM Subject: Re: [R] copyING directories and files What about this as a start : dir.copy - function(

Re: [R] Literature analysis

2009-12-11 Thread nshephard
Schwan wrote: Dear all, i am new in R. I am writing a review paper about batteries. However, i am interested in analyzing all the papers by keywords, author, references and year. This could be done by refviz a software, which is only running on windows machines and which is not free.

[R] Notification of false convergence with lmer()

2009-12-11 Thread jjh
I am running the lmer() command in a for loop and occasionally a particular iteration is producing the false convergence warning. I would like to be able to mark these iterations with a dummy variable, but I can't find any other notification besides the warning message, which, in a for loop, only

Re: [R] mutlidimensional in.convex.hull (was multidimensionalpoint.in.polygon??)

2009-12-11 Thread Keith Jewell
baptiste auguie baptiste.aug...@googlemail.com wrote in message news:de4e29f50912110200g7e43551kef5e8053fbf6e...@mail.gmail.com... 2009/12/10 Charles C. Berry cbe...@tajo.ucsd.edu: [snipped] Many? snip Charles' elegant coding of the algorithm he summarises as: Any point that is in the convex

Re: [R] Literature analysis

2009-12-11 Thread Stephan Kolassa
Hi, from what I understand, you may be interested in text mining, so perhaps you want to look at the tm package. Then again, depending on what you are really trying to do, you may be better served with perl, awk and similar tools than with R... HTH, Stephan Schwan schrieb: Dear all, i

[R] how can generate from trunceted gamma distribution in R ?

2009-12-11 Thread khazaei
Hi, all How can generate a sample from truncated inverse gamma distribution in R? thanks __ 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

Re: [R] Literature analysis

2009-12-11 Thread Schwan
Thanks for all the comments, and sorry about the unstructured question! I am trying to: 1: analyze keywords, names from Authors and year of publication from citations (with abstracts) i downloaded fron various sites(these downloads can be converted into .txt files as well) 2: to cluster these

Re: [R] Literature analysis

2009-12-11 Thread nshephard
Schwan wrote: Thanks for all the comments, and sorry about the unstructured question! I am trying to: 1: analyze keywords, names from Authors and year of publication from citations (with abstracts) i downloaded fron various sites(these downloads can be converted into .txt files as

[R] lattice - 2 graphs per panel with 2 differents colours

2009-12-11 Thread PtitBleu
Hello, I would like to get a lattice plot of 8 panels (unique(df$fact)=8) with 2 graphs (df$y1 and df$y2 as a function of df$x) and 1 red point at (500, ymax) per panel. The script below is quite ok but I'm not able to define two different colors for the two graphs. If you have an idea how to

Re: [R] Literature analysis

2009-12-11 Thread Schwan
Ok good question I havent explain! Well,lets keep it simple for the begining. By analyzing the keywords(which can also include the authors name) I mean, 1) investigate in which paper the keyword occur and how often 2) investigate if keywords occur together X axis can show the paper title (or

[R] export anova table

2009-12-11 Thread Ivan Calandra
Hi everybody, It might be a stupid question, but please excuse it! I would just like to export my ANOVA table from that kind of code: stats - lm(Asfc~TO_POS, ssfa) anova(stats) into a *.csv or *.txt file. Can anyone help please? Thanks in advance Ivan

Re: [R] incorrect multiple outputs

2009-12-11 Thread Ista Zahn
The lack of a reproducible example is a bigger problem than any lack of clarity of the explanation. -Ista On Fri, Dec 11, 2009 at 2:08 AM, bawa...@googlemail.com wrote: Apologies, I didn't explain this clearly. The Rscript is called by a perl script, which creates input_file.txt by

Re: [R] Literature analysis

2009-12-11 Thread Ista Zahn
It sounds pretty simple so far. Just put the citation info in a data frame, and plot it. I would use ggplot2 for plotting, but it could be done in base or lattice too. On Fri, Dec 11, 2009 at 8:04 AM, Schwan s.s.hosse...@utwente.nl wrote: Ok good question I havent explain! Well,lets keep it

[R] get the enclosing function name

2009-12-11 Thread Hao Cen
Hi, Is there a way to get the enclosing function name within a function? For example, I would like to have a function getEnclosingFunctionName(). It works like below f = function(){ print(getEnclosingFunctionName()) } f() # will print f Thanks Jeff

Re: [R] get the enclosing function name

2009-12-11 Thread Gabor Grothendieck
Try placing this in your function: Name - match.call()[[1]] On Fri, Dec 11, 2009 at 8:50 AM, Hao Cen h...@andrew.cmu.edu wrote: Hi, Is there a way to get the enclosing function name within a function? For example, I would like to have a function getEnclosingFunctionName(). It works like

Re: [R] export anova table

2009-12-11 Thread David Winsemius
On Dec 11, 2009, at 8:17 AM, Ivan Calandra wrote: Hi everybody, It might be a stupid question, but please excuse it! I would just like to export my ANOVA table from that kind of code: stats - lm(Asfc~TO_POS, ssfa) anova(stats) into a *.csv or *.txt file. capture.output(anova(model),

Re: [R] copyING directories and files

2009-12-11 Thread Henrik Bengtsson
copyDirectory() in the R.utils package. /Henrik On Fri, Dec 11, 2009 at 1:01 AM, Paul Evans p.evan...@yahoo.com wrote: Hi, I am using the windows version of R. I wanted to copy a directory (containing several files) to another directory. Is there any command in R that will let me do this

Re: [R] get the enclosing function name

2009-12-11 Thread Henrique Dallazuanna
Try this; f - function()as.character(sys.call()) On Fri, Dec 11, 2009 at 11:50 AM, Hao Cen h...@andrew.cmu.edu wrote: Hi, Is there a way to get the enclosing function name within a function? For example, I would like to have a function getEnclosingFunctionName(). It works like below f =

Re: [R] Subset sum problem.

2009-12-11 Thread Geert Janssens
Hans, you're my personal hero today ! The function seems to work fine for the tests I did already. Thank you very much ! Geert On Thursday 10 December 2009, Hans W Borchers wrote: Geert Janssens janssens-geert at telenet.be writes: On Wednesday 9 December 2009, Hans W Borchers wrote:

[R] Please help with a basic function

2009-12-11 Thread Mark Na
Hello, I am learning how to use functions, but I'm running into a roadblock. I would like my function to do two things: 1) convert an object to a dataframe, 2) and then subset the dataframe. Both of these commands work fine outside the function, but I would like to wrap them in a function so I

[R] Fonts and axes using persp3d

2009-12-11 Thread Paul Simonin
Greetings, I am making 3D plots using persp3d, and would like to set z-axis limits and make axis labels (the automatic numbers at tick marks) bold. I have tried zlim, but this does not seem to force the plot to restrain itself within certain bounds (e.g., 0-1). The surface I am plotting (z

Re: [R] get the enclosing function name

2009-12-11 Thread baptiste auguie
Hi, .NotYetImplemented gives an example, function () stop(gettextf('%s' is not implemented yet, as.character(sys.call(sys.parent())[[1L]])), call. = FALSE) environment: namespace:base HTH, baptiste 2009/12/11 Hao Cen h...@andrew.cmu.edu: Hi, Is there a way to get the enclosing function

Re: [R] Literature analysis

2009-12-11 Thread Schwan
Thanks, but how should I put the citation inside a data frame? data.frame(first txt file, second txt file...) plot (what should I insert here) type=p And how should I load the txt files anyway inside the frame? On Fri, 2009-12-11 at 08:37 -0500, Ista Zahn wrote: It sounds pretty

Re: [R] Literature analysis

2009-12-11 Thread Schwan
They are in Bibtex For example: @ARTICLE{adsdifvanadiumcationexchange, author = {Jin-qing Chen and Bao-guo Wang and Ji-chu Yang}, title = {Adsorption and Diffusion of VOsup2+/sup and VOsub2/sub sup+/sup across Cation Membrane for All-Vanadium Redox Flow Battery}, journal = {Solvent

Re: [R] plotting with varying dot sizes

2009-12-11 Thread servet ahmet çizmeli
I think I located the problem. the data frame associated with my spatial object (Insitu_sp) contains some NAs. And in this case, the function plot does not like NAs. It simply behaved strangely. The code below did the trick : idx = is.na(Insitu[,SPM]) ptsize = 0.35*(sqrt(Insitu[!idx,SPM])+1)

Re: [R] Literature analysis

2009-12-11 Thread Gustaf Rydevik
On Fri, Dec 11, 2009 at 3:04 PM, Schwan s.s.hosse...@utwente.nl wrote: Thanks, but how should I put the citation inside a data frame? data.frame(first txt file, second txt file...) plot (what should I insert here) type=p And how should I load the txt files anyway inside the frame?

[R] foreach and deparse(substitute(x))

2009-12-11 Thread Hao Cen
Hi, I would like to get the actual object name passed as a parameter of a function and am using deparse(substitute(x)) to do that. It doesn't work when it is used along with the foreach package. Appreciate if any one can give some suggestions on how to make it work with foreach. FUN.aaa -

Re: [R] Literature analysis

2009-12-11 Thread Neil Shephard
On Fri, Dec 11, 2009 at 2:04 PM, Schwan s.s.hosse...@utwente.nl wrote: Thanks, but how should I put the citation inside a data frame? data.frame(first txt file, second txt file...) plot (what should I insert here) type=p And how should I load the txt files anyway inside the frame?

Re: [R] non-linear regression

2009-12-11 Thread Alane
Katharine, The problem of estimation of parameters in R is that you have to know the value of the initial estimates very accurately, otherwise it does not converge. The example below could be resolved in Excel, however in does not converge. How to solve the problem? I made the chart on a

Re: [R] How to draw three line on the same picture ?

2009-12-11 Thread z_axis
It works ! thank you very much. Moreover, How about reading data from file ? The file is formatted as: No V1 V2 V3 1 0.23 0.12 0.89 2 0.11 0.56 0.12 .. jholtman wrote: try this: x - read.table(textConnection(No V1 V2 V3 1 0.23 0.12 0.89 2 0.11 0.56 0.12),

Re: [R] Subset sum problem.

2009-12-11 Thread Geert Janssens
Hans, you're my personal hero today ! The function seems to work fine for the tests I did already. Thank you very much ! Geert On Thursday 10 December 2009, Hans W Borchers wrote: Geert Janssens janssens-geert at telenet.be writes: On Wednesday 9 December 2009, Hans W Borchers wrote:

[R] cluster size

2009-12-11 Thread karuna m
hi r-help, i am doing kmeans clustering in stats. i tried for five clusters clustering using: kcl1 - kmeans(as1[,c(contlife,somlife,agglife,sexlife,     rellife,hordlife,doutlife,symtlife,washlife,    chcklife,rptlife,countlife,coltlife,ordlife)], 5,

Re: [R] Literature analysis

2009-12-11 Thread Ista Zahn
I think I my original response was bad. And I also realize that I don't really understand what you want to do. Here is what I was thinking: Format your bibliography as CSV (you can convert common bibliography formats to .csv using Tellico or similar software). Then read the references into a

[R] memory problem on Suse

2009-12-11 Thread Ambrosi Alessandro
Dear all, I am meeting some problems with memory allocation. I know it is an old issue, I'm sorry. I looked for a solution in the FAQs and manuals, mails, but without finding the working answer. I really hope you can help me. For instance, if I try to read micorarray data I get:

[R] Array of legend text with math symbols from predefined variables

2009-12-11 Thread Koen
Hello, I am trying to include legend text with math symbols from a predefined character variable that is read in from a file.   If there is only one line of text in the legend, the following, although cumbersome, works for me:   LegendText = 'U' [infinity], '=10 m/s'    # (read in from a file)

Re: [R] How to draw three line on the same picture ?

2009-12-11 Thread z_axis
%cat test.csv No,HS,ZangF,ZenF 1,0.25,0.5,0.57 2,0.10,0.23,0.12 3,0.20,0.25,0.1 .. d - read.csv(000301.txt) matplot(d[,1], d[,-1], type='l') It works. However, i hope the legend is displayed. Sincerely! z_axis wrote: It works ! thank you very much. Moreover, How about reading data

[R] Problem with calibrate function

2009-12-11 Thread Rodrigo
Hi, I´m trying to use the calibrate function from rms package (made by prof. Harrell) after fitting a model using cph. But it returns the following error message: calibrate(modelo1,B=200,bw=F,u=13) Using Cox survival estimates at 13 Days Convergence problems stopping addition Error in

[R] question about centroid-linkage (cluster analysis) (2)

2009-12-11 Thread james.foadi
Dear R community, just in case some haven't noticed my previous email. I realize hclust relies on a Fortran routine, but I hoped some of you might exactly know how that Y.hc_c$height is computed. And, thus, explain the anomaly I found. Thank you. J Dr James Foadi PhD Membrane Protein Laboratory

[R] shared axes in multipanel plot

2009-12-11 Thread Jennifer Young
Hello I've created a function to make a plot with multiple pannels from columns of data that are created in a previous function. In the example below the number of columns is 8, giving 4 pannels, but in general it takes data with any number of columns and figures out a nice layout. The panels

Re: [R] incorrect multiple outputs

2009-12-11 Thread Richard Thompson
Ista, Here is the full code: file-read.table(file=input_file.txt,sep=\t)[,c(1,3:5)] file.rows- c(nrow(file)/288) full.array - array(0,dim=c(8,file.rows,12)) cellnames - rep(A,file.rows) barcodes - rep(A,file.rows) t - rep(A,file.rows) t11 - rep(A,file.rows) cv - rep(A,file.rows) for (k in

Re: [R] Please help with a basic function

2009-12-11 Thread Ista Zahn
Hi Mark, You're on the right track. You just need your function to return dataframe. Try convert-function(d) { d-data.frame(d); #convert object to dataframe d-subset(d,select=c(time,coords.x1,coords.x2)) #select some columns return(d) } -Ista On Fri, Dec 11, 2009 at 9:19 AM, Mark Na

Re: [R] incorrect multiple outputs

2009-12-11 Thread Richard Thompson
Sorry, the nasty for (min... loop is probably easier to read like this: for (m in 1:8){ for (n in 1:12){ p- 3*q; x.array[m,n] - mean(as.matrix(x[(p-2):p,2:4])); q - q+1; if (n == 1){ z-3*m; x.blank2[(z-2):z,]-as.matrix(x[(p-2):p,2:4]) }; if (n==11){

[R] ggplot: Problem with legend background

2009-12-11 Thread MUHC_Research
Dear R-users, I am preparing graphs for an upcoming article using the different functions of the ggplot2 package and I've been having problems with the legend background. It doesn't seem to scale when the text size is increased. Here's the mandatory reproducible example: library(ggplot2)

Re: [R] non-linear regression

2009-12-11 Thread Katharine Mullen
The problem of estimation of parameters in R is that you have to know the value of the initial estimates very accurately, otherwise it does not converge. This was discussed on R-help in the last 2 weeks; see the thread on 'Starting estimates for nls Exponential Fit'. The example below

Re: [R] Literature analysis

2009-12-11 Thread Schwan
OK Thanks again for the help. I have tried example - read.csv(/PATH/test.cvs) If i call for the results R is plotting all the data separated by title, Keyword, author...) However, I dont know how to tell R that it just should look for e.g. author,keywords and year and how to plot these for

Re: [R] cluster size

2009-12-11 Thread Christian Hennig
Dear Ms Karunambigai, the kmeans algorithm depends on random initialisation. There are two basic strategies that can be applied in order to make your results reproducible: 1) Fix the random number generator by means of set.seed (see ?set.seed) before you run kmeans. The problem with this is

[R] how to creat a matrix

2009-12-11 Thread Moohwan Kim
Dear R family I am attempting to create a matrix. e.g., 0 0 0 0 1 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 How could I write a R program? Later I want to extend it to a N by N case. Thanks in advance best Moohwan __

Re: [R] Please help with a basic function

2009-12-11 Thread Paul Hiemstra
Hi Mark, This question would probably be better suited for the r-sig-geo mailing list. In addition, please read the posting guide and provide a piece of code that reproduces the problem. library(sp) convert-function(d) { d-data.frame(d); #convert object to dataframe

Re: [R] memory problem on Suse

2009-12-11 Thread Marc Schwartz
On Dec 11, 2009, at 6:24 AM, Ambrosi Alessandro wrote: Dear all, I am meeting some problems with memory allocation. I know it is an old issue, I'm sorry. I looked for a solution in the FAQs and manuals, mails, but without finding the working answer. I really hope you can help me. For

Re: [R] how to creat a matrix

2009-12-11 Thread Henrique Dallazuanna
Try this: N - 5 diag(1, N)[c(N, 1:(N - 1)),] On Fri, Dec 11, 2009 at 1:47 PM, Moohwan Kim kmhl...@gmail.com wrote: Dear R family  I am attempting to create a matrix. e.g.,  0 0 0 0 1  1 0 0 0 0  0 1 0 0 0  0 0 1 0 0  0 0 0 1 0  How could I write a R program?  Later I want to extend it

[R] (no subject)

2009-12-11 Thread Tom Knockinger
Hi, i am new to the R-project but until now i have found solutions for every problem in toturials, R Wikis and this mailing list, but now i have some problems which I can't solve with this knowledge. I have some data like this: # sample data head1 = a;b;c;d;e;f;g;h;i;k;l;m;n;o data1 =

[R] some problems with ram usage and warnings

2009-12-11 Thread Tom Knockinger
Hi, i am new to the R-project but until now i have found solutions for every problem in toturials, R Wikis and this mailing list, but now i have some problems which I can't solve with this knowledge. I have some data like this: # sample data head1 = a;b;c;d;e;f;g;h;i;k;l;m;n;o data1 =

Re: [R] how to creat a matrix

2009-12-11 Thread Robin Hankin
Hi try R library(magic) R ashift(diag(5),1) HTH rksh enrique Dallazuanna wrote: Try this: N - 5 diag(1, N)[c(N, 1:(N - 1)),] On Fri, Dec 11, 2009 at 1:47 PM, Moohwan Kim kmhl...@gmail.com wrote: Dear R family I am attempting to create a matrix. e.g., 0 0 0 0 1 1 0 0 0 0 0 1 0 0

Re: [R] how to creat a matrix

2009-12-11 Thread milton ruser
Hi Him. Did you read the Help/Manual in PDF/A Instroduction to R.PDF? MyVect-scan() 0 0 0 0 1 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 MyVect MyMat-matrix(MyVect, ncol=5, byrow=T) MyMat bests milton On Fri, Dec 11, 2009 at 10:47 AM, Moohwan Kim kmhl...@gmail.com wrote: Dear R family I

[R] obtain intermediate estimate using optim

2009-12-11 Thread Prof. John C Nash
Doing a hessian estimate at each Nelder-Mead iteration is rather like going from den Haag to Delft as a pedestrian walking and swimming via San Francisco. The structure of the algorithm means the Hessian estimate is done in addition to the NM work. While my NM code was used for optim(), I

Re: [R] Problem with calibrate function

2009-12-11 Thread Frank E Harrell Jr
Rodrigo wrote: Hi, I´m trying to use the calibrate function from rms package (made by prof. Harrell) after fitting a model using cph. But it returns the following error message: calibrate(modelo1,B=200,bw=F,u=13) Using Cox survival estimates at 13 Days Convergence problems stopping

[R] How could I find the inverse of a matrix?

2009-12-11 Thread Moohwan Kim
Dear R family I have a following question. Suppose I have a matrix as follows, for instance: tau= 0 0 0 0 1 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 I want to have the inverse of the above matrix and then add some exponent to it. That is, I want to calculate tau to the (-m). For example, m=893.

Re: [R] memory problem on Suse

2009-12-11 Thread Martin Morgan
Ask on the bioconductpr mailing list, where you will be diirected to several solutions for analyzing what I guess are 100's is cel files http://bioconductor.org -- Martin Morgan On Dec 11, 2009, at 8:02 AM, Marc Schwartz marc_schwa...@me.com wrote: On Dec 11, 2009, at 6:24 AM, Ambrosi

Re: [R] How could I find the inverse of a matrix?

2009-12-11 Thread Steve Lianoglou
Hi Moohwan, On Dec 11, 2009, at 11:26 AM, Moohwan Kim wrote: Dear R family I have a following question. Suppose I have a matrix as follows, for instance: tau= 0 0 0 0 1 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 I want to have the inverse of the above matrix and then add some

[R] Why a list of NULL's are reduced to NULL?

2009-12-11 Thread Peng Yu
The following examples are confusing to me. It is OK, to assigned NULL to one element in a list. The result is still a list. However, a list of NULL's are reduced to NULL. I don't understand how this conversion occurs. Could somebody let me know what is going on? X=matrix(1:8, nr=4) apply(X,1,

[R] Sources for open sourced homework questions for R?

2009-12-11 Thread David Kane
Hi, I am teaching a one month class in applied statistics and want to bring my students up to speed in R without devoting much/any lecture time to R instruction. I think that the best way to do this is to provide them with a lot of R questions for homework. These questions would be numerous

Re: [R] Why a list of NULL's are reduced to NULL?

2009-12-11 Thread William Dunlap
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Peng Yu Sent: Friday, December 11, 2009 8:44 AM To: r-h...@stat.math.ethz.ch Subject: [R] Why a list of NULL's are reduced to NULL? The following examples are confusing to me.

[R] Looking for categorization method/module in R

2009-12-11 Thread James Mcininch
All, I'm relatively new to using R, having used it thus far for some simple statistics and plotting. However, I'm not new to programming by any measure. I've been looking at the various modules available for clustering, factor analysis, etc. and find that I need advice on which modules I should

[R] SVM regression

2009-12-11 Thread Eleni Christodoulou
Dear R users, I am trying to apply SVM regression for a set of microarray data. I am using the function svm() under the package {e1071}. Can anyone tell me what the *residuals *value represents? I have some observed values *y_obs* for the parameter that I want to estimate and I would expect that

[R] The correct way to set an element in a list to NULL? (FAQ is not clear)

2009-12-11 Thread Peng Yu
http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-can-I-set-components-of-a-list-to-NULL_003f The explanation on this FAQ entry is not clear. It says '... similarly for named components...'. What I understood was x[i]-list(NULL) is the same as x$a_name-list(NULL). But, they are not. As the example

Re: [R] How to figure out which the version of split is used?

2009-12-11 Thread William Dunlap
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Karl Ove Hufthammer Sent: Thursday, December 10, 2009 1:46 AM To: r-h...@stat.math.ethz.ch Subject: Re: [R] How to figure out which the version of split is used? On Wed, 9 Dec

Re: [R] SVM regression

2009-12-11 Thread Steve Lianoglou
Hi Eleni, On Dec 11, 2009, at 12:04 PM, Eleni Christodoulou wrote: Dear R users, I am trying to apply SVM regression for a set of microarray data. I am using the function svm() under the package {e1071}. Can anyone tell me what the *residuals *value represents? I have some observed values

Re: [R] Why a list of NULL's are reduced to NULL?

2009-12-11 Thread Peng Yu
On Fri, Dec 11, 2009 at 11:01 AM, William Dunlap wdun...@tibco.com wrote: -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Peng Yu Sent: Friday, December 11, 2009 8:44 AM To: r-h...@stat.math.ethz.ch Subject: [R] Why a list of

Re: [R] shared axes in multipanel plot

2009-12-11 Thread Gabor Grothendieck
Try this using xyplot.zoo in the zoo package. We define the baseline and a panel function. The panel function just performs the default action to display the graphs and adds the baseline. The screens variable is 1,1,2,2,3,3,4,4. We create a zoo object from dat and use screens to name the

Re: [R] The correct way to set an element in a list to NULL? (FAQ is not clear)

2009-12-11 Thread Steve Lianoglou
Hi, On Dec 11, 2009, at 12:07 PM, Peng Yu wrote: http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-can-I-set-components-of-a-list-to-NULL_003f The explanation on this FAQ entry is not clear. It says '... similarly for named components...'. What I understood was x[i]-list(NULL) is the same

Re: [R] The correct way to set an element in a list to NULL? (FAQ is not clear)

2009-12-11 Thread Peng Yu
On Fri, Dec 11, 2009 at 11:27 AM, Steve Lianoglou mailinglist.honey...@gmail.com wrote: Hi, On Dec 11, 2009, at 12:07 PM, Peng Yu wrote: http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-can-I-set-components-of-a-list-to-NULL_003f The explanation on this FAQ entry is not clear. It says '...

Re: [R] Why a list of NULL's are reduced to NULL?

2009-12-11 Thread William Dunlap
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Peng Yu Sent: Friday, December 11, 2009 9:18 AM To: r-h...@stat.math.ethz.ch Subject: Re: [R] Why a list of NULL's are reduced to NULL? On Fri, Dec 11, 2009 at 11:01 AM,

Re: [R] The correct way to set an element in a list to NULL? (FAQ is not clear)

2009-12-11 Thread Steve Lianoglou
On Dec 11, 2009, at 12:36 PM, Peng Yu wrote: [snip] What seems confusing to me is: even 'x[i]-list(NULL)' and 'x[[i]]-list(NULL)' are different, why x[i]-NULL and x[[i]]-NULL are the same? Shouldn't the meaning of 'x[[i]]-NULL' be defined as the set the i'th element NULL, rather than

Re: [R] Why a list of NULL's are reduced to NULL?

2009-12-11 Thread Peng Yu
On Fri, Dec 11, 2009 at 11:43 AM, William Dunlap wdun...@tibco.com wrote: -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Peng Yu Sent: Friday, December 11, 2009 9:18 AM To: r-h...@stat.math.ethz.ch Subject: Re: [R] Why a list

Re: [R] Sources for open sourced homework questions for R?

2009-12-11 Thread hadley wickham
Hi Dave, I have a few drills available from http://had.co.nz/stat405 - see the right hand column, about half way down. They seem similar in spirit to what you're thinking of. You might want to look at the Little Schemer for a similar approach with a different programming language. However, I'm

Re: [R] Why a list of NULL's are reduced to NULL?

2009-12-11 Thread hadley wickham
A very common situation is that the users don't know all the possible return types of 'some_third_party_function()'. If the users don't know all the return types, he/she can not make sure the return type of function(x) {...} be always the same. How do you deal with this case? It's not that

Re: [R] confint for glm (general linear model)

2009-12-11 Thread Peter Ehlers
I suspect that you don't know about 'profile' confidence intervals. If that's true then I can recommend the discussion in MASS (the book) in section 8.4. In a nutshell, I don't think that you want to do a profile confint calculation manually (unless typing instructions that use the function

Re: [R] ggplot: Problem with legend background

2009-12-11 Thread hadley wickham
Hi Luc, You want: legend.title=theme_text(size=20, hjust = 0) So the legend title is left aligned, not centred. Hadley On Fri, Dec 11, 2009 at 9:26 AM, MUHC_Research villa...@dms.umontreal.ca wrote: Dear R-users, I am preparing graphs for an upcoming article using the different functions

Re: [R] The correct way to set an element in a list to NULL? (FAQ is not clear)

2009-12-11 Thread Peng Yu
On Fri, Dec 11, 2009 at 11:51 AM, Steve Lianoglou mailinglist.honey...@gmail.com wrote: On Dec 11, 2009, at 12:36 PM, Peng Yu wrote: [snip] What seems confusing to me is: even 'x[i]-list(NULL)' and 'x[[i]]-list(NULL)' are different, why x[i]-NULL and x[[i]]-NULL are the same? Shouldn't

Re: [R] Why a list of NULL's are reduced to NULL?

2009-12-11 Thread Peng Yu
On Fri, Dec 11, 2009 at 12:05 PM, hadley wickham h.wick...@gmail.com wrote: A very common situation is that the users don't know all the possible return types of 'some_third_party_function()'. If the users don't know all the return types, he/she can not make sure the return type of function(x)

Re: [R] Please help with a basic function

2009-12-11 Thread Mark Na
Many thanks for the replies to my call for help this morning. I didn't know about return() and that helped quite a bit. Best, Mark On Fri, Dec 11, 2009 at 10:00 AM, Paul Hiemstra p.hiems...@geo.uu.nlwrote: Hi Mark, This question would probably be better suited for the r-sig-geo mailing

  1   2   >