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.
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
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 =
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 &
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
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
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)
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
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 "
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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'
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
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
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
.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
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
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
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
>
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
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
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
--
--
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="
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
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
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
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,
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
})))
# 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
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:
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
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
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
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
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
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
---
> 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
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,
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
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 =
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
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
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
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!
>
>
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
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,
-
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
> - 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
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
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
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
>
)
# 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
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
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
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
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
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
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.
_
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
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
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
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
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.
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
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
: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
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
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
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?
>>
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
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
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
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)
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
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
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
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',
>
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,
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
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]]
__
# 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) <-
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
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
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
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) }
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 - 100 of 154 matches
Mail list logo