similar to: R-how to group the data

Displaying 20 results from an estimated 1000 matches similar to: "R-how to group the data"

2006 Feb 13
2
R-help, specifying the places to decimal
Hello - R-experts, Is there any way with which we can specify the number after decimal point to take. Like I have a situation where the values are comming 0.160325923 but I only want 4 place to decimal say 0.1603. Is there any way for that. I am no expert in R- and this may sound simple to many.sorry Thanks for any help. With Regards Subhabrata
2005 Dec 07
1
ploting the two sets of data side by side
Hello R-users, I am new to R-commands. I have two sets of data: x <- c(7, 7 , 8, 9, 15, 17, 18) y <- c(7, 8, 9, 15, 17, 19, 20, 20, 25, 23, 22) I have used 'cut' command to seperate them as follows a <- cut(x, breaks =c(0,5,10,20,25,30)) b <- cut(y, breaks =c(0,5,10,20,25,30)) > table(a) a (0,5] (5,10] (10,20] (20,25] (25,30] 0 4 3 0
2005 Dec 24
2
grouping data
Hello R-users/experts, I am new to R- I have a simple question: Let say I have a data set as follows temp:[file attached] the data structure is a follows: sex age female 28 female 53 female 53 female 36 male 42 male 29 male 43 male 36 male 41 Here we are grouping all male value into male and all female value in to female
2005 Dec 04
4
Construct a data.frame in a FOR-loop
Say I have a FOR-loop for computing powers (just a trivial example) for(i in 1:5) { x<-i^2 y<-i^3 } How can I create a data.frame and a 3D plot of (i,x(i),y(i)), i.e. for each iteration Thanks, Serguei Kaniovski -- ___________________________________________________________________ ??sterreichisches Institut f??r Wirtschaftsforschung (WIFO) Name: Serguei Kaniovski
2005 Dec 06
2
how to extract row& col names from a matrix
Dear all, I like to extract row names & column names from the named matrix...... like...... a<-matrix(1:6,2) ro<-c("aa","bb") co<-c("dd","ee","ff") dimnames(a)<-list(ro,co) a > dd ee ff aa 1 3 5 bb 2 4 6 from the above matrix "a" I like to extract rownames separately like
2005 Dec 17
1
How to reverse the sequence of axis Y ??
Hello R-users! My (simple?) doubt: How to reverse the sequence of axis Y ?? the diagram below illustrate my idea... (default) | | . | . | . | 3 | 2 | 1 | 0 +---------------------------- 0 1 2 3 ... like I want... 0 | 1 | 2 | 3 | . | . | . | | +---------------------------- 0 1 2 3 ... thanks in advance klebyn
2005 Dec 06
4
R newbie...
Hello, I'm a new user... I have a function : calculate <- function(x,y) { z <- x + y } I would like to use the result (z) with another function : recalculate <- function(...) { a <- z^2 } But R says that z does not exist... How can I use z in an another function ? Thank you for your answer... -- David [[alternative HTML version deleted]]
2005 Nov 04
2
Simplify iterative programming
Dear, I am looking for the simplification of a formula to improve the calculation speed of my program. Therefore I want to simplify the following formula: H = sum{i=0..n-1 , [ sum {j=0..m-1 , sqrt ( (Ai - Bj)^2 + (Ci - Dj)^2) } ] } where: A, C = two vectors (with numerical data) of length n B, D = two vectors (with numerical data) of length m sqrt = square root Ai = element of A with index
2005 Dec 06
2
Writing a list to a file !
Hi All, This may be trivial in R but I have been trying with out any success. I have a list of 100 elements each having a sub list of different length. I would like to write the list to a ASCII file. I tried with write.table(), after converting my list to a matrix. Now it looks like Robert c("90", "50", "30") John c("91", "20",
2005 Dec 15
5
How to simulate correlated data
Hello there, I would like to simulate X --Normal (20, 5) Y-- Normal (40, 10) and the correlation between X and Y is 0.6. How do I do it in R? Thank you very much Lisa Wang Msc. Princess Margaret Hospital Toronto, Ca
2005 Dec 06
2
urgent
Hello R Users, I have two sets of values x <- c(7, 7 , 8, 9, 15, 17, 18) y <- c(7, 8, 9, 15, 17, 19, 20, 20, 25, 23, 22) I am able to create multi histogram using multhist(). But not able to control the 'xlim'. ie the xaxis is showing 7.5, 13, 18, 23 1st on what basis it is calculated 2nd I want it to be like 7 8 9 15 17 and so on Can any one help me With Regards Subhabrata
2005 Nov 28
6
How define global Variable?
Hello, I try to define a global variable. My example: R> a <- "old" R> test <- function () { a <- "new" } R> test() R> a # shoud be "new" This doesn't work. I would like to modify the variable "a" in a procedure. How can I do that. Thank you for helping. Sven Kn侟ppel (Germany-Berlin)
2005 Nov 12
4
matrix subset
Dear R-helpers, I apologize for this certainly simple question. I have the following R lines : > m = matrix(1:12 , 3 , 4); > m [,1] [,2] [,3] [,4] [1,] 1 4 7 10 [2,] 2 5 8 11 [3,] 3 6 9 12 > m1 = subset(m , m[,2]>=5); > m1 [1] 2 3 5 6 8 9 11 12 but in fact I would appreciate m1 to be also a matrix, and thus would like to get :
2004 Mar 19
2
using "unstack" inside my function: that old scope problem again
I've been reading the R mail archives and I've found a lot of messages with this same kind of problem, but I can't understand the answers. Can one of you try to explain this to me? Here's my example. Given a regression model and a variable, I want to use unstack() on the vector of residuals and make some magic with the result. But unstack hates me. PCSE <- function
2009 Nov 15
1
Help with unstack() function
Hi Everyone, I am trying to understand the unstack() function but after struggling for two days, I have given up. More specifically, I am trying the exercises at the end of Chapter 1 of Data Analysis and Graphics Using R by Maindonald and Braun, 2nd ed. Exercise 18 (p. 41) asks to unstack the Rabbit data frame from the MASS package to get a certain data frame that is shown in the exercise.
2006 Feb 10
2
Controling the x or y limit
Hello - R-experts, This may sound simple to many --- We can specify the x limit by saying xlim = c(0, 20) for example. Then the graph will show the range of x -axis between 0 - 20. But the coordinate gap will be automatic like 0 then 5 then 15 and 20. Is there any way by which we can set it in a gap of 2 or any number. Thank you for any help. With Regards Subhabrata [[alternative HTML
2010 Aug 27
1
Error: package/namespace load failed for 'IlluminaHumanMethylation27k.db'
Hello everyone, I have a problem when loading the library: IlluminaHumanMethylation27k.db I installed the package from zip (from the Bioconductor website), and also installed all the packages it asked for. It went all succesfull: "package 'IlluminaHumanMethylation27k.db' successfully unpacked and MD5 sums checked" But when I am trying to load this library I get an error:
2010 Oct 18
1
questions on unstack()
Folks, I have the following dataframe: > x <- structure(list(name = c("EU B", "EU B", "EU B", "EU B", "EU B", "EU B", "AU A", "AU A", "AU A", "AU A", "AU A", "AU A"), date = c("2010-10-11", "2010-10-12", "2010-10-13",
2011 Mar 12
1
Column order in stacking/unstacking
Dear R users, I'm having some problems with the stack() and unstack() functions, and wondered if you could help. I have a large data frame (400 rows x 2000 columns), which I need to reduce to a single column of values (and therefore 800000 rows), so that I can use it in other operations (e.g., generating predictions from a GLM object). However, the problem I'm having can be reproduced
2005 Jun 07
3
Icecast RTP support
Hi, Does Icecast has RTP support for streaming OGG/Vorbis and OGG/theora media files? If so, then please give me some pointers on how to configure my Icecast server to listen to RTP requests. If it's not available, then is the inclusion of this feature, in plans for future release of the product? Thanks -- Subhabrata Bhattacharya