search for: ppaarrkk

Displaying 7 results from an estimated 7 matches for "ppaarrkk".

2008 Apr 25
4
Equivalent of Excel pivot tables in R
Can somebody tell me how to do the equivalent of a pivot table in R ? For example, if I have : var1 var2 var3 a x 10 b y 20 a z 10 b z 20 a z 10 b z 20 I could have : x y z a 1 0 2 b 0 1 2 where entries in the table are counts of var3.
2008 Dec 09
3
Selecting rows that are the same in separate data frames
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 = as.data.frame ( matrix ( c ( 2,3,4,7,8,9 ), ncol = 2 ) ) b a[a==b] Any ideas please.
2009 Jan 13
2
Re ad a text file from a directory in which an R script finds itself
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-finds-itself-tp21434236p21434236.html Sent from the R help mailing list archive at Nabble.com.
2008 Jan 16
3
using an element of an array as a new object
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, filesBox[4,1], sep=""), header = FALSE) But this doesn't
2008 Nov 29
2
Using grep() to subset lines of text
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] = "2 aaa" b[3] = "3 aaa" b[4] = "aaa 3 aaa"
2008 Feb 07
1
How do you refer to the row above in a data frame ?
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 archive at Nabble.com.
2008 Oct 23
1
save an object of class "im"
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: http://www.nabble.com/save-an-object-of-class-%22im%22-tp20134567p20134567.html Sent from