Re: [R] plot() point names ?

2009-10-13 Thread Daniel Malter
I think you are looking for this: x=rnorm(6,10,1) e=rnorm(6,0,1) y=x+e plot(y~x,xlim=c(min(x)-2,max(x)+2),ylim=c(min(y)-2,max(y)+2)) text(x,y,pos=1,labels=c(Prof,CEO,Janitor,Admin,Farmer,Fire Chief)) HTH, Daniel - cuncta stricte discussurus -

Re: [R] How to read plain text documents into a vector?

2009-10-13 Thread Dieter Menne
Richard Liu wrote: I'm new to R. I'm working with the text mining package tm. I have several plain text documents in a directory, and I would like to read all the files with extension .txt in that directory into a vector, one text document per vector element. That is, v[1] would be the

Re: [R] crosstabulation and unlist function

2009-10-13 Thread eugen pircalabelu
Thank you! This is what i needed! I did not realize i could replicate my factor and then tabulate, but it makes sense! Thank you once again! - Original Message From: William Dunlap wdun...@tibco.com To: eugen pircalabelu eugen_pircalab...@yahoo.com; r-help@r-project.org Sent:

[R] Creating object referant from argument name

2009-10-13 Thread showa
Hi all. I'd like to define an object within a function based on an argument to that function. Specifically, I've got: do.something-function(input){ id-substring(input,3,3) j-list1 if(id==2)j-list2 if(id==3)j-list3 if(id==4)j-list4 ...} Instead of all these if() arguments, I was hoping to use

[R] How to read plain text documents into a vector?

2009-10-13 Thread Richard Liu
I'm new to R. I'm working with the text mining package tm. I have several plain text documents in a directory, and I would like to read all the files with extension .txt in that directory into a vector, one text document per vector element. That is, v[1] would be the first document, v[2] the

[R] stochastic process

2009-10-13 Thread 刘哲
Hi,   I'm a student in China, and I never used R before.   I'm now wondering how to simulate a sample of Markov chain of ,say 500 entries with a certain transition matrix.    Thanks a lot. ___ 好玩贺卡等你

Re: [R] Function to find prime numbers

