search for: rehap

Displaying 3 results from an estimated 3 matches for "rehap".

Did you mean: remap
2010 Mar 06
1
converting multiple lines of text to a data frame
I'm trying to find a way for converting multiple lines of text into a table. ?I'm not sure if there's a way where you can use read.delim() to read in multiple lines of text and create the following data frame with something akin to rehape()?. Apologies if there is an obvious way to do this. A: 1 B: 2 C: 10 A: 34 B: 20 C: 6.7 A: 2 B: 78 C: 35 Convert the above lines into the following data frame A???????????? B???????????? C 1????????????? 2????????????? 10 34?????????? 20?????????? 6.7 2????????????? 78?????????? 35 Thanks,...
2004 Nov 28
1
Could anyone help me reshape this "wide" data into "longitudinal" one? Thanks
Dear R people, I have a matrix like this: var1 var2 var3 var4 a1 7.1 7.2 8.1 8.2 a2 10.5 10.6 ... ... a3 b1 b2 b3 b4 c1 c2 ... The matrix row names are "a1", "a2", ...... and the matrix column names are "var1", "var2", "var3" and "var4". Now I want to reshape this data into a
2010 Nov 14
6
sum in vector
hy guys i have one question :) i have two vectors markets and price market <- c(1, 5, 7, 9, 9, 6, 5, 4, 4, 3, 1, 2, 1) price <- c(100, 20, 30, 10, 50, 23, 23, 33, 96, 6, 4, 38, 96) i would like sum prices: market 1: (100+4+96), market 2: (38),..., market 9: (10+50) ao i would like get this result: (200, 38, ..., 60) and i don't wanna use while, for loops... is there any other function