[R] Flowlines from contours

2009-09-15 Thread ppaarrkk
Is it possible to derive flowlines from contours ? -- View this message in context: http://www.nabble.com/Flowlines-from-contours-tp25451633p25451633.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list ht

[R] Equivalent of Excel pivot tables in R

2008-04-25 Thread ppaarrkk
Can somebody tell me how to do the equivalent of a pivot table in R ? For example, if I have : var1var2 var3 a x10 b y20 a z10 b z20 a z10 b z20 I could have : x y z a

[R] using an element of an array as a new object

2008-01-16 Thread ppaarrkk
I have an array called filesBox. I want to take each element of the first column and assign a dataset to it. For example : filesBox[4,1] returns [1] "fileR" Then I want to assign "fileR" which exists as a text file to the R object "fileR" like this : filesBox[4,1] <- read.table(paste(dir2, fi

Re: [R] using an element of an array as a new object

2008-01-17 Thread ppaarrkk
Thankyou for the replies. assign() works. for (i in 1:7) assign(filesBox[i,1],read.table(paste(dir2, filesBox[i,1], sep=""), header = FALSE)) -- View this message in context: http://www.nabble.com/using-an-element-of-an-array-as-a-new-object-tp14884435p14917349.html Sent from the R help mail

[R] save an object of class "im"

2008-10-23 Thread ppaarrkk
I have created various "im" objects, but can't seem to save and load them. I can save them, but as small files of less than 1Kb. Therefore, when they are re-loaded, they cannot be plotted as images. Any ideas please. Thankyou. Simon Parker Imperial College -- View this message in context: htt

Re: [R] save an object of class "im"

2008-10-24 Thread ppaarrkk
suggestions > without a workable example of the commands you used. > > Sarah > > On Thu, Oct 23, 2008 at 12:26 PM, ppaarrkk <[EMAIL PROTECTED]> wrote: >> >> I have created various "im" objects, but can't seem to save and load >> them. I >> c

[R] Re ad a text file from a directory in which an R script finds itself

2009-01-13 Thread ppaarrkk
Is it possible for an R script to read a text file, say, from the directory in which the script is located ? I don't think I can use setwd(), because I can't specify the directory. -- View this message in context: http://www.nabble.com/Read-a-text-file-from-a-directory-in-which-an-R-script-find

[R] Use of [:alnum:] or . in gsub() etc..

2009-01-16 Thread ppaarrkk
test = c ( "AAABBB", "CCC" ) This works : gsub ( "[A-Z]", "2", test ) None of these do : gsub ( "[A-Z]", [:alnum:], test ) gsub ( "[A-Z]", [[:alnum:]], test ) gsub ( "[A-Z]", "[:alnum:]", test ) gsub ( "[A-Z]", "[[:alnum:]]", test ) gsub ( "[A-Z]", "^[:alnum:]$", test ) What am I doing

[R] How do you refer to the row above in a data frame ?

2008-02-07 Thread ppaarrkk
You have a two-dimensional data frame. Columns is easy, say col4 <- col3 - col2 How do you do row3 <- row2 +1 for example. -- View this message in context: http://www.nabble.com/How-do-you-refer-to-the-row-above-in-a-data-frame---tp15336933p15336933.html Sent from the R help mailing list a

[R] Using grep() to subset lines of text

2008-11-29 Thread ppaarrkk
I have two vectors, a and b. b is a text file. I want to find in b those elements of a which occur at the beginning of the line in b. I have the following code, but it only returns a value for the first value in a, but I want both. Any ideas please. a = c(2,3) b = NULL b[1] = "aaa 2 aaa" b[2] =

[R] Selecting rows that are the same in separate data frames

2008-12-09 Thread ppaarrkk
I want to compare two matrices or data frames and select or get an index for those rows which are the same in both. I have tried the following : a = matrix ( 1:10, ncol = 2 ) a b = matrix ( c ( 2,3,4,7,8,9 ), ncol = 2 ) b a[a==b] a = as.data.frame ( matrix ( 1:10, ncol = 2 ) ) a b =

Re: [R] Selecting rows that are the same in separate data frames

2008-12-09 Thread ppaarrkk
whole of a, but to mark those rows which are also in b. If I do merge ( a,b ), I just get b. If I do merge ( a,b, all.x =TRUE), I get a. bartjoosen wrote: > > I'm not sure what you want, but take a look at ?merge and %in% > > > ppaarrkk wrote: >> >> I want t