2009-10-13 Thread Romain Francois
On 10/13/2009 09:59 AM, AJ83 wrote: I need to create a function to find all the prime numbers in an array. Can anyone point me in the right direction? Thank you. AJ There is isprime in package gmp. data.frame( number = 1:10, is.prime = isprime( 1:10 ) 1, is.probably.prime = isprime(1:10)

Re: [R] Function to find prime numbers

2009-10-13 Thread Gustaf Rydevik
library(gmp) ?isprime /Gustaf On Tue, Oct 13, 2009 at 9:59 AM, AJ83 aljense...@gmail.com wrote: I need to create a function to find all the prime numbers in an array. Can anyone point me in the right direction? Thank you. AJ -- View this message in context:

Re: [R] Use R -- term and logo copyright?

2009-10-13 Thread Achim Zeileis
Marianne: I would like to start some R workshops at King's College London, and to do so, I would like to use the Use R! logo at http://www.agrocampus-ouest.fr/math/useR-2009//useR%21%202008_fichiers/useR-middle.png Since it seems to be difficult to get a shell account at KCL, I also went ahead

Re: [R] How to read plain text documents into a vector?

2009-10-13 Thread Paul Hiemstra
Richard Liu wrote: I'm new to R. I'm working with the text mining package tm. I have several plain text documents in a directory, and I would like to read all the files with extension .txt in that directory into a vector, one text document per vector element. That is, v[1] would be the first

Re: [R] is that possible to graph 4 dimention plot

2009-10-13 Thread Petr PIKAL
Hi I tried to do similar thing and did get great answer from Alberto Monteiro http://tolstoy.newcastle.edu.au/R/e4/help/08/01/0682.html However I finally managed to do it by slicing space by combination of image and contour together with putting numbers on contour. Then I used scizors and

Re: [R] Lattice barchart-reordered

2009-10-13 Thread Dieter Menne
Veerappa Chetty wrote: Hi,Can I use reorder function with barchart as in dotchart? Here are some codes which do not work for me. .. example remove As your example is not self-contained (it should be), I cannot show it with your data. My preferred way is to reorder outside, because it

[R] Function to find prime numbers

2009-10-13 Thread AJ83
I need to create a function to find all the prime numbers in an array. Can anyone point me in the right direction? Thank you. AJ -- View this message in context: http://www.nabble.com/Function-to-find-prime-numbers-tp25868633p25868633.html Sent from the R help mailing list archive at

Re: [R] svy / weighted regression

2009-10-13 Thread Laust
Dear David, Thanks again for your input! I realize that I did a bad job of explaining this in my first email, but the setup is that in Finland persons who die are sampled with a different probability (1) from those who live (.5). This was done by the Finnish data protection authorities to protect

[R] stepwise with F statistics

2009-10-13 Thread Lucas Sevilla García
Hi Community R I need to make a stepwise using F statistics as a criteria to choose variables.I have 3 independant variables and one dependant variable, and I need to choose the best model fitting to my data using F statistics. The problem is I haven't found any package to do such operation.

Re: [R] stochastic process

2009-10-13 Thread Bernardo Rangel Tura
On Tue, 2009-10-13 at 14:43 +0800, 刘哲 wrote: Hi, I'm a student in China, and I never used R before. I'm now wondering how to simulate a sample of Markov chain of ,say 500 entries with a certain transition matrix. Thanks a lot. Hi Well the naive script for you problem is something

[R] multiple groups with different colors in boxplot

2009-10-13 Thread kennyPA
Can anybody help me on how to boxplot multiple groups with different color? Say, I have 3 groups of data, each group with 2 boxes, and I'd like to have the following layout in the boxplot: red, red, green, green, blue, blue thanks in advance. -- View this message in context:

[R] GridR

2009-10-13 Thread wesley mathew
Dear All I was installed GridR package in R. I am trying to execute UCS; it is my project in client side. grid.init(service=local,debug=FALSE, localTmpDir=GridRTmp/) grid.apply(x,UCS, wait=TRUE,,check=TRUE) But this shows error, that is given below. *cannot load local function/variable: to

[R] plot dates in x-axis

2009-10-13 Thread Lathouri, Maria
Hallo, I am trying to plot dates in x-axis. The format of my dates are in dd/mm/. At first I install zoo package. After R reads my file, I change the default format of dates to the format that I have, myfile-read.csv DATE-as.Date(DATE,format=%d/%m/%Y) up till now everything goes ok; when

Re: [R] Using diff, ifelse on zoo object

2009-10-13 Thread charliegenge
Thanks very much Gabor! Worked like a treat. Good to know that the na's really mess up the ifelse function. Thanks again. Gabor Grothendieck wrote: The problem is that ifelse does not work the way you might think (see value section of ?ifelse) and basically should not be used with three

[R] using axis.Date with interaction.plot

2009-10-13 Thread North, Bernard V
Dear List I want to plot multiple time series (several outcomes) with dates at intervals on the x axis and a legend. Is it possible to use axis.Date to get dates, at intervals in my case, on the x axis of a (multiple) time series plot. The axis.Date in the code below doesn't produce any dates

Re: [R] How to read plain text documents into a vector?

2009-10-13 Thread kenhorvath
Paul Hiemstra wrote: file_list = list.files(/where/are/the/files) obj_list = lapply(file_list, FUN = yourfunction) yourfunction is probably either read.table or some read function from the tm package. So obj_list will become a list of either data.frame's or tm objects. The

[R] Adding additional X-axis data to charts, e.g. N values

2009-10-13 Thread spidermonkeydp
Hello All, Does anyone know if it is possible to add an additional X-axis data to a chart? For example, if I have plotted a bar chart of mean height on the Y-axis and have male and female on the X-axis. I want to add automatically the number of samples (N) for males and number of samples for

[R] lapply() reccursively

2009-10-13 Thread Kaveh Vakili
Hi all, I was wondering whether it is possible to use the lapply() function to alter the value of the input, something in the spirit of : a1-runif(100) a2-function(i){ a1[i]-a1[i-1]*a1[i];a1[i] } a3-lapply(2:100,a2) Something akin to a for() loop, but using the lapply() infrastructure. I

Re: [R] multiple groups with different colors in boxplot

2009-10-13 Thread ONKELINX, Thierry
Here is a solution using ggplot2 n - 1000 dataset - data.frame(A = rep(1:6, n), B = rep(gl(3, 2), n)) dataset$C - with(dataset, rnorm(n) * as.numeric(B) + A) library(ggplot2) dataset$A - factor(dataset$A) #with default colours ggplot(dataset, aes(x = A, y = C, colour = B)) + geom_boxplot() #with

Re: [R] plotting points in random but different colors based on condition

2009-10-13 Thread Jonathan Bleyhl
I guess I didn't mention that I'm trying to do this in ggplot2 where I have my color set up via: geom_point(aes(colour = Date)) Not sure how to implement your suggestion within the confines of ggplot2. Jim Lemon-2 wrote: On 10/10/2009 06:41 PM, Jim Lemon wrote: Oops, should be:

[R] Installing R on Ubuntu ( 8.10 ) ?

2009-10-13 Thread Robert Wilkins
installing on Ubuntu, how to do it and have people found it to be glitchy? which is easier , binary install or from source ? With the source install, are you less likely to have a dependencies issue ? ( Ubuntu does the GCC install seamlessly, but has no mention of R )

Re: [R] splitting dataframe, assign to new dataframe, add new rows to new dataframe

2009-10-13 Thread Ista Zahn
I'm sure there's a really cool way to do this with plyr, although I don't know if my particular plyr version is much better. Anyway here it is: cmbine - read.csv(textConnection('names, mass, classes apple,0.50,1 tiger,100.00,2 pencil,0.01,3 chicken,1.00,2 banana,0.15,1 pear,0.30,1'))

Re: [R] Installing R on Ubuntu ( 8.10 ) ?

2009-10-13 Thread Ista Zahn
It's not glitchy, and you install it just like any other program. If you want the latest version you can follow the instructions here: http://cran.r-project.org/bin/linux/ubuntu/. Otherwise sudo aptitude install r-base r-base-dev will do the trick. On Tue, Oct 13, 2009 at 7:46 AM, Robert Wilkins

[R] Introduction to mark-recapture analysis in R?

2009-10-13 Thread Anne-Katrin Link
Normal021falsefalse false MicrosoftInternetExplorer4 Dear R-helpers,  I was wondering whether

Re: [R] Adding additional X-axis data to charts, e.g. N values

2009-10-13 Thread John Kane
?mtext should help. --- On Tue, 10/13/09, spidermonkeydp gbabo...@gmail.com wrote: From: spidermonkeydp gbabo...@gmail.com Subject: [R] Adding additional X-axis data to charts, e.g. N values To: r-help@r-project.org Received: Tuesday, October 13, 2009, 6:06 AM Hello All, Does

Re: [R] stepwise with F statistics

2009-10-13 Thread Frank E Harrell Jr
Lucas Sevilla García wrote: Hi Community R I need to make a stepwise using F statistics as a criteria to choose variables.I have 3 independant variables and one dependant variable, and I need to choose the best model fitting to my data using F statistics. The problem is I haven't found any

[R] Counting

2009-10-13 Thread Ashta
*Hi all, * *Assume that I have the following data set with tow variables and I want count the number of observation with identical values * ** *x1 x2* * 1 1 * * 1 0 * * 0 1* * 0 1* * 0 0* * 1 1* * 0 1 * I want the following output ** * * *n1=3 # number of identical

Re: [R] multiple groups with different colors in boxplot

2009-10-13 Thread Henrique Dallazuanna
Try this; DF - as.data.frame(matrix(rnorm(60), 10)) boxplot(DF, col = rep(seq(ncol(DF)) + 1, each = 2)) On Tue, Oct 13, 2009 at 2:11 AM, kennyPA tao...@yahoo.com wrote: Can anybody help me on how to boxplot multiple groups with different color? Say, I have 3 groups of data, each group with 2

Re: [R] Installing R on Ubuntu ( 8.10 ) ?

2009-10-13 Thread Dirk Eddelbuettel
On 13 October 2009 at 07:46, Robert Wilkins wrote: | installing on Ubuntu, how to do it and have people found it to be glitchy? | | which is easier , binary install or from source ? | | With the source install, are you less likely to have a dependencies issue ? | | ( Ubuntu does the GCC

Re: [R] Counting

2009-10-13 Thread Henrique Dallazuanna
Try this: table(Reduce(`==`, DF)) On Tue, Oct 13, 2009 at 9:20 AM, Ashta sewa...@gmail.com wrote: *Hi all, * *Assume that I have the following data set  with tow variables and I want count the number of observation with identical values * ** *x1 x2* * 1   1 * * 1   0 * * 0   1*

Re: [R] Counting

2009-10-13 Thread Julien Grassot
Or try this : x1=c(1,1,0,0,0,1,0) x2=c(1,0,1,1,0,1,1) DF=cbind(x1,x2) ifelse(DF[,1]==DF[,2],1,0) your n1 is : sum(ifelse(DF[,1]==DF[,2],1,0)) your n2 is : dim(DF)[1]-sum(ifelse(DF[,1]==DF[,2],1,0)) Maybe not an elegant way, but hope this help. Julien GRASSOT Data Analysis Department Flamel

Re: [R] SPSS long variable names

2009-10-13 Thread John Kane
library(Hmisc) spss.get may do it but it's been some time since I used it. --- On Sat, 10/10/09, Orvalho Augusto orvaq...@gmail.com wrote: From: Orvalho Augusto orvaq...@gmail.com Subject: [R] SPSS long variable names To: r-help@r-project.org Received: Saturday, October 10, 2009, 12:14 PM

[R] How to draw more geographical boundaries

2009-10-13 Thread Angela Parenti
Dear R-users, I am trying to plot in the same map both NUTS 2 (i.e. regional) and NUTS 3 (i.e. provincial) boundaries for Italy but I couldn't find how to plot more than one level boundary in the same map.// // I have shapefile both for regions and provinces in Italy and I tried to use the

Re: [R] lapply / mapply and assignments

2009-10-13 Thread Magnus Torfason
Thank you so much, relist and SIMPLIFY both work. See more comments below ... On 10/12/2009 5:35 PM, Charles C. Berry wrote: On Mon, 12 Oct 2009, Magnus Torfason wrote: I want to achieve the following: l - list( list(a=1,b=2), list(a=3,b=4)) l[[]][a] - 5:6 See ?relist something

Re: [R] Introduction to mark-recapture analysis in R?

2009-10-13 Thread Ben Bolker
oops, library(sos) after install.packages(sos) and before findFn(mark-recapture) ... -- View this message in context: http://www.nabble.com/Introduction-to-mark-recapture-analysis-in-R--tp25871729p25872847.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] Introduction to mark-recapture analysis in R?

2009-10-13 Thread Ben Bolker
Anne Link wrote: Normal021falsefalse false MicrosoftInternetExplorer4 Dear R-helpers,  

Re: [R] SPSS long variable names

2009-10-13 Thread Orvalho Augusto
Thanks for the answer. Hmisc uses read.spss from the foreign package. And so it does not solve my trouble. I need to read the long names on the SPSS dataset. Caveman On Tue, Oct 13, 2009 at 3:01 PM, John Kane jrkrid...@yahoo.ca wrote: library(Hmisc) spss.get may do it but it's been some time

[R] Identification of variables contributing to differences between factor in adonis

2009-10-13 Thread Paul Dennis
Dear all I have used permutational multivariate analysis of variance (adonis in package vegan) based on Bray-Curtis distances to assess the signifance of carbon, nitrogen and more complex nutrient amendments on soil microbial community structure (microbial fatty acids). I have identified

Re: [R] RPostgreSQL and needed .dlls

2009-10-13 Thread Uwe Ligges
Josuah Rechtsteiner wrote: Dear List, I am trying to connect from R 2.9.2 on Win XP SP3 to a remotely installed PostgreSQL DB (8.3.7 on Ubuntu Server 9.04). Everything seems to be properly installed, as I can connect to the DB from within Excel and RKWard (running on another machine). But

Re: [R] Use R -- term and logo copyright?

2009-10-13 Thread David Winsemius
Perhaps: Yooze R! On second thought, probably not quite right for King's College. Then? dig R! -- David On Oct 9, 2009, at 3:46 PM, Marianne Promberger wrote: Dear list, I would like to start some R workshops at King's College London, and to do so, I would like to use the Use R! logo

Re: [R] Function to find prime numbers

2009-10-13 Thread Thomas Lumley
On Tue, 13 Oct 2009, AJ83 wrote: I need to create a function to find all the prime numbers in an array. Can anyone point me in the right direction? It depends a bit on how big the numbers are. If the array is large but the numbers are not very large the fastest approach is probably to

[R] update.formula drop interaction terms

2009-10-13 Thread Eleni Rapsomaniki
Dear R users, How do I drop multiplication terms from a formula using update? e.g. forml=as.formula(Surv(time, status) ~ x1+x2+A*x3+A*x4+B*x5+strata(sex)) #I would like to drop all instances of variable A (the main effect and its interactions). The following: updated.forml=update(forml, ~ . -A)

Re: [R] splitting dataframe, assign to new dataframe, add new rows to new dataframe

2009-10-13 Thread hadley wickham
On Tue, Oct 13, 2009 at 6:57 AM, Ista Zahn istaz...@gmail.com wrote: I'm sure there's a really cool way to do this with plyr, although I don't know if my particular plyr version is much better. Anyway here it is: cmbine - read.csv(textConnection('names, mass, classes apple,0.50,1

[R] Creating a list of empty lists

2009-10-13 Thread Magnus Torfason
Well here is one more brain-teaser related to assigning stuff into a list of list. What if I need to create a new list of empty lists? I have actually got a solution to this problem: l = list(list()) for ( i in sequence(length-1) ) { l = list(unlist(l,recursive=FALSE),

Re: [R] svy / weighted regression

2009-10-13 Thread Thomas Lumley
I think there is a much simpler explanation. The survey design object has eight observations, two per country. With a sample size of two per country it is hardly surprising that country-specific estimates are not very precise. The actual data has hundreds of thousands of observations per

Re: [R] Use R -- term and logo copyright?

2009-10-13 Thread hadley wickham
Can I use (a) the logo and/or (b) the slogan for the KCL R workshops? I think it is quite clear from my website that this is neither about the Springer book series nor about an R user conference. No, sorry, the logo/name should be used exclusively for the Springer series and the R User

Re: [R] Creating a list of empty lists

2009-10-13 Thread Romain Francois
On 10/13/2009 03:48 PM, Magnus Torfason wrote: l = list(list()) for ( i in sequence(length-1) ) { l = list(unlist(l,recursive=FALSE), list()) } About this : rep( list(list()), 3 ) [[1]] list() [[2]] list() [[3]] list() Romain -- Romain Francois Professional R

Re: [R] Creating a list of empty lists

2009-10-13 Thread Magnus Torfason
Live and learn ... Thank you! On 10/13/2009 9:57 AM, Romain Francois wrote: On 10/13/2009 03:48 PM, Magnus Torfason wrote: l = list(list()) for ( i in sequence(length-1) ) { l = list(unlist(l,recursive=FALSE), list()) } About this : rep( list(list()), 3 ) [[1]]

Re: [R] Creating a list of empty lists

2009-10-13 Thread Henrique Dallazuanna
Try this: replicate(3, list()) On Tue, Oct 13, 2009 at 10:48 AM, Magnus Torfason zulutime@gmail.com wrote: Well here is one more brain-teaser related to assigning stuff into a list of list. What if I need to create a new list of empty lists? I have actually got a solution to this problem:

[R] How to calculate average correlation coefficient of a correlation matrix ?

2009-10-13 Thread Amit Kumar
Hi! All, I have large correlation matrix Cor. I wish to calculate average correlation coefficient for this matrix. Is there any function in R to do this? Thanks in advance. Amit __ R-help@r-project.org mailing list

[R] multivariate multiple nonlinear regression

2009-10-13 Thread Yingyun Liu
Hello, I have several dataframes of identical structure. Each dataframe has one dependent variable and several independent variables. Two different functions are used to describe the relationships among all the dataframes. Some parameters that are to be obtained from regression are shared by all

Re: [R] Nelder-Mead with output of simplex vertices

2009-10-13 Thread Ben Bolker
bartjoosen wrote: Hi, Is it possible to share the code on this list? I'm also interested (and maybe others to) Or are you planning to make a package? Best regards Bart Ted.Harding-2 wrote: On 12-Oct-09 13:33:17, Ted Harding wrote: On 12-Oct-09 13:24:01, Terry Therneau

Re: [R] SPSS long variable names

2009-10-13 Thread joris meys
Sorry to be so blunt, but I cannot believe PSPP can't save a dataset as a .csv file for example. That should be the prefered format to transport a dataset to any other statistical package, including R. csv files are universal. Cheers Joris On Tue, Oct 13, 2009 at 3:30 PM, Orvalho Augusto

Re: [R] How to calculate average correlation coefficient of a correlation matrix ?

2009-10-13 Thread Chuck Cleland
On 10/13/2009 10:13 AM, Amit Kumar wrote: Hi! All, I have large correlation matrix Cor. I wish to calculate average correlation coefficient for this matrix. Is there any function in R to do this? Thanks in advance. cormat - cor(iris[,1:4]) corlowtri - cormat[lower.tri(cormat)] corlowtri

Re: [R] SPSS long variable names

2009-10-13 Thread Orvalho Augusto
Thanks guys for the greaty ideia!! I am fool because I did not realize that before. Caveman On Tue, Oct 13, 2009 at 4:41 PM, joris meys jorism...@gmail.com wrote: Just for clarity : the csv format will solve your problem, as the restrictions on the variable names will only depend on the

Re: [R] Nelder-Mead with output of simplex vertices

2009-10-13 Thread bartjoosen
Hi, Is it possible to share the code on this list? I'm also interested (and maybe others to) Or are you planning to make a package? Best regards Bart Ted.Harding-2 wrote: On 12-Oct-09 13:33:17, Ted Harding wrote: On 12-Oct-09 13:24:01, Terry Therneau wrote: -- begin included

Re: [R] SPSS long variable names

2009-10-13 Thread Robert Baer
- Original Message - From: Robert Baer rb...@atsu.edu To: Orvalho Augusto orvaq...@gmail.com Sent: Tuesday, October 13, 2009 9:52 AM Subject: Re: [R] SPSS long variable names I am wondering if there is a patch for the SPSS reading code on the foreign package, in order to be able to

Re: [R] svy / weighted regression

2009-10-13 Thread David Winsemius
On Oct 13, 2009, at 6:07 AM, Laust wrote: Dear David, Thanks again for your input! I realize that I did a bad job of explaining this in my first email, but the setup is that in Finland persons who die are sampled with a different probability (1) from those who live (.5). This was done by the

Re: [R] How to choose a proper smoothing spline in GAM of mgcv package?

2009-10-13 Thread Simon Wood
I have 5 datasets. I would like to choose a basis spline with same knots in GAM function in order to obtain same basis function for 5 datasets. Moreover, the basis spline is used to for an interaction of two covarites. The `knots' argument to `gam' allows you to fix the knot locations used

Re: [R] Function to find prime numbers

2009-10-13 Thread Barry Rowlingson
On Tue, Oct 13, 2009 at 2:41 PM, Thomas Lumley tlum...@u.washington.edu wrote: On Tue, 13 Oct 2009, AJ83 wrote: I need to create a function to find all the prime numbers in an array. Can anyone point me in the right direction? This almost sounds like a homework problem to me... So here's a

Re: [R] lapply() reccursively

2009-10-13 Thread David Winsemius
On Oct 13, 2009, at 7:33 AM, Kaveh Vakili wrote: Hi all, I was wondering whether it is possible to use the lapply() function to alter the value of the input, something in the spirit of : a1-runif(100) a2-function(i){ a1[i]-a1[i-1]*a1[i];a1[i] } a3-lapply(2:100,a2) Neither a1 nor 2:100 are

Re: [R] SPSS long variable names

2009-10-13 Thread Orvalho Augusto
No! That is variable labels. Caveman On Tue, Oct 13, 2009 at 4:52 PM, Robert Baer rb...@atsu.edu wrote: I am wondering if there is a patch for the SPSS reading code on the foreign package, in order to be able to read long variable names. Right now read.spss() just trunc the names to 8

Re: [R] Counting

2009-10-13 Thread William Dunlap
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Ashta Sent: Tuesday, October 13, 2009 5:20 AM To: R help Subject: [R] Counting *Hi all, * *Assume that I have the following data set with tow variables and I want

[R] Free Introductory R Course Taught Over the Web

2009-10-13 Thread Paul H Geissler
Free Introductory R Course Taught Over the Web The course is designed for natural resource managers and is open to all who are interested without charge. Audio of the presentations is available either using your computer speakers and optional microphone or headset or by calling a phone bridge

Re: [R] lapply() reccursively

2009-10-13 Thread hadley wickham
Neither a1 nor 2:100 are lists, so it would seem that sapply would be more appropriate. The difference between lapply and sapply is the output, not the input. Hadley -- http://had.co.nz/ __ R-help@r-project.org mailing list

Re: [R] SPSS long variable names

2009-10-13 Thread Orvalho Augusto
Sadlly exportation to csv or another format is not implemented yet: http://www.gnu.org/software/pspp/manual/html_node/Not-Implemented.html Caveman On Tue, Oct 13, 2009 at 4:41 PM, joris meys jorism...@gmail.com wrote: Just for clarity : the csv format will solve your problem, as the

Re: [R] Introduction to mark-recapture analysis in R?

2009-10-13 Thread David Winsemius
On Oct 13, 2009, at 8:00 AM, Anne-Katrin Link wrote: I was wondering whether there are any good books and/or website links that introduce mark-recapture analysis in R. In particular, I am interested in exploratory data analysis of resighting data and how to create capture histories

[R] time grid for survfit Survival function outputs

2009-10-13 Thread Muhtar Osman
Dear All, Maybe it is a silly question. But I wasn't able to find it from manual or R site search. I was wondering what is the corresponding time axis for survival function outputs in survfit. I think it is survfit(...)$time, but not 100% sure. If it is, is it possible we could make survival

Re: [R] SPSS long variable names

2009-10-13 Thread Frank E Harrell Jr
Orvalho Augusto wrote: Sadlly exportation to csv or another format is not implemented yet: http://www.gnu.org/software/pspp/manual/html_node/Not-Implemented.html Caveman That would not solve the problem anyway because you would not get labels and other variable attributes. Frank On

[R] how to have tkchooseDirectory resize in windows?

2009-10-13 Thread David Gattrell
R-2.8.0 / tcltk8.5 In windows, Rgui.exe has a directory browser that can be resized, but when I call tkchooseDirectory(), it is a fixed size. In linux, when I call tkchooseDirectory() it can be resized. How do I get a windows version that I can resize? [[alternative HTML version

Re: [R] how to output profile plots for groups using lattice package

2009-10-13 Thread George Kalema
A million thanks Peter, subsetting fixed it. George On Mon, Oct 12, 2009 at 11:51 PM, Peter Ehlers ehl...@ucalgary.ca wrote: Hi George, Your problem is not with xyplot, but with the NA occurrences in your data. Try adding subset = {!is.na(MSE)}, to your xyplot call, or (better), subset

[R] histogram

2009-10-13 Thread Dmitry Gospodaryov
Dear R developers,How I can build a histogram from matrix: 0 0.5 1 0.25 34 43 65 1 23 35 54 4 22 29 42 10 21 22 29 20 15 17 20 (first string is represented names of columns, first column is represented names of rows) where names of columns should be x-axis labels; respectively to this, I want

[R] response surface designs

2009-10-13 Thread Dmitry Gospodaryov
How I can obtain graphics for response surface design, basing on data: x: 0.25, 1, 4, 10, 20. y: 0, 0.5, 1 z1 (for y = 0): 45, 35, 25, 15, 10. z2 (for y = 0.5): 50, 45, 36, 21, 17. z3 (for y = 1): 37, 34, 22, 17, 11? z-values should be scaled in colour (e. g. from red to blue). I consider to use

[R] can anybody give suggestion on how to use survreg with 3-parameter weibull

2009-10-13 Thread Josephine Sari
Hi, I am a beginner in R. I would like to know if there is any trick in using survreg with 3-parameter weibull? I would like to do survival analysis of failure time but not using the 2-parameter weibull which is available as one of the options in the survreg but instead I would like to see

[R] decostand

2009-10-13 Thread Rosa Manrique
Hi: I do not know why the function decostand is not found in my vegan library, I have downloaded the package recently, and it seems to work well..Do you have any suggestion? Rosa. [[alternative HTML version deleted]] __ R-help@r-project.org

Re: [R] Introduction to mark-recapture analysis in R?

2009-10-13 Thread Jeff Laake
Another package that is not on CRAN or other R depository is RMark. It works with the software MARK which does the computation. You can find RMark at http://www.phidot.org/software/mark/rmark/ and MARK from http://www.phidot.org/software/mark/index.html From the same site you'll find a very

Re: [R] Introduction to mark-recapture analysis in R?

2009-10-13 Thread Kingsford Jones
see https://stat.ethz.ch/pipermail/r-sig-ecology/2008-May/000160.html hth, Kingsford On Tue, Oct 13, 2009 at 6:00 AM, Anne-Katrin Link anne.l...@gmx.de wrote: Normal        0        21                        false        false false MicrosoftInternetExplorer4 Dear R-helpers,          I

Re: [R] lapply() reccursively

2009-10-13 Thread Charles C. Berry
On Tue, 13 Oct 2009, Kaveh Vakili wrote: Hi all, I was wondering whether it is possible to use the lapply() function to alter the value of the input, something in the spirit of : a1-runif(100) a2-function(i){ a1[i]-a1[i-1]*a1[i];a1[i] } a3-lapply(2:100,a2) Something akin to a for() loop,

Re: [R] Selecting initial numerals

2009-10-13 Thread Dieter Menne
PDXRugger wrote: II just want to create a new object with the first two numerals of the data. Not sure why this isnt working, consider the following: EmpEst$naics=c(238321, 624410, 484121 ,238911, 81, 531110, 621399, 541613, 524210 ,236115 ,811121 ,236115 ,236115 ,621610 ,814110

[R] replacing period with a space

2009-10-13 Thread Dimitri Liakhovitski
Dear R-ers! I have x as a variable in a data frame x. x-data.frame(x=c(aa.bb,cc.dd.ee)) x$x-as.character(x$x) x I am sorry for such a simple question - but how can I replace all periods in x$x with spaces? sub('.', ' ', x$x) - removes all letters to the left of each period... Thanks a lot for

Re: [R] replacing period with a space

2009-10-13 Thread Sarah Goslee
As you've discovered, the . means something special in regular expressions (and R's version of them). You need to escape it with \\: x-data.frame(x=c(aa.bb,cc.dd.ee)) x$x-as.character(x$x) x x 1aa.bb 2 cc.dd.ee sub(\\., , x$x) [1] aa bbcc dd.ee gsub(\\., , x$x) [1] aa bb

Re: [R] replacing period with a space

2009-10-13 Thread Henrique Dallazuanna
You need escape the period: gsub(\\., , x$x) On Tue, Oct 13, 2009 at 2:26 PM, Dimitri Liakhovitski ld7...@gmail.com wrote: Dear R-ers! I have x as a variable in a data frame x. x-data.frame(x=c(aa.bb,cc.dd.ee)) x$x-as.character(x$x) x I am sorry for such a simple question - but how can

Re: [R] replacing period with a space

2009-10-13 Thread Dimitri Liakhovitski
Thanks a lot for your help, Henrique and Sarah! Dimitri On Tue, Oct 13, 2009 at 1:37 PM, Sarah Goslee sarah.gos...@gmail.com wrote: As you've discovered, the . means something special in regular expressions (and R's version of them). You need to escape it with \\:

Re: [R] decostand

2009-10-13 Thread Jorge Ivan Velez
Hi Rosa, It works for me on an R-fresh session: require(vegan) Loading required package: vegan This is vegan 1.15-4 ?decostand sessionInfo() R version 2.9.2 RC (2009-08-23 r49375) i386-pc-mingw32 locale: LC_COLLATE=English_United States.1252;LC_CTYPE=English_United

Re: [R] lapply() reccursively

2009-10-13 Thread Kaveh Vakili
Thanks, Chuck's answer is the closest to what i want (gives the same result as cumprod()) ...but using this function seems actually slower than the loop (is it normal ?): a1-runif(10) cadd-function(x) Reduce(*, x, accumulate = TRUE) looop-function(a1){ j-length(a1) for(i in 2:j){

[R] How to specify an ARMA(1, [1,4]) model?

2009-10-13 Thread Len Vir
Hi, I'm trying to model an ARMA(1,[1,4]), i.e. I want only lags 1 and 4 of the Moving Average part. It's the '[1,4]' part that is giving me a problem. I've tried different arma's and arima's in different packages, namely: packages tseries, fArma, FinTS, timeSeries, TSA, Zelig, ds1, forecast

Re: [R] How to specify an ARMA(1, [1,4]) model?

2009-10-13 Thread Duncan Murdoch
On 10/13/2009 2:35 PM, Len Vir wrote: Hi, I'm trying to model an ARMA(1,[1,4]), i.e. I want only lags 1 and 4 of the Moving Average part. It's the '[1,4]' part that is giving me a problem. I've tried different arma's and arima's in different packages, namely: packages tseries, fArma, FinTS,

Re: [R] replacing period with a space

2009-10-13 Thread Jason Rupert
Here is one more that works: gsub(., ,Start.Time, fixed = TRUE) fixed = TRUE really helps in a lot of instances for removing specific characters without accidently angering the regular expression gods. Enjoy. --- On Tue, 10/13/09, Dimitri Liakhovitski ld7...@gmail.com wrote: From:

Re: [R] time grid for survfit Survival function outputs

2009-10-13 Thread David Winsemius
On Oct 13, 2009, at 12:03 PM, Muhtar Osman wrote: Dear All, Maybe it is a silly question. But I wasn't able to find it from manual or R site search. After library(survival) , the description of survfit objects will be found with: ?survfit.object I was wondering what is the

[R] Greater than less than in ifelse

2009-10-13 Thread Richardson, Patrick
I'm trying to categorize a continuous variable (yes, I know that's horrible, but I'm trying to reproduce some exercises from a textbook) and don't really know an efficient way to do this. I have a data frame that looks like: surv_time relapse sex log_WBC rx 1 35 0 11.45

Re: [R] Greater than less than in ifelse

2009-10-13 Thread Jorge Ivan Velez
Dear Patrick, Take a look at ?cut for some ideas. HTH, Jorge On Tue, Oct 13, 2009 at 3:37 PM, Richardson, Patrick wrote: I'm trying to categorize a continuous variable (yes, I know that's horrible, but I'm trying to reproduce some exercises from a textbook) and don't really know an

Re: [R] Greater than less than in ifelse

2009-10-13 Thread Henrique Dallazuanna
Try this: with(anderson, cut(log_WBC, c(0, 2.3, 3, max(log_WBC)), labels = c('low', 'medium', 'high'))) On Tue, Oct 13, 2009 at 4:37 PM, Richardson, Patrick patrick.richard...@vai.org wrote: I'm trying to categorize a continuous variable (yes, I know that's horrible, but I'm trying to

Re: [R] vis.gam() contour plots

2009-10-13 Thread Gavin Simpson
On Mon, 2009-10-12 at 22:20 -0400, David Winsemius wrote: On Oct 12, 2009, at 8:20 PM, Jason Gasper wrote: snip / # contour examples vis.gam(g, view=c(x1,x2),plot.type=contour,color=heat, nlevels=20) Warning messages: 1: In plot.window(...) : nlevels is not a graphical parameter 2: In

Re: [R] decostand

2009-10-13 Thread Gavin Simpson
On Tue, 2009-10-13 at 17:06 +0200, Rosa Manrique wrote: Hi: I do not know why the function decostand is not found in my vegan library, I have downloaded the package recently, and it seems to work well..Do you have any suggestion? Did you load it in your session for use? Try library(vegan)

  1   2   >