Re: [R] transform a list of arrays to tibble

2023-10-17 Thread arnaud gaboury
ake a suggestion, if you really want a tibble that allows you > to know what each row is for, consider one of many methods for saving the > previous row names as a new column. I used that to take the data.frame > version I made above and got: > > > temp <- as_tibble(result.

Re: [R] transform a list of arrays to tibble

2023-10-17 Thread avi.e.gross
uses as_tibble with an underscore, but many other ways to make a column exist. -Original Message- From: R-help On Behalf Of arnaud gaboury Sent: Tuesday, October 17, 2023 4:30 AM To: r-help Subject: [R] transform a list of arrays to tibble I work with a list of crypto assets daily c

[R] transform a list of arrays to tibble

2023-10-17 Thread arnaud gaboury
I work with a list of crypto assets daily closing prices in a xts class. Here is a limited example: asset.xts.lst <- list(BTCUSDT = structure(c(26759.63, 26862, 26852.48, 27154.15, 27973.45), dim = c(5L, 1L), index = structure(c(1697068800, 1697155200, 1697241600, 1697328000, 1697414400), tzone =

Re: [R] transform

2016-10-01 Thread Jim Lemon
Hi Val, Perhaps like this? valdat<-read.table(text="obs, Year, bb, kk, y 1, 2001, 25 ,100, 12.6 2, 2001, 15 ,111, 24.7 3, 2001, 53, 110, 13.8 4, 2001, 50, 75, 9.6 5, 2001, 125, 101, 31.5 6, 2001, 205, 407, 65.7 7, 2001, 250, 75, 69.1",sep=",",header=TRUE) selectval<-valdat$bb > 75 &

[R] transform

2016-09-30 Thread Val
Hi all, I want to standardize a variable based on certain condition Here is my sample of data obs, Year, bb, kk, y 1, 2001, 25 ,100, 12.6 2, 2001, 15 ,111, 24.7 3, 2001, 53, 110, 13.8 4, 2001, 50, 75, 9.6 5, 2001, 125, 101, 31.5 6, 2001, 205, 407, 65.7 7, 2001, 250, 75, 69.1 If the

Re: [R] Transform a list of multiple to a data.frame which I want

2015-02-02 Thread William Dunlap
Does the following work for you. The only trick is working around the fact that matrix subscripting does not allow out-of-bounds subscripts but vector subscripting does. We do the subscripting in two steps, relying on the drop=TRUE default in the matrix subscripting operator that converts the sin

Re: [R] Transform a list of multiple to a data.frame which I want

2015-02-02 Thread Jim Lemon
Hi Yao, Messy, but this is the closest I can get: yhlist<-list(K=matrix(0,ncol=2,nrow=0), GSEGTCSCSSK=matrix(c(6,8),nrow=2,ncol=2), GFSTTCPAHVDDLTPEQVLDGDVNELMDVVLHHVPEAK=matrix(6,ncol=2,nrow=1), LVECIGQELIFLLPNK=matrix(6,ncol=2,nrow=1), NFK=matrix(0,ncol=2,nrow=0), HR=matrix(0,ncol=2,nrow=0)

[R] Transform a list of multiple to a data.frame which I want

2015-02-01 Thread Yao He
Dear all: I have a list like that,which is a standard str_locate_all() function (stringr package) output: $K start end $GSEGTCSCSSK start end [1,] 6 6 [2,] 8 8 $GFSTTCPAHVDDLTPEQVLDGDVNELMDVVLHHVPEAK start end [1,] 6 6 $LVECIGQELIFLLPNK start end [1,] 4

Re: [R] Transform a data.frame with "; " sep column and another one in a a new one with the same two column but with repetitions

2014-07-09 Thread João Azevedo Patrício
Em 05-07-2014 00:43, John McKown escreveu: I messed up my original response by not including r-help in the distribution. And now I won't look as bad because, after a short nap, I have new, much shorted (but more difficult, for me, to understand) answer. # # The original data is in the variable "

Re: [R] Transform a data.frame with "; " sep column and another one in a a new one with the same two column but with repetitions

2014-07-07 Thread João Azevedo Patrício
Em 05-07-2014 03:35, John McKown escreveu: On Fri, Jul 4, 2014 at 7:50 AM, João Azevedo Patrício wrote: Hi, I've been trying to solve this issue but with no success. I have some data like this: 1 > TC WC 2 > 0 Instruments & Instrumentation; Nuclear Science & Technology; Physics, Particles

Re: [R] Transform a data.frame with "; " sep column and another one in a a new one with the same two column but with repetitions

2014-07-04 Thread John McKown
On Fri, Jul 4, 2014 at 7:50 AM, João Azevedo Patrício wrote: > Hi, > > I've been trying to solve this issue but with no success. > > I have some data like this: > > 1 > TC WC > 2 > 0 Instruments & Instrumentation; Nuclear Science & Technology; > Physics, Particles & Fields; Spectroscopy > 3 > 0

Re: [R] Transform a data.frame with "; " sep column and another one in a a new one with the same two column but with repetitions

2014-07-04 Thread arun
Hi, Try: dat1 <- read.table(text="'1 > TC' 'WC' '2 > 0'  'Instruments & Instrumentation; Nuclear Science & Technology;Physics, Particles & Fields; Spectroscopy' '3 > 0' 'Nanoscience & Nanotechnology; Materials Science,Multidisciplinary; Physics, Applied' '4 > 2'    'Physics, Nuclear; Physics, P

Re: [R] Transform a data.frame with "; " sep column and another one in a a new one with the same two column but with repetitions

2014-07-04 Thread João Azevedo Patrício
Em 04-07-2014 15:15, arun escreveu: Hi, Try: dat1 <- read.table(text="'1 > TC' 'WC' '2 > 0' 'Instruments & Instrumentation; Nuclear Science & Technology;Physics, Particles & Fields; Spectroscopy' '3 > 0' 'Nanoscience & Nanotechnology; Materials Science,Multidisciplinary; Physics, Applied' '4

[R] Transform a data.frame with "; " sep column and another one in a a new one with the same two column but with repetitions

2014-07-04 Thread João Azevedo Patrício
Hi, I've been trying to solve this issue but with no success. I have some data like this: 1 > TC WC 2 > 0 Instruments & Instrumentation; Nuclear Science & Technology; Physics, Particles & Fields; Spectroscopy 3 > 0 Nanoscience & Nanotechnology; Materials Science, Multidisciplinary; Phys

Re: [R] Transform aggregated data to individual data

2013-11-14 Thread arun
HI, A more general form would be:  D[rep(1:nrow(D),D[,3]),-3] A.K. On Thursday, November 14, 2013 12:27 PM, arun wrote: Hi, Try:  D1 <- D[rep(row.names(D),D[,3]),-3] ##assuming rownames(D) are from 1:nrow(D)  row.names(D1) <- 1:nrow(D1) A.K. On Thursday, November 14, 2013 5:32 AM, peron

Re: [R] Transform aggregated data to individual data

2013-11-14 Thread arun
Hi, Try:  D1 <- D[rep(row.names(D),D[,3]),-3] ##assuming rownames(D) are from 1:nrow(D)  row.names(D1) <- 1:nrow(D1) A.K. On Thursday, November 14, 2013 5:32 AM, peron wrote: Hello I have data in following form : 100 ind describe by two variables x and y. D<-data .frame( x=rnorm(3), y=r

Re: [R] Transform aggregated data to individual data

2013-11-14 Thread Jim Lemon
On 11/14/2013 09:28 PM, peron wrote: Hello I have data in following form : 100 ind describe by two variables x and y. D<-data .frame( x=rnorm(3), y=rnorm(3), size=c(50,10,40)) I want data for individual, i.e, 100 observations for my 100 ind. Hi Olivier, From the above, it seems you hav

[R] Transform aggregated data to individual data

2013-11-14 Thread peron
Hello I have data in following form : 100 ind describe by two variables x and y. D<-data .frame( x=rnorm(3), y=rnorm(3), size=c(50,10,40)) I want data for individual, i.e, 100 observations for my 100 ind. Thank for your help Olivier Peron [[alternative HTML version de

Re: [R] transform one probability distribution into another

2013-11-04 Thread Greg Snow
As a general rule, the distribution functions that start with p (e.g. pnorm, pexp, pgamma, ...) will transform a random variable from the corresponding distribution to a uniformly distributed random variable. The functions that start with q (e.g. qnorm, qexp, qgamma, ...) will transform a uniform

Re: [R] transform one probability distribution into another

2013-11-04 Thread Rui Barradas
Hello, At an R prompt type ?rexp Also, read An Introduction to R, file R-intro.pdf that comes with your distribution of R, namely, chapter 8 Probability distributions. Hope this helps, Rui Barradas Em 04-11-2013 19:14, b. alzahrani escreveu: Hi guys Given a exponential curve, is there a

[R] transform one probability distribution into another

2013-11-04 Thread b. alzahrani
Hi guys Given a exponential curve, is there any function on r that can generate exponential distributed random numbers? in General I want an function that can transform one probability distribution into another?? Regards ** Ba

Re: [R] Transform plot3d grafics in to executable files

2013-10-14 Thread Duncan Murdoch
On 13-10-14 1:13 PM, David Winsemius wrote: On Oct 14, 2013, at 1:33 AM, palad...@trustindata.de wrote: Hello, I did some nice grafics using plot 3d and scatter3d. Is there a, hopefully not too complicated way, to transform these dynamic, three-dimensional and interactive grafics in a kind o

Re: [R] Transform plot3d grafics in to executable files

2013-10-14 Thread David Winsemius
On Oct 14, 2013, at 1:33 AM, palad...@trustindata.de wrote: > Hello, > I did some nice grafics using plot 3d and scatter3d. Is there a, hopefully > not too complicated way, to transform these dynamic, three-dimensional and > interactive grafics in a kind of > executable file? I want to show and

[R] Transform plot3d grafics in to executable files

2013-10-14 Thread paladini
Hello, I did some nice grafics using plot 3d and scatter3d. Is there a, hopefully not too complicated way, to transform these dynamic, three-dimensional and interactive grafics in a kind of executable file? I want to show and send them via e-mail to projekt partners who don`t use GNU R and w

Re: [R] transform row name in first column variable

2013-08-27 Thread Rui Barradas
Hello, One more thing, if you do cbind(year = rownames(dat), dat), then the year variable defaults to a factor. Maybe it's better if you transform it into numeric: cbind(year = as.numeric(rownames(dat)), dat) Rui Barradas Em 27-08-2013 21:09, catalin roibu escreveu: Thank you very much! I

Re: [R] transform row name in first column variable

2013-08-27 Thread David Winsemius
If the goal is to change row names and the replacements are unique the it is as easy as: rownames(dfrm) <- newnames Include example data for more complete answers. -- David Sent from my iPhone On Aug 27, 2013, at 2:41 PM, Rui Barradas wrote: > Hello, > > If your data.frame is named 'dat'

Re: [R] transform row name in first column variable

2013-08-27 Thread Rui Barradas
Hello, If your data.frame is named 'dat', try the following. cbind(year = rownames(dat), dat) Hope this helps, Rui Barradas Em 27-08-2013 20:34, catalin roibu escreveu: hello all! I have a problem! I don't know how to convert row names in first column variables. Thank you very much for your

[R] transform row name in first column variable

2013-08-27 Thread catalin roibu
hello all! I have a problem! I don't know how to convert row names in first column variables. Thank you very much for your help! CR -- --- Catalin-Constantin ROIBU Lecturer PhD, Forestry engineer Forestry Faculty of Suceava Str. Universitatii no. 13, Suceava, 720229, Romania office phone +4

Re: [R] transform variables

2013-08-27 Thread Xochitl CORMON
You have what is called a "wide" table and you want a "tall" table. In this case the function melt from reshape2 package is suitable. Be careful specifying properly the variables (columns) you want to use for the reshape using correct syntax. ?melt {reshape2} You can also use as already sugges

Re: [R] transform variables

2013-08-26 Thread arun
.abb))) colnames(yrmon3)<- colnames(res3)  row.names(yrmon3)<- row.names(res3)  identical(res3,yrmon3) #[1] TRUE A.K. - Original Message - From: arun To: catalin roibu Cc: Jim Lemon ; R help Sent: Monday, August 26, 2013 9:08 AM Subject: Re: [R] transform variables HI, You could also

Re: [R] transform variables

2013-08-26 Thread arun
01 2 -0.2318646 #1.3 1901 3 -0.1961822 #1.4 1901 4  0.5609812 #1.5 1901 5  0.5713866 #1.6 1901 6 -1.5676166 A.K. - Original Message - From: Jim Lemon To: catalin roibu Cc: r-help@r-project.org Sent: Monday, August 26, 2013 7:45 AM Subject: Re: [R] transform variable

Re: [R] transform variables

2013-08-26 Thread Gerrit Eichner
Catalin, first, keep the communication on the list, so it gets documented also for others. Second, my code does work for an example I made up myself, but if you don't "provide commented, minimal, self-contained, reproducible code" (as the posting guide asks you to; see last line of this e-ma

Re: [R] transform variables

2013-08-26 Thread Erich Neuwirth
Have a look at the packages reshape and reshape2 They were written with this type of problems in mind. On Aug 26, 2013, at 1:04 PM, catalin roibu wrote: > Dear all! > > I have a data frame composed by 13 columns (year, and 12 months). I want to > transform this data base in another like this >

Re: [R] transform variables

2013-08-26 Thread Jim Lemon
On 08/26/2013 09:04 PM, catalin roibu wrote: Dear all! I have a data frame composed by 13 columns (year, and 12 months). I want to transform this data base in another like this year month values 1901 1 1901 2 1901 3 . 1901 12 1902 1 1902 2 1902 12 Is there a possibility to succeed t

Re: [R] transform variables

2013-08-26 Thread Gerrit Eichner
Hello, Catalin, assume your data frame is as simple as A <- data.frame( year = , month01 = , , + month12 = ) then, e.g., reshape( A, varying = c( "month01", , "month12"), + v.names = "Values", timevar = "Month", direction = "long") should do what you want

[R] transform variables

2013-08-26 Thread catalin roibu
Dear all! I have a data frame composed by 13 columns (year, and 12 months). I want to transform this data base in another like this year month values 1901 1 1901 2 1901 3 . 1901 12 1902 1 1902 2 1902 12 Is there a possibility to succeed that in R? Thank you! best regards! CR -- --

Re: [R] transform dataframe with look-up table

2013-07-26 Thread Juan Antonio Balbuena
Hello First thank you very much to Jean, Bill, Brian and David for the answers and code. I very extremely grateful. I am eventually going to adapt Brian's code with a very minor alteration. If one follows the original syntax End <- merge(merge(Start, transformer, by.x="Left", by.y="

Re: [R] transform dataframe with look-up table

2013-07-25 Thread David Carlson
Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Juan Antonio Balbuena Sent: Thursday, July 25, 2013 10:13 AM To: r-help@r-project.org Sub

Re: [R] transform dataframe with look-up table

2013-07-25 Thread Brian Diggs
On 7/25/2013 8:13 AM, Juan Antonio Balbuena wrote: > > Hello > I hope that there is a simple solution to this apparently complex problem. > Any help will be much appreciated: > I have a dataframe with Left and Right readings (that is, elements in each > row are paired). For inst

Re: [R] transform dataframe with look-up table

2013-07-25 Thread William Dunlap
CO Software wdunlap tibco.com > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf > Of Juan Antonio Balbuena > Sent: Thursday, July 25, 2013 8:13 AM > To: r-help@r-project.org > Subject: [R] transform dataframe with l

Re: [R] transform dataframe with look-up table

2013-07-25 Thread Adams, Jean
Perhaps this will help. Jean df <- structure(list(Left = c(9L, 4L, 2L, 6L, 3L, 4L, 3L, 4L, 10L, 9L), Right = c(8L, 3L, 1L, 5L, 1L, 1L, 2L, 2L, 8L, 10L)), .Names = c("Left", "Right"), class = "data.frame", row.names = 1:10) lookup <- structure(list(input = c(5L, 10L, 4L, 8L, 6L, 5L, 7L, 2L, 9L,

[R] transform dataframe with look-up table

2013-07-25 Thread Juan Antonio Balbuena
Hello I hope that there is a simple solution to this apparently complex problem. Any help will be much appreciated: I have a dataframe with Left and Right readings (that is, elements in each row are paired). For instance, Left Right [1] 98 [2] 43 [3] 2

Re: [R] transform 3 numeric vectors empty of 0/1

2013-06-18 Thread arun
})))  #  user  system elapsed  # 1.256   0.000   1.257 system.time({ dat2<-colwise(recode)(dat1,recodes="1='ABC';0=''")  res3<-Reduce(paste0,lapply(seq_len(ncol(dat2)),function(i) substr(dat2[,i],i,i))) }) # user  system elapsed #  2.232   0.008   2.249

Re: [R] transform 3 numeric vectors empty of 0/1

2013-06-18 Thread David Carlson
id L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Arnaud Michel Sent: Tuesday, June 18, 2013 11:58 AM To: r-help@r-project.org Subject:

[R] transform 3 numeric vectors empty of 0/1

2013-06-18 Thread Arnaud Michel
Dear all, Without a loop, I would like transform 3 numeric vectors empty of 0/1 of same length Vec1 : transform 1 to A and 0 to "" Vec2 : transform 1 to B and 0 to "" Vec3 : transform 1 to C and 0 to "" to obtain only 1 vector Vec who is the paste of the 3 vectors (Ex : ABC, BC, AC, AB,...) An

Re: [R] transform summary table list to summary table (for .csv output)

2013-06-15 Thread arun
Hi, You could try this: #In one of the list element SampleSummary$ConcLow #   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's # 0.4200  0.6100  0.7300  0.7373  0.8150  1.6600   1 #additional entry for NA.  You may need to check the data and remove the missing value.  Here, I removed t

Re: [R] Transform Coordinate System of an ASCII-Grid

2013-05-23 Thread jas
Hello Berry, thank you for your reply. yes, the flat versus round earth projection is a difficulty, as my grid isn't that far spread out, I thought I would just use the method anyways. I usually use raster or maptools (readAsciiGrid). I am gonna look in to the mapper's forum, thank you for that

Re: [R] Transform Coordinate System of an ASCII-Grid

2013-05-23 Thread Barry Rowlingson
On Thu, May 23, 2013 at 8:44 AM, jas wrote: > Dear all, > > > I have an ASCII-Grid for Switzerland in the Swiss National Coordinate System > of CH1903. Now for a Webapplication of the ASCII-Grid, I need to deliver the > ASCII-Grid in the WGS84 System. > > Via coordinates(ascii) I can "export" the

Re: [R] Transform Coordinate System of an ASCII-Grid

2013-05-23 Thread Daisy Englert Duursma
Hello, You question is a bit unclear. Do you just want to change to decimal degrees? Can you please provide an example of your code and include a small example ascii. On Thu, May 23, 2013 at 5:44 PM, jas wrote: > Dear all, > > > I have an ASCII-Grid for Switzerland in the Swiss National Coordina

[R] Transform Coordinate System of an ASCII-Grid

2013-05-23 Thread jas
Dear all, I have an ASCII-Grid for Switzerland in the Swiss National Coordinate System of CH1903. Now for a Webapplication of the ASCII-Grid, I need to deliver the ASCII-Grid in the WGS84 System. Via coordinates(ascii) I can "export" the coordinates and convert them with a formula into WGS84. My

Re: [R] Transform every integer to 1 or 0

2013-02-05 Thread Wim Kreinen
--- > From: Wim Kreinen > To: r-help@r-project.org > Cc: > Sent: Monday, February 4, 2013 1:33 PM > Subject: [R] Transform every integer to 1 or 0 > > Hello, > > I have a dataframe with positive integers and > for every value > 0 > I would like to have 1 and th

Re: [R] Transform every integer to 1 or 0

2013-02-05 Thread arun
Hi, You could try:  df[df>0]<-1 #or  df[]<-as.integer(df!=0)  df #    V1 V2 V3 #yes  1  0  1 #no   0  1  1 A.K. - Original Message - From: Wim Kreinen To: r-help@r-project.org Cc: Sent: Monday, February 4, 2013 1:33 PM Subject: [R] Transform every integer to 1 or 0 Hello,

Re: [R] Transform every integer to 1 or 0

2013-02-05 Thread Jorge I Velez
Dear Wim, You could try 1*(df > 0) HTH, Jorge.- On Tue, Feb 5, 2013 at 5:33 AM, Wim Kreinen <> wrote: > Hello, > > I have a dataframe with positive integers and > for every value > 0 > I would like to have 1 and the rest should be zero. > > For instance > > 1 0 1 > 0 1 1 > > with df as refere

Re: [R] Transform every integer to 1 or 0

2013-02-05 Thread Jim Lemon
On 02/05/2013 05:33 AM, Wim Kreinen wrote: Hello, I have a dataframe with positive integers and for every value> 0 I would like to have 1 and the rest should be zero. For instance 1 0 1 0 1 1 with df as reference. df V1 V2 V3 yes 23 0 5 no 0 5 7 dput (df) structure(list(V1 =

[R] Transform every integer to 1 or 0

2013-02-05 Thread Wim Kreinen
Hello, I have a dataframe with positive integers and for every value > 0 I would like to have 1 and the rest should be zero. For instance 1 0 1 0 1 1 with df as reference. > df V1 V2 V3 yes 23 0 5 no 0 5 7 > dput (df) structure(list(V1 = c(23, 0), V2 = c(0, 5), V3 = c(5, 7)), .Names

Re: [R] transform input argument (matrix) of function

2012-11-17 Thread David Winsemius
On Nov 17, 2012, at 7:41 AM, Omphalodes Verna wrote: Dear list! I would like to write a function to transform matrix, which is input argument of a written function. It is easy with new matrix (see below), but my idea is to transform input argument (matrix) of function without any additio

Re: [R] transform input argument (matrix) of function

2012-11-17 Thread Rui Barradas
Hello, Your function fun2 (in fact both of them) changes a _copy_ of df1, not df1 itself. To have a copy of the output of fun2 you need to assign the value of fun2 outside it. df2 <- fun2(df1) Now df2 has what you want. (If I understand it well.) Hope this helps, Rui Barradas Em 17-11-2012 1

Re: [R] transform input argument (matrix) of function

2012-11-17 Thread R. Michael Weylandt
I'm afraid I don't really understand what you're searching for, but note that your functions can be written without assignment/return: fun3 <- function(x) invisible(cbind(xy[,1], xy[,2], xy[,1] + xy[,2])) Cheers, Michael On Sat, Nov 17, 2012 at 3:41 PM, Omphalodes Verna wrote: > Dear list! > >

[R] transform input argument (matrix) of function

2012-11-17 Thread Omphalodes Verna
Dear list!   I would like to write a function to transform matrix, which is input argument of a written function. It is easy with new matrix (see below), but my idea is to transform input argument (matrix) of function without any additional matrixes. Here is an example: fun1 <- function(xy) { x

Re: [R] Transform pairwise observations into a table

2012-10-02 Thread William Dunlap
On > Behalf > Of David Winsemius > Sent: Monday, October 01, 2012 7:33 PM > To: arun > Cc: R help; Bert Gunter; Hadjixenofontos, Athena > Subject: Re: [R] Transform pairwise observations into a table > > > On Oct 1, 2012, at 2:30 PM, arun wrote: > > > HI AHJ,

Re: [R] Transform pairwise observations into a table

2012-10-01 Thread arun
- From: David Winsemius To: arun Cc: "Hadjixenofontos, Athena" ; R help ; Bert Gunter Sent: Monday, October 1, 2012 10:33 PM Subject: Re: [R] Transform pairwise observations into a table On Oct 1, 2012, at 2:30 PM, arun wrote: > HI AHJ, > No problem. > > One more way

Re: [R] Transform pairwise observations into a table

2012-10-01 Thread David Winsemius
> - Original Message - > From: "Hadjixenofontos, Athena" > To: arun > Cc: R help > Sent: Monday, October 1, 2012 12:59 PM > Subject: Re: [R] Transform pairwise observations into a table > > Thank you. I had looked at xtabs but misunderstood the synt

Re: [R] Transform pairwise observations into a table

2012-10-01 Thread arun
125 0.5 #3 0.125 0.125 1.000 0.5 #4 0.500 0.500 0.500 1.0 A.K. - Original Message - From: "Hadjixenofontos, Athena" To: arun Cc: R help Sent: Monday, October 1, 2012 12:59 PM Subject: Re: [R] Transform pairwise observations into a table Thank you. I had looked at xtabs but mis

Re: [R] Transform pairwise observations into a table

2012-10-01 Thread Rui Barradas
Hello, Try the following. dat <- read.table(text=" ind1 ind2 coef 1 1 1 1 2 0.25 1 3 0.125 1 4 0.5 2 2 1 2 1 0.25 2 3 0.125 2 4 0.5 3 3 1 3 1 0.125 3 2 0.125 3 4 0.5 4 4 1 4 1 0.5 4 2 0.5 4 3 0.5 ", header=TRUE) dat reshape(dat, v.names = "coef", idvar = "ind1", timevar = "ind2", direc

Re: [R] Transform pairwise observations into a table

2012-10-01 Thread Bert Gunter
f~ind1+ind2,data=dat1)) > > #ind2 > #ind1 1 2 3 4 > # 1 1.000 0.250 0.125 0.500 >#2 0.250 1.000 0.125 0.500 >#3 0.125 0.125 1.000 0.500 >#4 0.500 0.500 0.500 1.000 > > A.K. > > > > - Original Message - > From: AHJ >

Re: [R] Transform pairwise observations into a table

2012-10-01 Thread arun
) #    ind2 #ind1     1     2     3     4   # 1 1.000 0.250 0.125 0.500    #2 0.250 1.000 0.125 0.500    #3 0.125 0.125 1.000 0.500    #4 0.500 0.500 0.500 1.000 A.K. - Original Message - From: AHJ To: r-help@r-project.org Cc: Sent: Monday, October 1, 2012 12:17 PM Subje

Re: [R] Transform pairwise observations into a table

2012-10-01 Thread Hadjixenofontos, Athena
1 2 3 4 > # 1 1.000 0.250 0.125 0.500 >#2 0.250 1.000 0.125 0.500 >#3 0.125 0.125 1.000 0.500 >#4 0.500 0.500 0.500 1.000 > > A.K. > > > > - Original Message - > From: AHJ > To: r-help@r-project.org > Cc: > S

[R] Transform pairwise observations into a table

2012-10-01 Thread AHJ
Hi, I have a table of pairs of individuals and a coefficient that belongs to the pair: ind1ind2coef 1 1 1 1 2 0.25 1 3 0.125 1 4 0.5 2 2 1 2 1 0.25 2 3 0.125 2 4 0.5 3 3 1 3 1

Re: [R] transform RTs

2012-08-30 Thread Matthias Gondan
you might to do something like library(SuppDists) t = runif(100, 100, 500) # original RT t_IG = qinvGauss(ecdf(t)(t)-0.5/length(t), 1, 16) plot(density(t_IG)) but what is the purpose of it? Usually reaction times are thought to follow a certain kind of distribution (e.g. an inverse Gaussian dis

[R] transform RTs

2012-08-29 Thread Katja Böer
Hello, I'm trying to transform reaction times which are not normally distributed to an ex gaussian or an inverse gaussian distribution, but I don't really know how to use the exGAUS() function. Can someone show me a script in which data has been transformed? Thanks in advance k [[alter

Re: [R] Transform date - style

2012-06-14 Thread arun
Hi, Try this: date1<-"X01.11.2010" date2<-strftime(strptime(date1,"X%d.%m.%Y"),"%d.%b.%y")  date2 [1] "01.Nov.10" A.K. - Original Message - From: juliane0212 To: r-help@r-project.org Cc: Sent: Thursday, June 14, 2012 10:09 AM Subject: [R

Re: [R] Transform date - style

2012-06-14 Thread Charlie Friedemann
Try this: old.date <- "X01.11.2010" new.date <- format(as.Date(old.date,format="X%d.%m.%Y"),"%d.%b.%y") [1] "01.Nov.10" -- View this message in context: http://r.789695.n4.nabble.com/Transform-date-style-tp4633377p4633381.html Sent from the R help mailing list archive at Nabble.com. _

[R] Transform date - style

2012-06-14 Thread juliane0212
Hello, is there any posibility to automatically transform this date notation "X01.11.2010" into "01.Nov.10" ? I did not see it before starting my simulation and now I have to deal with it. It is no problem for my calculations but for my graphical outputs I would like

Re: [R] Transform counts into presence/absence

2012-05-31 Thread arun
uot;   "0"   "21"  "2"   "0"   "0"   "234" "2"   "0"   ""   > 1*(Counts>0)  [1] 1 0 1 1 0 0 1 1 0 0 I wonder if there are other way to remove NA's. A.K.   - Original Message - From: Dun

Re: [R] Transform counts into presence/absence

2012-05-31 Thread Rui Barradas
05/2012, you wrote: Original-Nachricht > Datum: Thu, 31 May 2012 11:16:32 + > Von: "ONKELINX, Thierry" > An: Johannes Radinger , "R-help@r-project.org" > Betreff: RE: [R] Transform counts into presence/absence > Just use the logical opera

Re: [R] Transform counts into presence/absence

2012-05-31 Thread Duncan Mackay
ersity of New England Armidale NSW 2351 Email: home: mac...@northnet.com.au At 21:27 31/05/2012, you wrote: Original-Nachricht > Datum: Thu, 31 May 2012 11:16:32 + > Von: "ONKELINX, Thierry" > An: Johannes Radinger , "R-help@r-project.org" &g

Re: [R] Transform counts into presence/absence

2012-05-31 Thread Johannes Radinger
Original-Nachricht > Datum: Thu, 31 May 2012 11:16:32 + > Von: "ONKELINX, Thierry" > An: Johannes Radinger , "R-help@r-project.org" > > Betreff: RE: [R] Transform counts into presence/absence > Just use the logical operators.

Re: [R] Transform counts into presence/absence

2012-05-31 Thread Rui Barradas
Hello, Try x <- c(1,0,21,2,0,0,234,2,0) as.integer(x != 0) Hope this helps, Rui Barradas Em 31-05-2012 12:13, Johannes Radinger escreveu: Hi, I am looking for a very easy way to transform a column in a dataframe from counts (eg. c(1,0,21,2,0,0,234,2,0)) into a binary form to get presence/a

Re: [R] Transform counts into presence/absence

2012-05-31 Thread Jim Lemon
On 05/31/2012 09:13 PM, Johannes Radinger wrote: Hi, I am looking for a very easy way to transform a column in a dataframe from counts (eg. c(1,0,21,2,0,0,234,2,0)) into a binary form to get presence/absence values e.g. c(1,0,1,1,0,0,1,1,0). Is there a simple built-in function? or do I have do t

Re: [R] Transform counts into presence/absence

2012-05-31 Thread ONKELINX, Thierry
:r-help-boun...@r-project.org] Namens Johannes Radinger Verzonden: donderdag 31 mei 2012 13:13 Aan: R-help@r-project.org Onderwerp: [R] Transform counts into presence/absence Hi, I am looking for a very easy way to transform a column in a dataframe from counts (eg. c(1,0,21,2,0,0,234,2,0)) into

[R] Transform counts into presence/absence

2012-05-31 Thread Johannes Radinger
Hi, I am looking for a very easy way to transform a column in a dataframe from counts (eg. c(1,0,21,2,0,0,234,2,0)) into a binary form to get presence/absence values e.g. c(1,0,1,1,0,0,1,1,0). Is there a simple built-in function? or do I have do to it with a replaceement funciton using IF x > 0 TH

[R] transform 1 col to 2 col

2012-05-24 Thread arun
x(inscrutable.df1$V1,ncol=2,byrow=TRUE),matrix(inscrutable.df2$V2,ncol=2,byrow=TRUE))   A.K. - Original Message - From: "MacQueen, Don" To: Soheila Khodakarim Cc: "r-help@r-project.org" Sent: Thursday, May 24, 2012 10:19 AM Subject: Re: [R] transform 1 col t

Re: [R] transform 1 col to 2 col

2012-05-24 Thread MacQueen, Don
See insertion below -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 On 5/24/12 1:43 AM, "Jim Lemon" wrote: >On 05/24/2012 05:10 PM, Soheila Khodakarim wrote: >> Dear All >> >> How can I transform 1 column to 2 columns in R? >>

Re: [R] transform 1 col to 2 col

2012-05-24 Thread Jim Lemon
On 05/24/2012 05:10 PM, Soheila Khodakarim wrote: Dear All How can I transform 1 column to 2 columns in R? 211217_s_at GO:0005249 211217_s_at GO:0005251 211217_s_at GO:0005515 211217_s_at GO:0015271 211217_s_at GO:0030955 211217_s_at GO:0005249 211217_s_at GO:0005251

[R] transform 1 col to 2 col

2012-05-24 Thread Soheila Khodakarim
Dear All How can I transform 1 column to 2 columns in R? 211217_s_at GO:0005249 211217_s_at GO:0005251 211217_s_at GO:0005515 211217_s_at GO:0015271 211217_s_at GO:0030955 211217_s_at GO:0005249 211217_s_at GO:0005251 211217_s_at GO:0005515 211217_s_at GO:0015271

Re: [R] Transform Data using Sigmoid Function

2012-05-12 Thread Suhaila Haji Mohd Hussin
Please nevermind as I have just solved this. Suhaila From: bell_beaut...@hotmail.com To: r-help@r-project.org Date: Sat, 12 May 2012 20:44:16 +1200 Subject: [R] Transform Data using Sigmoid Function Hello. I'm trying to scaling these attribute values using sigmoid and I created a functi

[R] Transform Data using Sigmoid Function

2012-05-12 Thread Suhaila Haji Mohd Hussin
Hello. I'm trying to scaling these attribute values using sigmoid and I created a function as followed: mySigmoid <-function(){ medGen = read.csv("medB1.csv"); data(medGen); medGen.signorm=rangenorm(medGen,method="signorm"); op=par(mfrow=c(2,3)) plot(medGen.signorm[,1])par(op)

Re: [R] Transform dataframe

2012-04-22 Thread Jeff Newmiller
On Sun, 22 Apr 2012, David Studer wrote: Hi everyone! I have to following question: I have three items that had to be ordered (e.g. three persons were rating var1 on the first rank): var1 var2 var3 123 213 132 123 Now I'd like to have the data.frame "the other

[R] Transform dataframe

2012-04-22 Thread David Studer
Hi everyone! I have to following question: I have three items that had to be ordered (e.g. three persons were rating var1 on the first rank): var1 var2 var3 123 213 132 123 Now I'd like to have the data.frame "the other way round", so that the ranks are in the col

Re: [R] transform data.frame holding answers --> data.frame holding logicals

2011-12-01 Thread Florent D.
I have this. I have modified your input structure to be a matrix. I think it is generally recommended to use matrices over data.frames when your data allows it, i.e., when you only have one type of data, here character(). Matrices are easier to work with. x <- matrix(  c('BMW', '', '',    'Mercedes

Re: [R] transform data.frame holding answers --> data.frame holding logicals

2011-12-01 Thread Jean V Adams
saschaview wrote on 12/01/2011 12:30:18 PM: > Hello > > I have a data frame, x, holding 5 persons answering the question which > cars they have used: > > # the data frame > x <- as.data.frame( >matrix( > c('BMW', '', '', >'Mercedes', 'VW', '', >'Skoda', 'VW', 'BMW', >

[R] transform data.frame holding answers --> data.frame holding logicals

2011-12-01 Thread saschaview
Hello Hello I have a data frame, x, holding 5 persons answering the question which cars they have used: # the data frame x <- as.data.frame( matrix( c('BMW', '', '', 'Mercedes', 'VW', '', 'Skoda', 'VW', 'BMW', '', '', '', 'VW', 'Skoda', '' ), ncol=3,

Re: [R] Transform the original data to the "Copula Scale"

2011-11-28 Thread Duncan Murdoch
On 11-11-27 10:24 PM, cahaya iman wrote: Hi all, Did R build the function that can transform the original data to the "copula scale" by applying a probability integral transform to obtain uniformly [0; 1]-distributed values? Yes, the p* functions do that (pnorm, pgamma, etc.). Duncan Murdoch

[R] Transform the original data to the "Copula Scale"

2011-11-27 Thread cahaya iman
Hi all, Did R build the function that can transform the original data to the "copula scale" by applying a probability integral transform to obtain uniformly [0; 1]-distributed values? Thank you. Fayyad. [[alternative HTML version deleted]] __

Re: [R] transform() on selective names. Is it possible?

2011-04-08 Thread Juan Carlos Borrás
# The code demonstrating the final version I am going to use is as follows rm(list=ls()) # Beware of this one so it doesn't spoil your workspace N <- 100 M <- 2 x <- matrix(data=rnorm(N*M, 0, 3)-10, ncol=M, nrow=N) y <- matrix(c(1,-2,-2,1), ncol=M, nrow=M) z <- data.frame(x %*% y) colnames(z) <-

Re: [R] transform() on selective names. Is it possible?

2011-04-07 Thread David Winsemius
On Apr 7, 2011, at 10:27 AM, Juan Carlos Borrás wrote: Wonderful, or the closest to heaven I've been the whole afternoon, but not quite there: # begin code N <- 300 M <- 2 x <- matrix(data=rnorm(N*M, 0, 3)-10, ncol=M, nrow=N) y <- matrix(c(1,-2,-2,1), ncol=M, nrow=M) z <- data.frame(x %*% y) c

Re: [R] transform() on selective names. Is it possible?

2011-04-07 Thread Juan Carlos Borrás
Wonderful, or the closest to heaven I've been the whole afternoon, but not quite there: # begin code N <- 300 M <- 2 x <- matrix(data=rnorm(N*M, 0, 3)-10, ncol=M, nrow=N) y <- matrix(c(1,-2,-2,1), ncol=M, nrow=M) z <- data.frame(x %*% y) colnames(z) <- c('x','y') par(mfrow=c(1,3)) plot(z, pch=5, c

Re: [R] transform() on selective names. Is it possible?

2011-04-07 Thread David Winsemius
On Apr 7, 2011, at 9:56 AM, Juan Carlos Borrás wrote: Hi all, I am whitening my data: # code begins N <- 300 M <- 2 x <- matrix(data=rnorm(N*M, 0, 3)-10, ncol=M, nrow=N) y <- matrix(c(1,-2,-2,1), ncol=M, nrow=M) z <- data.frame(x %*% y) colnames(z) <- c('x','y') par(mfrow=c(1,3)) plot(z, pch=5

[R] transform() on selective names. Is it possible?

2011-04-07 Thread Juan Carlos Borrás
Hi all, I am whitening my data: # code begins N <- 300 M <- 2 x <- matrix(data=rnorm(N*M, 0, 3)-10, ncol=M, nrow=N) y <- matrix(c(1,-2,-2,1), ncol=M, nrow=M) z <- data.frame(x %*% y) colnames(z) <- c('x','y') par(mfrow=c(1,3)) plot(z, pch=5, col="blue") whiten <- function(x) { (x-mean(x))/sd(x) }

Re: [R] transform table to matrix

2011-03-02 Thread Scott Chamberlain
Agreed Peter: weird. What is the purpose of your inquiry SK? And why is your inquiry so similar to the one at the hyperlink I provided? Scott On Wednesday, March 2, 2011 at 6:10 PM, P Ehlers wrote: > Scott Chamberlain wrote: > > This thread seems freakishly similar to what you are askingSco

  1   2   >