Re: [R] matrix multiplication question

2008-07-18 Thread Tsjerk Wassenaar
Hi Murali, So, the solution to your problem will be to explicitly convert your matrix to a numeric matrix. Maybe matrix (?matrix) will do, or you'll also have to use as.numeric (?as.numeric). The strings on the left seem to me to be the row labels, right..?, not elements in the matrix/table. As

[R] function eigen AND Minitab

2008-07-18 Thread SH.Chou
Hi all. I got a question about eigenvector. I've tried input a symmetric matrix to both R (using eigen function) and minitab, but the result is really different. Can anyone tell me what's wrong with that? Thanks. [[alternative HTML version deleted]]

[R] Installation of garchOxFit

2008-07-18 Thread Charlotte Falk Mogensen
Hi,   My question is how I load the package garchOxFit. I load the fGarch function that works quite well, but I can't use the garchOxFit function. I have tried looking at Help(garchOxFit), I as far as I can understand I am supposed to download the OxConsole Software together with the OxGarch

[R] column wise paste of data.frames

2008-07-18 Thread Sebastian Weber
Hi everybody! I'm sure that I overlook something and feel quite stupid to ask, but I have not found an easy solution to the following problem: Take e.g. the Orthodont data from the nlme package: head(Orthodont) Grouped Data: distance ~ age | Subject distance age Subject Sex 1 26.0 8

Re: [R] function eigen AND Minitab

2008-07-18 Thread Bill.Venables
Simple. Minitab must be broken. Have you reported it to them? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of SH.Chou Sent: Friday, 18 July 2008 5:24 PM To: r-help@r-project.org Subject: [R] function eigen AND Minitab Hi all. I got a question about

Re: [R] column wise paste of data.frames

2008-07-18 Thread Dimitris Rizopoulos
try this: data(Orthodont, package = nlme) metaFields - c(Subject, Sex) Orthodont$ID - do.call(paste, c(Orthodont[metaFields], sep = /)) I hope it helps. Best, Dimitris Dimitris Rizopoulos Biostatistical Centre School of Public Health Catholic University of Leuven Address:

Re: [R] column wise paste of data.frames

2008-07-18 Thread Patrick Burns
do.call('paste', c(data.frame(letters, LETTERS), list(sep='/'))) Patrick Burns [EMAIL PROTECTED] +44 (0)20 8525 0696 http://www.burns-stat.com (home of S Poetry and A Guide for the Unwilling S User) Sebastian Weber wrote: Hi everybody! I'm sure that I overlook something and feel quite

Re: [R] function eigen AND Minitab

2008-07-18 Thread Patrick Burns
Or perhaps it is the idea of different that is broken. If you are doing the same problem, then the eigenvalues should be equal in the two systems -- up to numerical error. If that is true, then the eigenvectors for each distinct eigenvalue need to span the same space. Thus the eigenvectors can

Re: [R] probleme with R CMD check

2008-07-18 Thread Christophe Genolini
Hi the list, Back on an old problem. I thaught that was ok, but it is still not working on my computer. I write a toy package called packClassic. R CMD build packClassic works fine. When I run R CMD CHECK packClassic, I get --- 8 --- * checking for unstated dependencies in R code

[R] Equation sequencing

2008-07-18 Thread Stuart Nettleton
Hello, Would anyone be able to help me find an algebraic equation sequencer (like Knuth's topological processor) that will order a system of equations for nonlinear optimization similar to GAMS/AMPL? eg A[t]=A[t-1]+B[t] with perhaps sum(A) to be optimised by changing B[t] and other

Re: [R] probleme with R CMD check

2008-07-18 Thread Martin Maechler
CG == Christophe Genolini [EMAIL PROTECTED] on Fri, 18 Jul 2008 11:14:25 +0200 writes: CG Hi the list, CG Back on an old problem. I thaught that was ok, but it is still not CG working on my computer. CG I write a toy package called packClassic. R CMD build packClassic works

Re: [R] matrix multiplication question

2008-07-18 Thread Doran, Harold
Once you get your matrices in order you do not want to use t(X) %*% X. Instead, use crossprod(X). They do the same thing, but the former is the matrix operations based on the algebraic representation whereas numerical analysts will prefer the methods used in crossprod (hence the reason it

[R] t-test for multiple variables

2008-07-18 Thread Henning Wildhagen
Dear list, i try to do my first statistics with R. Given a dataframe of three columns, where col1 is of type factor, col 2 and col3 are numeric and pairs of observations i would like to perform a paired t-test for each level of col1. I would like to avoid specifying the levels of col1 manually

Re: [R] REvolution computing

2008-07-18 Thread Gregory R. Warnes
Hi All, Random Technologies LLC’s commercially supported Rstat, based on R 2.7.2, is available today. For product information, visit http://www.random -technologies-llc. -Greg Gregory R. Warnes, Ph.D. Chief Scientist Random Technologies LLC email: [EMAIL PROTECTED] tel:(585)

Re: [R] t-test for multiple variables

2008-07-18 Thread Simon Anders
Hi Henning, Henning Wildhagen wrote: Given a dataframe of three columns, where col1 is of type factor, col 2 and col3 are numeric and pairs of observations i would like to perform a paired t-test for each level of col1. I would like to avoid specifying the levels of col1 manually because it

[R] finding chuncks of data that have no NA s

2008-07-18 Thread stephen sefick
I have a data frame that is 122 columns and 7ish rows it is a zoo object, but could be easily converted or read in as something else. It is multiparameter multistation water quality data - there are a lot of NA s. I would like to find chuncks of data that are free of NA s to do some

[R] RStat version 2.7.2 now available

2008-07-18 Thread Gregory R. Warnes
Random Technologies LLC is pleased to announce immediate availability of RStat version 2.7.2. This version of RStat provides the features of the latest version of R from the R-project with with enterprise-level validation, documentation, software support, and consulting services from

Re: [R] Matching Up Values

2008-07-18 Thread Steve Murray
I think the approach is ok. I'm having difficulties though...! I've managed to get 'merge' working (using the 'all' function as suggested), but for some strange reason, the output file produces 12 extra rows! So now the shorter file isn't the same length as the 'master' file, it's now longer!

Re: [R] t-test for multiple variables

2008-07-18 Thread Henning Wildhagen
Hi Simon, i tried your code, but it results in an error: error in var(x) : `x` is empty Do you have an idea what the reason might be? Thanks a lot, Henning Original-Nachricht Datum: Fri, 18 Jul 2008 11:37:24 +0100 Von: Simon Anders [EMAIL PROTECTED] An:

Re: [R] REvolution computing

2008-07-18 Thread Uwe Ligges
Gregory R. Warnes wrote: Hi All, Random Technologies LLC’s commercially supported Rstat, based on R 2.7.2, is available today. For product information, visit http://www.random -technologies-llc. Hi Greg, two short questions on your very interesting product: 1. How can it be based on

[R] name returned by lapply

2008-07-18 Thread Antje
Hi there, I have a very simple question. If I execute the following code: test - function(x) { name - paste(x,info_within_function) c(1,2,3,4,5) } ret - lapply(1:10, test) , I end up with a list and each entry is just numbered [[1]], [[2]], ... [[10]] How can I force the

[R] Correction: RStat version 2.7.*1* now available

2008-07-18 Thread Gregory Warnes
Hello Everyone, I mis-typed the version number in the annoucement that just went out. Here is the corrected message: On Fri, Jul 18, 2008 at 6:50 AM, Gregory R. Warnes [EMAIL PROTECTED] wrote: Random Technologies LLC is pleased to announce immediate availability of RStat version 2.7.1.

Re: [R] name returned by lapply

2008-07-18 Thread Gavin Simpson
On Fri, 2008-07-18 at 13:45 +0200, Antje wrote: Hi there, I have a very simple question. If I execute the following code: test - function(x) { name - paste(x,info_within_function) c(1,2,3,4,5) } Here your test is returning c(1,2,3,4,5), and is doing nothing with name,

Re: [R] finding chuncks of data that have no NA s

2008-07-18 Thread Gabor Grothendieck
na.contiguous.zoo() will return the longest stretch of non-NA data. Its a zoo method of the na.contiguous generic in the core of R. rle(!is.na(rowSums(coredata(z will find all stretches. On Fri, Jul 18, 2008 at 6:47 AM, stephen sefick [EMAIL PROTECTED] wrote: I have a data frame that is 122

Re: [R] name returned by lapply

2008-07-18 Thread Antje
Hi Gavin, thanks a lot for your answer. Maybe I did not explain very well what I want to do and probably chose a bad example. I don't mind spaces or names starting with a number. I could even name it: Hugo1, Hugo2, ... My biggest problem is, that not only the values are calculated/estimated

Re: [R] probleme with R CMD check

2008-07-18 Thread cgenolin
CG --- 8 - 00check.log -- CG * using log directory 'C:/Documents and Settings/Christophe/Mes CG documents/Docs articles polys résumés/R/tutorial S4/packClassic.Rcheck' I see many directories with spaces ( ) inside. This used to cause all kind of problems

[R] generate repeats of a vector's elements

2008-07-18 Thread Chaofeng Kou
Dear all, I have got a question for generating repeats of a vector's elements. Please don't hesitate to email me back and say that it is very easy although I can't find a method to solve it. If I have a n-vector b, whose elements are b[1], b[2], ..., b[n], how can I generate such a vector

Re: [R] generate repeats of a vector's elements

2008-07-18 Thread Dimitris Rizopoulos
try this: b - rnorm(4) ind - unlist(lapply(seq_along(b), seq_len)) b b[ind] I hope it helps. Best, Dimitris Dimitris Rizopoulos Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32/(0)16/336899 Fax:

Re: [R] finding chuncks of data that have no NA s

2008-07-18 Thread stephen sefick
#how do I use the below, sorry for being unsavey. I would look for when value = FALSE meaning the there are no NAs and Then look for the longest value of continuous measurements (or lengths that I am comfortable with) correct? How do I subset my original data frame with this information? How do

[R] Change font-face in title

2008-07-18 Thread Albin Blaschka
Dear List, Is there a possibility to change the font-face for a part of the title of a plot? For example I have the following... plot(nirs, type=l, xlab=Wellenlänge [nm], col=darkslategray, main = Spektrum Deschampsia caespitosa) ...and I would like to change the part of the

Re: [R] finding chuncks of data that have no NA s

2008-07-18 Thread Gabor Grothendieck
It would be appreciated if you cut down your data to a minimal size before posting. At any rate, the ends are the cumsums of the lengths and the starts are lengths-1 before that, e.g. # data library(zoo) z - zoo(c(1, 2, NA, 3, 4, 5, NA, 6)) z - cbind(z, z) z.rle -

Re: [R] name returned by lapply

2008-07-18 Thread Gavin Simpson
On Fri, 2008-07-18 at 14:19 +0200, Antje wrote: Hi Gavin, thanks a lot for your answer. Maybe I did not explain very well what I want to do and probably chose a bad example. I don't mind spaces or names starting with a number. I could even name it: Hugo1, Hugo2, ... My biggest

[R] Reading SPSS .por files

2008-07-18 Thread Jose Iparraguirre D'Elia
Does anyone know how to read SPSS .por (ie Portable) files? The foreign package only deals with SPSS .sav files and not with those with a por extension. Thanks, José Mr José Luis Iparraguirre D'Elia Senior Research Economist Economic Research Institute of Northern Ireland Floral

Re: [R] generate repeats of a vector's elements

2008-07-18 Thread Antje
I would do it like this but I'm curious to see whether it can be easier solved :-) b - c(1:10) vector_list - lapply(1:length(b), FUN = function(x) { b[1:x] })) (for everything in a large vector just apply unlist to the vector_list) Antje Chaofeng Kou schrieb: Dear all, I have got a

[R] only T becomes logical colum with read.table

2008-07-18 Thread Luis F
Hello, I am a biologist and I am dealing with files composed of columns with T or A or C or G (example below) Sometimes a column is composed of only T and in that case, the columns becomes a logical column TRUE (example below) I know that the argument as.is controls the turns off turning a

Re: [R] name returned by lapply

2008-07-18 Thread Antje
Thanks a lot for your help! I know that I cannot directly access the list created, I just was not sure if there is any format of the return value which could provide additionally a name for the returned list. I tried to return the values as list with the appropriate name but then I end up

Re: [R] finding chuncks of data that have no NA s

2008-07-18 Thread stephen sefick
minimal, minimal, minimal, I will have to remind myself. contiguous.zoo - function(x) { z.rle - rle(!is.na(rowSums(coredata(x # row indexes ends - cumsum(z.rle$lengths) starts - ends - z.rle$lengths + 1 indexes - with(z.rle, data.frame(starts, ends, lengths, values)) indexes.sort -

[R] errors using step function

2008-07-18 Thread silvia narduzzi
Dear R users, I have had a problem using the step function for the selection of the variables from a gamma model with log link function. CODE: step.glm.gam1.infroma - step(glm.gam1.infroma, direction = backward, k=2) ERROR MESSAGE: Error in glm.fit(x[, jj, drop = FALSE], y, wt, offset =

[R] source code functions

2008-07-18 Thread stephen sefick
na.contiguous function (object, ...) UseMethod(na.contiguous) environment: namespace:stats this is what I get when I look for the source code for some functions- Is there a way to look at the source code? -- Let's not spend our time and resources thinking about things that are so little or so

Re: [R] Reading SPSS .por files

2008-07-18 Thread Prof Brian Ripley
On Fri, 18 Jul 2008, Jose Iparraguirre D'Elia wrote: Does anyone know how to read SPSS .por (ie Portable) files? The foreign package only deals with SPSS .sav files and not with those with a por extension. Not so. ?read.spss says 'read.spss' reads a file stored by the SPSS 'save' or

Re: [R] source code functions

2008-07-18 Thread Henrique Dallazuanna
This is a S3 method, then: methods(na.contiguous) getS3method(na.contiguous, data.frame) getS3method(na.contiguous, zoo) On Fri, Jul 18, 2008 at 10:37 AM, stephen sefick [EMAIL PROTECTED] wrote: na.contiguous function (object, ...) UseMethod(na.contiguous) environment: namespace:stats

[R] creating names for lists

2008-07-18 Thread tolga . i . uzuner
Dear R Users, How can I create names for lists within a function where the name itself is a function of several variables ? a-1 b-2 paste(a,b) [1] 1 2 foo-list(paste(a,b)=3) = DOES NOT WORK Error: unexpected '=' in foo-list(paste(a,b)= eval(paste(a,b)) [1] 1 2

Re: [R] creating names for lists

2008-07-18 Thread Henrique Dallazuanna
Try: foo - list(3) names(foo) - paste(a, b) On Fri, Jul 18, 2008 at 11:03 AM, [EMAIL PROTECTED] wrote: Dear R Users, How can I create names for lists within a function where the name itself is a function of several variables ? a-1 b-2 paste(a,b) [1] 1 2 foo-list(paste(a,b)=3) =

Re: [R] name returned by lapply

2008-07-18 Thread Antje
Oh true, this would solve the problem too :-) Thanks a lot for the suggestions! Antje Martin Morgan schrieb: Antje [EMAIL PROTECTED] writes: Thanks a lot for your help! I know that I cannot directly access the list created, I just was not sure if there is any format of the return value

[R] A neural network problem---neuralnet package

2008-07-18 Thread Shubha Vishwanath Karanth
Hi R, Here's a question/problem on the 'neuralnet' package for neural networks. I have more than 50 factors in each of my independent variables. When I apply the command 'neuralnet', I get the below warning message, net.sum - neuralnet( Sum~Var1+Var2+Var3, b, hidden=0,linear.output=TRUE)

Re: [R] Problem with TLC/TK on Ubuntu

2008-07-18 Thread Roland Rau
Hi Davide, did you check the R Installation and Administration Manual? In Section A.2.1 you will find some more information. Make sure that you have the 'dev' packages installed of tcl8.x and tk8.x. If you don't know where 'tclConfig.sh' and 'tkConfig.sh' are located, just find them: locate

Re: [R] smooth.spline

2008-07-18 Thread Roland Rau
Spencer Graves wrote: I found the first chapter of Paul Dierckx (1993) Curve and Surface Fitting with Splines (Oxford U. Pr.). Beyond that, I've learned a lot from the 'fda' package and the two companion volumes by Ramsay and Silverman (2006) Functional Data Analysis, 2nd ed. and (2002)

Re: [R] Reading SPSS .por files

2008-07-18 Thread Prof Brian Ripley
On Fri, 18 Jul 2008, Jose Iparraguirre D'Elia wrote: Thanks Brian, The error message reads as follows: Error in read.spss(G:/Jose/Life and Times Survey/LT 2007/nilt07w1.por) : error reading portable-file dictionary So it looks like it is not a portable file, or at least one that read.spss

Re: [R] creating names for lists

2008-07-18 Thread tolga . i . uzuner
Many thanks, much appreciated. Henrique Dallazuanna [EMAIL PROTECTED] 18/07/2008 15:11 To [EMAIL PROTECTED] cc r-help@r-project.org Subject Re: [R] creating names for lists Try: foo - list(3) names(foo) - paste(a, b) On Fri, Jul 18, 2008 at 11:03 AM, [EMAIL PROTECTED] wrote: Dear R

[R] Landscape mode for pdf

2008-07-18 Thread tolga . i . uzuner
Dear R Users, I would like to get the pdf() command to create graphics in landscape mode, as I am plotting 8 graphs in 2 rows and 4 columns. This is being generated for an a4 printer (so I also use the paper=a4 command). Is there a way I can ask pdf() to generate the document in landscape mode

[R] manipulate a matrix2

2008-07-18 Thread Jon Hak
Building upon Jim's answer below (Thanks Jim, that helped a lot), I need to pickup where this thread left off. I'm using Vegan to calculate the Jaccard's Index and the Row.Names and column names are represented in my matrix as seen here. [,3] [,5] [,6] [,9] [,11] [3,]06 11

Re: [R] smooth.spline

2008-07-18 Thread Spencer Graves
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. I do NOT know how to do what you want, but with a self-contained example, I suspect many people on this list -- probably including me --

Re: [R] Reading SPSS .por files

2008-07-18 Thread Prof Brian Ripley
On Fri, 18 Jul 2008, Jose Iparraguirre D'Elia wrote: However, it can be read in SPSS. The file is available on the web, as it corresponds to the raw database of the Northern Ireland Life and Times Survey 2007 (http://www.ark.ac.uk/nilt/datasets/). It is a file that SPSS recognises; albeit

Re: [R] REvolution computing

2008-07-18 Thread Charles Annis, P.E.
Hi, Greg: Have you answered Uwe's question? I visited your website, and your idea sounds interesting. I'm an engineer, not a lawyer, but it seems to me that what you have IS in accord with the GPL - provided that that you make the R source available as Uwe asks. So: what's the answer to Uwe's

Re: [R] manipulate a matrix2

2008-07-18 Thread jim holtman
Is this what you want: x [,3] [,5] [,6] [,9] [,11] [,3] 16 11 1621 [,5] 27 12 1722 [,6] 38 13 1823 [,9] 49 14 1924 [,11]5 10 15 2025 library(reshape) melt(x) X1X2 value 1 [,3] [,3] 1 2 [,5]

[R] cbind help

2008-07-18 Thread Rajasekaramya
hi there, I need to change a column name in a dataframe.how do i do that eg abc- dataframe abc x y z i wanna change the colum z to w. Ramya -- View this message in context: http://www.nabble.com/cbind-help-tp18532609p18532609.html Sent from the R help mailing list archive at Nabble.com.

[R] re ad and check table

2008-07-18 Thread mysimbaa
Dear R users, I want to read a file like following : if it is a table then z - read.table(pathname, dec=., header=TRUE) else if it's not a table (image,doc,...) then send an error or something like that acually I have a read.table in the beginnig of my R code, and if my data is not a table I

Re: [R] cbind help

2008-07-18 Thread Henrique Dallazuanna
Try: names(abc)[3] - w On Fri, Jul 18, 2008 at 1:08 PM, Rajasekaramya [EMAIL PROTECTED] wrote: hi there, I need to change a column name in a dataframe.how do i do that eg abc- dataframe abc x y z i wanna change the colum z to w. Ramya -- View this message in context:

Re: [R] Reading SPSS .por files

2008-07-18 Thread Jose Iparraguirre D'Elia
However, it can be read in SPSS. The file is available on the web, as it corresponds to the raw database of the Northern Ireland Life and Times Survey 2007 (http://www.ark.ac.uk/nilt/datasets/). It is a file that SPSS recognises; albeit the foreign package doesn't -hence my initial query. José

Re: [R] re ad and check table

2008-07-18 Thread Henrique Dallazuanna
Maybe something like this: stopifnot(tail(unlist(strsplit(slides.pdf, \\.)), 1) == txt) On Fri, Jul 18, 2008 at 12:51 PM, mysimbaa [EMAIL PROTECTED] wrote: Dear R users, I want to read a file like following : if it is a table then z - read.table(pathname, dec=., header=TRUE) else if it's

[R] dataedit

2008-07-18 Thread Stephen Kennedy
To Whom It May Concern: Are there more examples / information regarding the use of 'dataedit'? If so, where might I find these? Regards, Steve Kennedy __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

Re: [R] Landscape mode for pdf

2008-07-18 Thread jim holtman
pdf(file=..., width=10, height=8) On Fri, Jul 18, 2008 at 11:04 AM, [EMAIL PROTECTED] wrote: Dear R Users, I would like to get the pdf() command to create graphics in landscape mode, as I am plotting 8 graphs in 2 rows and 4 columns. This is being generated for an a4 printer (so I also use

Re: [R] Landscape mode for pdf

2008-07-18 Thread Johannes Huesing
[EMAIL PROTECTED] [EMAIL PROTECTED] [Fri, Jul 18, 2008 at 05:04:15PM CEST]: [...] Generally, this communication is for informational purposes only and it is not intended as an offer or solicitation for the purchase or sale of any financial instrument or as an official confirmation of any

Re: [R] REvolution computing

2008-07-18 Thread Warnes, Gregory R.
Hi Charles, The souce code for RStat is included on the distribution DVD, which meets the GPL 2 distribution requirement. We do provide evaluation copies of RStat that are funtionally complete and include the complete source code. Email [EMAIL PROTECTED] if you would like an evaluation copy.

[R] Polynomial Approximation with Exponential Kernel

2008-07-18 Thread CJ Jackson
I'm trying to find an R package that will smooth a line with the polynomial approximation with exponential kernel or PAEK algorithm that is used in ESRI's ArcGIS software. I have a copy of the original paper that provides the algorithm, but I'm not confident in how to code it. The algorithm will

[R] par(din) vs dev.size()

2008-07-18 Thread Sarah Goslee
Hello, I was messing around with graphics, and noted an odd behavior of par(din). If the x11 device is empty, par(din) does not return the correct size if the device has been resized manually. dev.size() works correctly. R version 2.7.1; Fedora 8 # case 1 - empty device x11() dev.size() [1]

Re: [R] histogram plot default

2008-07-18 Thread jim holtman
Doesn't it now? PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. On Thu, Jul 17, 2008 at 8:26 AM, Xin [EMAIL PROTECTED] wrote: Dear All: I am trying to plot a series of data using histogram plot.

[R] How to cut data elements included in a text line

2008-07-18 Thread Christine A.
Hello, assume I have an unstructured text line from a connection. Unfortunately, it is in string format: R x [1] \talpha0\t-0.638\t0.4043\t0.4043\t-2.215\t-0.5765\t-0.137\t501\t2000 How can I extract the data included in this string object x in order to get the elements for the parameter

Re: [R] How to cut data elements included in a text line

2008-07-18 Thread Henrique Dallazuanna
Try this: na.omit(as.numeric(unlist(strsplit(\talpha0\t-0.638\t0.4043\t0.4043\t-2.215\t-0.5765\t-0.137\t501\t2000, \t On Fri, Jul 18, 2008 at 1:44 PM, Christine A. [EMAIL PROTECTED] wrote: Hello, assume I have an unstructured text line from a connection. Unfortunately, it is in string

Re: [R] Reading SPSS .por files

2008-07-18 Thread Peter Dalgaard
Jose Iparraguirre D'Elia wrote: [snip] Thanks Brian, The error message reads as follows: Error in read.spss(G:/Jose/Life and Times Survey/LT 2007/nilt07w1.por) : error reading portable-file dictionary So it looks like it is not a portable file, or at least one that read.spss knows

Re: [R] Landscape mode for pdf

2008-07-18 Thread tolga . i . uzuner
Ah... obvious isn't it ? As always. Many thanks, Tolga jim holtman [EMAIL PROTECTED] 18/07/2008 17:30 To [EMAIL PROTECTED] cc r-help@r-project.org Subject Re: [R] Landscape mode for pdf pdf(file=..., width=10, height=8) On Fri, Jul 18, 2008 at 11:04 AM, [EMAIL PROTECTED] wrote: Dear

[R] Spreading risk in a matrix

2008-07-18 Thread ACroske
I have a binary matrix that represents a map of invasive species risk (1 = infested; 0 = uninfested). It started as a matrix of probabilities (developed in ArcMap) that I converted to binary with this R code:

Re: [R] How to cut data elements included in a text line

2008-07-18 Thread Jorge Ivan Velez
Dear Christine, Try x=\talpha0\t-0.638\t0.4043\t0.4043\t-2.215\t-0.5765\t-0.137\t501\t2000 res=unlist(strsplit(x,[\t])) as.numeric(res[-c(1,2,length(res)-1,length(res))]) HTH, Jorge On Fri, Jul 18, 2008 at 12:44 PM, Christine A. [EMAIL PROTECTED] wrote: Hello, assume I have an

[R] using which to identify a range of values

2008-07-18 Thread sj
Hello, I am trying to identify values that fall within a certain range. I thought that I might be able to use the which function to do this but I have been unable to figure out a way to do it. Perhaps a little code will illustrate what i am trying to do. a - rnorm(1000, 100, 50) which( 100 a =

Re: [R] How to cut data elements included in a text line

2008-07-18 Thread Gabor Grothendieck
strapply in gsubfn finds matches of the indicated regexp, in this case a \t followed by one or more minus, dot or digit, and with backref of -1 it passes the backreference, i.e. portion of the match within (..), to the function in the third arg. See http://gsubfn.googlecode.com library(gsubfn)

Re: [R] using which to identify a range of values

2008-07-18 Thread Henrique Dallazuanna
Try : which(a 100 a= 120) On Fri, Jul 18, 2008 at 3:42 PM, sj [EMAIL PROTECTED] wrote: Hello, I am trying to identify values that fall within a certain range. I thought that I might be able to use the which function to do this but I have been unable to figure out a way to do it. Perhaps a

Re: [R] using which to identify a range of values

2008-07-18 Thread Sebastian P. Luque
On Fri, 18 Jul 2008 11:42:09 -0700, sj [EMAIL PROTECTED] wrote: [...] a - rnorm(1000, 100, 50) which( 100 a = 200) of course this doesn't work but illustrates what I ma trying to do, If anyone has suggestions I would greatly appreciate it Have a look at ? -- Seb

[R] Functions similar to step() and all.effects() that work for lme() objects?

2008-07-18 Thread Jon Zadra
Hello, I make frequent use of the *step()* and, for plotting, *all.effects() *functions for *lm()* objects. I am now doing more with *lme()* random effects models, and haven't been able to find functions similar to *step()* or *all.effects()* which will accept *lme()* objects. Do similar

Re: [R] Spreading risk in a matrix

2008-07-18 Thread ONKELINX, Thierry
Have a look at the buffer function in the adehabitat package. HTH, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest Cel biometrie, methodologie en

[R] Calculating Betweenness - Efficiency problem

2008-07-18 Thread Senthil Purushothaman
Hello, I am calculating 'Betweenness' of a large network using R. Currently, I have the node-node information (City1-City2) in an excel file, present in two columns where column A has City1 and column B has City2 that city1 is connected to. These are the steps that I go through to calculate

Re: [R] using which to identify a range of values

2008-07-18 Thread Julian Burgos
Do simply which(a100 a=200) Julian sj wrote: Hello, I am trying to identify values that fall within a certain range. I thought that I might be able to use the which function to do this but I have been unable to figure out a way to do it. Perhaps a little code will illustrate what i am

[R] spreading the risk

2008-07-18 Thread markleeds
This is for ACroske but I can't find his email so I'll just send it to the list. Hi ACroske: The code below takes a zeros and ones matrix and puts ones in the places you wanted. It can be made shorter ( maybe ?. i haven't thought about that ) but first let me know if that's what you wanted ?

[R] with lapply() how can you retrieve the name of the object

2008-07-18 Thread Andrew Yee
In the following code, I'd like to be able to create a new variable containing the value of the names of the list. a - data.frame(var.1 = 1:5) b - data.frame(var.1 = 11:15) test.list - list(a=a, b=b) # in this case, names(test.list) is a and b # and I'd like to use lapply() so that # I get

Re: [R] with lapply() how can you retrieve the name of the object

2008-07-18 Thread Jorge Ivan Velez
Dear Andrew, It's not the best solution but it does what you need: a - data.frame(var.1 = 1:5) b - data.frame(var.1 = 11:15) test.list - list(a=a, b=b) res=do.call(rbind,test.list) res$var.2=substr(rownames(res),1,1) rownames(res)=NULL res HTH, Jorge On Fri, Jul 18, 2008 at 6:21 PM, Andrew

Re: [R] with lapply() how can you retrieve the name of the object

2008-07-18 Thread jim holtman
Is this what you wanted; you would use the 'names' to get the names in the lapply: lapply(names(test.list), function(x){ + cbind(test.list[[x]], var.2=x) + }) [[1]] var.1 var.2 1 1 a 2 2 a 3 3 a 4 4 a 5 5 a [[2]] var.1 var.2 111 b 212

Re: [R] with lapply() how can you retrieve the name of the object

2008-07-18 Thread jim holtman
forgot one step: z - lapply(names(test.list), function(x){ + cbind(test.list[[x]], var.2=x) + }) names(z) - names(test.list) z $a var.1 var.2 1 1 a 2 2 a 3 3 a 4 4 a 5 5 a $b var.1 var.2 111 b 212 b 313 b 414 b 5

[R] Retrieving data from a tcl /tk function

2008-07-18 Thread Judith Flores
Hello, I am sorry if this is an answered question, but I did my homework for a long while and couldn't figure out a way to retrieve data entry from a model dialog. In one of the examples compiled by James Wettenhall: odalDialog - function(title, question, entryInit, entryWidth = 20,

[R] How to solve systems of nonlinear equations in R?

2008-07-18 Thread François Aucoin
Hey, I was wondering if there existed a R function similar to 'fsolve' or 'fzero' Matlab functions? Thanks! Francois Aucoin [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] Spreading risk in a matrix

2008-07-18 Thread ACroske
How do I use the buffer function since I have more than the two columns it calls for? (I have 46!) -- View this message in context: http://www.nabble.com/%22Spreading-risk%22-in-a-matrix-tp18535227p18537082.html Sent from the R help mailing list archive at Nabble.com.

[R] system time - windows specific problem

2008-07-18 Thread Christophe Dutang
Hi all, I'm currently implementing quasi random generation (torus) on R (package randtoolbox available on CRAN). Even if it is not a great idea, I decided to use the machine time to initiate the seed. So when the seed is not specified by the user, the pkg uses the time machine time.

[R] problem with putting text in outer margins (mtext outer=TRUE)

2008-07-18 Thread Janet Young
Hi there, I'm trying to get some text in the outer margins of my plots and am having trouble - the margin text is overlapping my plots, even though the outer margin I'm trying to put it in is very big. I've simplified my problem down to this: -

Re: [R] problem with putting text in outer margins (mtext outer=TRUE)

2008-07-18 Thread jim holtman
try using the 'line' parameter: par(mfrow=c(6,1),oma=c(20,0,20,0), mar=c(0,3.1,1,2.1)) for (i in 1:6) { plot(cars[,speed],cars[,dist]) } mtext(Position (Mb), outer=TRUE, side=1, line=3) mtext(Position (Mb), outer=TRUE, side=3, line=3) On Fri, Jul 18, 2008 at 7:00 PM, Janet Young [EMAIL

Re: [R] How to solve systems of nonlinear equations in R?

2008-07-18 Thread Stuart Nettleton
Francois You might try the BB package, which has quite a nice example. Stuart On Sat, 19 Jul 2008 10:20:34 +1000, François Aucoin [EMAIL PROTECTED] wrote: Hey, I was wondering if there existed a R function similar to 'fsolve' or 'fzero' Matlab functions? Thanks! Francois Aucoin