Hello,
You're right, sorry, I missed the parenthesis:
colordata$response <- (colordata$color == 'blue') + 0
Rui Barradas
Quoting Michael Artz :
> Fyi, This statement returned the following error
> 'Error in "Yes" + 0 : non-numeric argument to binary
Hi
> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Michael
> Artz
> Sent: Friday, April 8, 2016 3:50 AM
> To: Hadley Wickham <h.wick...@gmail.com>
> Cc: r-help@r-project.org
> Subject: Re: [R] simple question on data fra
ybe you shall use dput(yourdata) output together with desired result to help
us better understand your task.
Cheers
Petr
From: Michael Artz [mailto:michaelea...@gmail.com]
Sent: Thursday, April 7, 2016 4:17 PM
To: PIKAL Petr <petr.pi...@precheza.cz>
Subject: Re: [R] simple question on data
Why am I better off with true and false?
On Thu, Apr 7, 2016 at 8:41 AM, Hadley Wickham wrote:
> == is also vectorised, and you're better off with TRUE and FALSE
> rather than 1 and 0, so I'd recommend:
>
> colordata$response <- colordata$color == 'blue'
>
> Hadley
>
> On
Fyi, This statement returned the following error
'Error in "Yes" + 0 : non-numeric argument to binary operator'
On Thu, Apr 7, 2016 at 8:43 AM, wrote:
> Hello,
>
> Or even simpler, without ifelse,
>
> colordata$response <- colordata$color == 'blue' + 0
>
> Hope this
It all makes so much sense now
On Thu, Apr 7, 2016 at 10:04 AM, Jeff Newmiller
wrote:
> lapply(colordata2[ -1 ], f )
>
> When you put the parentheses on, you are calling the function yourself
> before lapply gets a chance. The error pops up because you are giving a
>
lapply(colordata2[ -1 ], f )
When you put the parentheses on, you are calling the function yourself before
lapply gets a chance. The error pops up because you are giving a vector of
numbers (the answer f gave you) to the second argument of lapply instead of a
function.
--
Sent from my phone.
If you are not using an anonymous function and say you had written the
function out
The below gives me the error > 'f(colordata2$color1)' is not a function,
character or symbol' But then how is the anonymous function working?
f <- function(col){
ifelse(col == 'blue', 1, 0)
}
responses <-
Hello,
Or even simpler, without ifelse,
colordata$response <- colordata$color == 'blue' + 0
Hope this helps,
Rui Barradas
Citando David Barron :
> ifelse is vectorised, so just use that without the loop.
>
> colordata$response <- ifelse(colordata$color == 'blue', 1, 0)
== is also vectorised, and you're better off with TRUE and FALSE
rather than 1 and 0, so I'd recommend:
colordata$response <- colordata$color == 'blue'
Hadley
On Thu, Apr 7, 2016 at 6:52 AM, David Barron wrote:
> ifelse is vectorised, so just use that without the loop.
>
>
Lapply is not a vectorized function. It is compact to read, but it would not be
worth using for this calculation.
However, if your data frame had multiple color columns in your data frame that
you wanted to make responses for then you might want to use lapply as a more
compact version of a
Hi
> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Michael
> Artz
> Sent: Thursday, April 7, 2016 1:57 PM
> To: David Barron <dnbar...@gmail.com>
> Cc: r-help@r-project.org
> Subject: Re: [R] simple question on data fra
Thaks so much! And how would you incorporate lapply() here?
On Thu, Apr 7, 2016 at 6:52 AM, David Barron wrote:
> ifelse is vectorised, so just use that without the loop.
>
> colordata$response <- ifelse(colordata$color == 'blue', 1, 0)
>
> David
>
> On 7 April 2016 at
ifelse is vectorised, so just use that without the loop.
colordata$response <- ifelse(colordata$color == 'blue', 1, 0)
David
On 7 April 2016 at 12:41, Michael Artz wrote:
> Hi I'm not sure how to ask this, but its a very easy question to answer for
> an R person.
>
>
Hi I'm not sure how to ask this, but its a very easy question to answer for
an R person.
What is an easy way to check for a column value and then assigne a new
column a value based on that old column value?
For example, Im doing
colordata <- data.frame(id = c(1,2,3,4,5), color = c("blue",
I want to do a boxcox transformation, but I got this:
Error: could not find function boxcox
What can I do?
Well, the recommended 'homework' in the posting guide would be a start.
i) ??boxcox, if you have any packages installed that include something with
that functionality.
ii)
Hello,
Try the following.
install.packages(sos) #if not yet
Then,
library(sos)
findFn(boxcox)
There are several hits, maybe you could start with package car
Hope this helps,
Rui Barradas
Em 12-02-2015 16:19, CHIRIBOGA Xavier escreveu:
Hi everybody!
I want to do a boxcox
Hi,
Maybe the following link helps.
http://r.789695.n4.nabble.com/box-cox-td4363944.html
--
View this message in context:
http://r.789695.n4.nabble.com/SIMPLE-question-tp4703176p4703180.html
Sent from the R help mailing list archive at Nabble.com.
Hi everybody!
I want to do a boxcox transformation, but I got this:
Error: could not find function boxcox
What can I do? I am using R studio.
Thanks!!!
Xavier
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
Hi all,
Simple question I should know: I'm unclear on the logic of why the sum of a
row of a data.frame returns a valid sum but the mean of a row of a
data.frame returns NA:
sum(rock[2,])
[1] 10901.05
mean(rock[2,],trim=0)
[1] NA
Warning message:
In mean.default(rock[2, ], trim = 0) :
numeric data frames.
HTH,
daniel
Feladó: R-help [r-help-boun...@r-project.org] ; meghatalmaz#243;: Matthew
Keller [mckellerc...@gmail.com]
Küldve: 2015. február 11. 23:49
To: r help
Tárgy: [R] simple question - mean of a row of a data.frame
Hi all,
Simple
Hi R Users.
I have a simple question on a loop.
The following loop works fine:
r_t=list()
for(i in 1:500)
{
r_t[[i]]=h_t_half[[i]]%*%matrix(*z_t_m*[i,])
}
But indeed I need also that *z_t_m* varies. Let us suppose that *z_t_m* has
1000 replicates,
I have written the following loop that
Use mapply instead
On Fri, Nov 16, 2012 at 5:01 PM, billycorg candi...@gmail.com wrote:
Hi R Users.
I have a simple question on a loop.
The following loop works fine:
r_t=list()
for(i in 1:500)
{
r_t[[i]]=h_t_half[[i]]%*%matrix(*z_t_m*[i,])
}
But indeed I need also that *z_t_m*
Hi Everyone,
I am trying a very simple task to append the Timestamp with a variable name so
something like
a_2012_09_27_00_12_30 - rnorm(1,2,1).
Tried some commands but it doesn't work out well. Hope someone has some answer
on it.
Session Info
R version 2.15.1 (2012-06-22)
Platform:
Hi!
28.09.2012 09:13, Bhupendrasinh Thakre wrote:
Statement I tried :
b - unclass(Sys.time())
b = 1348812597
c_b - rnorm(1,2,1)
Do you mean this:
--- code ---
df-data.frame(x=0,y=0)
colnames(df)
[1] x y
colnames(df)[2]-paste(b,unclass(Sys.time()),sep=_)
colnames(df)
[1] x
Hello,
Try the following:
b - unclass(Sys.time())
eval(parse(text=paste(c_,b, - rnorm(1,2,1),sep=)))
ls()
Regards,
Pascal
Le 28/09/2012 15:13, Bhupendrasinh Thakre a écrit :
Hi Everyone,
I am trying a very simple task to append the Timestamp with a variable name so
something like
On Sep 27, 2012, at 11:13 PM, Bhupendrasinh Thakre wrote:
Hi Everyone,
I am trying a very simple task to append the Timestamp with a variable name
so something like
a_2012_09_27_00_12_30 - rnorm(1,2,1).
If you want to assign a value to a character-name you need to use ... `assign`.
Many thanks Dr. Winsemius , Kimmo and Pascal
All of them are working and really beautiful...
Best Regards,
Bhupendrasinh Thakre
*Disclaimer :*
The information contained in this communication is confidential and may be
legally privileged. It is intended solely for the use of the individual
Hi Everyone,
Sorry for coming back again with a new problem.
Editing question, session info and data so you don't have to scroll till
the end of page.
*Situation :*
I have a data frame and it's name is df. Now I want to add Time Stamp to
the end of *name of data Frame i.e. df_system_time*.
Hi Everyone,
Sorry for coming back again with a new problem.
Editing question, session info and data so you don't have to scroll till
the end of page.
*Situation :*
I have a data frame and it's name is df. Now I want to add Time Stamp to
the end of *name of data Frame i.e. df_system_time*.
On 28-09-2012, at 18:40, Bhupendrasinh Thakre vickytha...@gmail.com wrote:
Hi Everyone,
Sorry for coming back again with a new problem.
Editing question, session info and data so you don't have to scroll till
the end of page.
*Situation :*
I have a data frame and it's name is df. Now
Thanks a ton Berend. That worked like a charm..
R comes with thousands of Sweet Surprises everyday
Bhupendrasinh Thakre
On Sep 28, 2012, at 12:00 PM, Berend Hasselman b...@xs4all.nl wrote:
On 28-09-2012, at 18:40, Bhupendrasinh Thakre vickytha...@gmail.com wrote:
Hi Everyone,
On Fri, Sep 28, 2012 at 11:15 AM, Bhupendrasinh Thakre
vickytha...@gmail.com wrote:
Thanks a ton Berend. That worked like a charm..
R comes with thousands of Sweet Surprises everyday
-- Not for those who read the docs. :-o
-- Bert
Bhupendrasinh Thakre
On Sep 28, 2012, at 12:00
All,
Relatively new R user so this is probably an easy question to answer.
I am able to generate a cluster for my dataset using hclust() then ploting
the data with plot().
This results in an image with a dendrogram with my sample names along the
bottom. Great!
However, I now need a way to get
On Wed, Sep 26, 2012 at 3:11 PM, RCar ryan.carst...@utsouthwestern.eduwrote:
All,
Relatively new R user so this is probably an easy question to answer.
I am able to generate a cluster for my dataset using hclust() then ploting
the data with plot().
This results in an image with a dendrogram
-
project.org] On Behalf Of RCar
Sent: Wednesday, September 26, 2012 4:12 PM
To: r-help@r-project.org
Subject: [R] Simple Question About Exporting Back to Excel
All,
Relatively new R user so this is probably an easy question to answer.
I am able to generate a cluster for my dataset using hclust
Hello,
In the help page for ?hclust you will see the return values. It has an
element order, a vector giving the permutation of the original
observations suitable for plotting.
From the first example on that page:
hc - hclust(dist(USArrests), ave)
plot(hc)
ix - hc$order
Good morning reader,
I have encountered a, probably, simple issue with respect to the *formulae* of
a *regression model* I want to use in my research. Im researching
alliances as part of my study Business Economics (focus Strategy) at the
Vrije Universiteit in Amsterdam. In the research model
10 augustus 2012 9:15
Aan: r-help@r-project.org
Onderwerp: [R] Simple question about formulae in R!?
Good morning reader,
I have encountered a, probably, simple issue with respect to the *formulae* of
a *regression model* I want to use in my research. I'm researching alliances as
part of my
.
~ John Tukey
-Oorspronkelijk bericht-
Van: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
Namens Johan Haasnoot
Verzonden: vrijdag 10 augustus 2012 9:15
Aan: r-help@r-project.org
Onderwerp: [R] Simple question about formulae in R!?
Good morning reader,
I have
Onderwerp: [R] Simple question about formulae in R!?
Good morning reader,
I have encountered a, probably, simple issue with respect to the *formulae* of
a *regression model* I want to use in my research. I'm researching alliances as
part of my study Business Economics (focus Strategy
Aan: r-help@r-project.org
Onderwerp: [R] Simple question about formulae in R!?
Good morning reader,
I have encountered a, probably, simple issue with respect to the
*formulae* of a *regression model* I want to use in my research. I'm
researching alliances as part of my study Business
that a reasonable answer can be extracted from a given
body of data.
~ John Tukey
-Oorspronkelijk bericht-
Van: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org
]
Namens Johan Haasnoot
Verzonden: vrijdag 10 augustus 2012 9:15
Aan: r-help@r-project.org
Onderwerp: [R] Simple question
R in general tries hard to prohibit this behavior (i.e., including an
interaction but not the main effect). When removing a main effect and
leaving the interaction, the number of parameters is not reduced by
one (as would be expected) but stays the same, at least
when using
Sheesh! Yes.
... and in the case where B is a factor with k levels and x is
continuous, the model ~B:x yields k+1 parameters, which in default
contrasts would be a constant term, x, and k-1 interactions between x
and the corresponding k-1 contrasts(which they aren't really) for B.
~B*x would add
On Fri, Aug 10, 2012 at 9:16 AM, S Ellison s.elli...@lgcgroup.com wrote:
R in general tries hard to prohibit this behavior (i.e., including an
interaction but not the main effect). When removing a main effect and
leaving the interaction, the number of parameters is not reduced by
one (as
-project.org
Cc:
Sent: Wednesday, July 25, 2012 4:05 PM
Subject: [R] Simple question on finding duplicates
I'm trying to find duplicate values in a column of a data frame. For
example, dataframe (a) below has two 3's. I would like to mark each value of
each row as either not being
I'm trying to find duplicate values in a column of a data frame. For
example, dataframe (a) below has two 3's. I would like to mark each value of
each row as either not being a duplicate of the one before (0), or as a
duplicate (1) - for example, as in dataframe (b). In SPSS, I
-bounces@r-
project.org] On Behalf Of Jeff
Sent: Wednesday, July 25, 2012 3:06 PM
To: r-help@r-project.org
Subject: [R] Simple question on finding duplicates
I'm trying to find duplicate values in a column of a data frame.
For
example, dataframe (a) below has two 3's. I would like
Minor correction:
duplicate - ifelse(c(0, a$col[-length(a$col)])==a$col, 1, 0)
---
David
-Original Message-
From: David L Carlson [mailto:dcarl...@tamu.edu]
Sent: Wednesday, July 25, 2012 3:23 PM
To: 'Jeff'; 'r-help@r-project.org'
Subject: RE: [R] Simple question on finding
College Station, TX 77843-4352
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
project.org] On Behalf Of Jeff
Sent: Wednesday, July 25, 2012 3:06 PM
To: r-help@r-project.org
Subject: [R] Simple question on finding duplicates
I'm trying to find
To: r-help@r-project.org
Subject: [R] Simple question on finding duplicates
I'm trying to find duplicate values in a column of a data frame.
For
example, dataframe (a) below has two 3's. I would like to mark each
value of
each row as either not being a duplicate of the one before (0
duplicate - c(0, diff(a[,col1]) == 0)
Peter Ehlers
On 2012-07-25 13:05, Jeff wrote:
I'm trying to find duplicate values in a column of a data frame. For
example, dataframe (a) below has two 3's. I would like to mark each value of
each row as either not being a duplicate of the
Greetings,
I am new to R, but trying to put in the time to learn. I have read the R
manual and several other introductory texts; however, there is nothing like
actually putting it into practice. So here is my problem, and its more of a
learning exercise for myself than anything else, but I'm
??
ggplot did not reorder the columns -- it just plotted them in the order of
the levels of factor(chrom), which is exactly what you wanted afaics. There
is no need to reorder to do what you want.
Comment: ?dput to put reproducible data into an email that people can
conveniently copy and paste
Hello,
Try the following.
dd - read.table(text=
chromlength
1 chr1 249250621
2 chr2 243199373
[... etc ...]
22 chr19 59128983
23 chr22 51304566
24 chr21 48129895
, header=TRUE)
str(dd)
dd$chrom - as.character(dd$chrom)
dd$chrom - sub(chr, , dd$chrom)
# This 'chrom' is NOT a
x - 3
y - 4
max(x,y)
4
how can i get the greater variable name
y
thanks
--
View this message in context:
http://r.789695.n4.nabble.com/simple-question-about-max-x-y-tp4630201.html
Sent from the R help mailing list archive at Nabble.com.
On May 15, 2012, at 8:42 PM, lapertem4 wrote:
x - 3
y - 4
max(x,y)
4
how can i get the greater variable name
y
Option one:
test - function(x,y) { c(x,y)[which.max(c(x,y))]}
test(3,4)
[1] y
test(4,3)
[1] x
Option two:
test - function(x,y) { xn -
I am a novice R user.
I would like to be able to graph some simple piecewise functions/functions
with domain restrictions in R, but I'm having trouble defining such
functions. For example, I would like to define the following function:
f(x)={x^2 if -1xx; 1 if 2x3}
Notably, the function is
Does
f - function(x){
ifelse((-1 x x 1) | (2 x x 3),x^2,NA)
}
plot(f,xlim=c(-3,5))
give you what you want?
cheers,
Rolf Turner
On 26/03/12 11:08, chad.mills wrote:
I am a novice R user.
I would like to be able to graph some simple
Yes! Thanks. It was just the NA value instead of the as.null that does
the trick. Correct code for the original piecewise I stated (for those who
might be looking later) is:
f - function(x){
ifelse((-1 x x 1),x^2,ifelse((2xx3),1,NA))
}
plot(f,xlim=c(-1,3))
I have hunted around but cannot find the command which allows me to specify
parameters of a model.
For example,
model.m1 - nls(y ~ alpha * x1/(beta + x1), data = data, start = list(beta =
20, alpha = 120), trace = TRUE)
This will estimate the parameters, which allows to investigate the
On Oct 12, 2011, at 2:25 PM, BvZ wrote:
I have hunted around but cannot find the command which allows me to
specify
parameters of a model.
For example,
model.m1 - nls(y ~ alpha * x1/(beta + x1), data = data, start =
list(beta =
20, alpha = 120), trace = TRUE)
This will estimate the
Tried this, it does not seem to work.
It is really simple what I am trying to do. I have a pre-specified best-fit
line, and wish to run some diagnostic tests for goodness of fit.
I will play around with the predict function, thanks a lot David!
--
View this message in context:
David Winsemius dwinsemius at comcast.net writes:
On Apr 19, 2011, at 10:51 PM, murilofm wrote:
Thanks for the answer; I see that col=c(blue,red)[inv$c+1]
creates a
vector of red and blue associated with the binnary c.
But still I got everything red.
If you want tested
The link to the csv file is
http://www.filedropper.com/data_5
I use the d variable to create the radius:
radius - sqrt( inv$d/ pi )
and i tried
symbols(inv$a, inv$b, circles=radius, inches=0.35, fg=white,
bg=red, xlab=aa, ylab=bb,
col=c(blue,red)[inv$c+1])
Thanks for the help.
--
View
On Apr 20, 2011, at 8:45 AM, murilofm wrote:
The link to the csv file is
http://www.filedropper.com/data_5
I use the d variable to create the radius:
radius - sqrt( inv$d/ pi )
and i tried
symbols(inv$a, inv$b, circles=radius, inches=0.35, fg=white,
bg=red, xlab=aa, ylab=bb,
Thank you for the answer and sorry about the bad post i'll remember that
in the future.
By the way, the line code i used to read the data was
inv - read.csv(data.csv, header=TRUE, sep=;)
I tried before to use the bg, but for some reason it wasn't working out for
me.
But now i got it.
Thanks
I am trying to convert a string to a vector, and I'm stuck!
Suppose you have a string of numbers (string) that you want to convert to a
vector (vec). I am able to split the string turning it into a list by using
strsplit, but this makes a list, which I can't seem to access the way that
I'd
On Apr 19, 2011, at 3:19 PM, Steven Wolf wrote:
I am trying to convert a string to a vector, and I'm stuck!
Suppose you have a string of numbers (string) that you want to
convert to a
vector (vec). I am able to split the string turning it into a list
by using
strsplit, but this makes a
On 20/04/11 07:19, Steven Wolf wrote:
I am trying to convert a string to a vector, and I'm stuck!
Suppose you have a string of numbers (string) that you want to convert to a
vector (vec). I am able to split the string turning it into a list by using
strsplit, but this makes a list, which I
On Apr 19, 2011, at 4:08 PM, Rolf Turner wrote:
On 20/04/11 07:19, Steven Wolf wrote:
I am trying to convert a string to a vector, and I'm stuck!
Suppose you have a string of numbers (string) that you want to convert to a
vector (vec). I am able to split the string turning it into a
On Apr 19, 2011, at 21:56 , David Winsemius wrote:
On Apr 19, 2011, at 3:19 PM, Steven Wolf wrote:
I am trying to convert a string to a vector, and I'm stuck!
Suppose you have a string of numbers (string) that you want to convert to a
vector (vec). I am able to split the string
Seconded.
Peter Ehlers
On 2011-04-19 14:11, Marc Schwartz wrote:
On Apr 19, 2011, at 4:08 PM, Rolf Turner wrote:
On 20/04/11 07:19, Steven Wolf wrote:
[...snip...]
It sounds to me like you don't understand lists. If you are going to use
R you really should understand them. They are a
I'm new to R and i'm having some trouble with a bubble chart.
Basically I have 3 series (a,b,c), but the third one is a binnary variable
(assumes only 0 or 1 to the entire data).
How can I use these binnary information to make 2 different colours in a
bubble chart?. I.e., I'm using this code:
murilofm murilofmoraes at gmail.com writes:
I'm new to R and i'm having some trouble with a bubble chart.
Basically I have 3 series (a,b,c), but the third one is a binnary variable
(assumes only 0 or 1 to the entire data).
How can I use these binnary information to make 2 different colours
Thanks for the answer; I see that col=c(blue,red)[inv$c+1] creates a
vector of red and blue associated with the binnary c.
But still I got everything red.
--
View this message in context:
http://r.789695.n4.nabble.com/Simple-question-about-symbols-tp3461676p3462013.html
Sent from the R help
On Apr 19, 2011, at 10:51 PM, murilofm wrote:
Thanks for the answer; I see that col=c(blue,red)[inv$c+1]
creates a
vector of red and blue associated with the binnary c.
But still I got everything red.
If you want tested solution, submit test data.
--
View this message in context:
Here are two options that might work for you given the little bit you've said:
## If its the same parameter all 30 times
## say, for example, base = 4.5 to log
for(i in 1:30) {
print(log(1:10, base = 4.5))
}
## if they are different parameters, you could try
lapply(X = c(1.3, 3, 2.2, 4, 5),
Hi group,
I did some searches about this very simple question. Hope someone can help
me out.
If I have the following:
a - x - 2^2
a
[1] x - 2^2
How do I evaluate the expression that gets me an answer of 4? I tried the
following:
eval(a)
[1] x - 2^2
get(a)
Error in get(a) : object 'x -
Hi Kel,
Try this:
eval(parse(text = a))
x
Many times (though certainly not all), it may be easier/cleaner to
rethink what you are doing (the step before you get a - x - 2^2)
to see if there is a simpler way.
Cheers,
Josh
On Tue, Nov 30, 2010 at 2:24 PM, Lamke lamk...@gmail.com wrote:
Hi
Dear R users,
I have a very simple question and I've tried to search for the answer.
(But failed.)
there should be a function (func) that work like
abc - c(1,2,3,4)
func(abc)
abc
I would like to know the name of that function. Thank you very much
for your help.
Regards,
CH
--
CH Chan
On Sep 17, 2010, at 2:54 AM, C.H. wrote:
Dear R users,
I have a very simple question and I've tried to search for the answer.
(But failed.)
there should be a function (func) that work like
abc - c(1,2,3,4)
func(abc)
abc
func - function(xyz) deparse(substitute(xyz))
func(abc)
[1] abc
On Fri, Sep 17, 2010 at 7:54 AM, C.H. chainsawti...@gmail.com wrote:
Dear R users,
I have a very simple question and I've tried to search for the answer.
(But failed.)
there should be a function (func) that work like
abc - c(1,2,3,4)
func(abc)
abc
I would like to know the name of that
names(miceTrainSample)
[1] b_double KierA2KierFlex Q_VSA_POS pID50
In the above code, how do I delete pID50 column to store the resulting
object without indicating column 5. The code below does the trick, but I
wish to delete the column by specifying -pID50 instead of 5.
Hi Addi,
On Fri, Jul 16, 2010 at 3:22 PM, Addi Wei addi...@gmail.com wrote:
names(miceTrainSample)
[1] b_double KierA2 KierFlex Q_VSA_POS pID50
In the above code, how do I delete pID50 column to store the resulting
object without indicating column 5. The code below does the trick, but
Anyway, I have often wished that something like
new.mt.sample - miceTrainSample[, -pID50]
would return miceTrainSample without the pID50 column. Here are three
alternative ways to do it.
# Method 1: Assign NULL to the column
new.mt.sample - miceTrainsSample
new.mt.sample$pID50 - NULL
# Method
subset(miceTrainSample, select = -plD50)
On Fri, Jul 16, 2010 at 11:22 AM, Addi Wei addi...@gmail.com wrote:
names(miceTrainSample)
[1] b_double KierA2 KierFlex Q_VSA_POS pID50
In the above code, how do I delete pID50 column to store the resulting
object without indicating column 5.
On Thu, 2010-05-13 at 17:31 -0400, Carl Witthoft wrote:
It's very simple to write a binit() function. If all you want to do
is e.g., bin 107 values into sums of 10 at a time, then write a loop
that sums x[10*i:11*i-1] (not tested and not syntactically correct).
The one I wrote for myself
Wow! This definitely contributed to my evening.
If you could indulge, I would like some clarification on this matter of
binning and distortion, particularly wrt time series (perhaps related to
long-memory processes?). I had thought binning was standard practice in
spectral analysis and ANPOW.
On 05/14/2010 07:35 PM, kMan wrote:
Wow! This definitely contributed to my evening.
If you could indulge, I would like some clarification on this matter of
binning and distortion, particularly wrt time series (perhaps related to
long-memory processes?). I had thought binning was standard
Hello everyone,
I have a data set, and I need to bin my data using a bin width of say g(n).
Would anyone be willing to tell me how to do this in R?
Thanks
--
View this message in context:
http://r.789695.n4.nabble.com/Simple-question-on-binning-data-tp2202644p2202644.html
Sent from the R help
There would be several people who could help if you gave us a minimal,
reproducible example like the posting guide asks for.
If you have a vector of continuous data, and need to create a
categorical variable (in R, a factor) from that continuous variable,
then ?cut can help you.
@r-project.org
Subject: Re: [R] Simple question on binning data
There would be several people who could help if you gave us a minimal,
reproducible example like the posting guide asks for.
If you have a vector of continuous data, and need to create a
categorical variable (in R, a factor) from
On 14/05/2010, at 9:54 AM, Frank E Harrell Jr wrote:
SNIP
snip Binning is seldom needed and usually distorts. It is
the statistical equivalent of a former governor from Alaska.
SNIP
I nominate this for a fortune.
cheers,
Rolf Turner
I second it! Made me lol :)
Dennis
On Thu, May 13, 2010 at 3:03 PM, Rolf Turner r.tur...@auckland.ac.nzwrote:
On 14/05/2010, at 9:54 AM, Frank E Harrell Jr wrote:
SNIP
snip Binning is seldom needed and usually distorts. It is
the statistical equivalent of a former governor from
Hi All!
I know that very primitive question, but that to grant it, that the drawing
on the screen divided up onto which part draw
for example:
layout(matrix(1:4,ncol=2, byrow=T))
plot(x, y, ...) --- 1. screen
plot(y, z, ...) --- 2. screen
etc...
Thank you!
[[alternative HTML
Hi
how can I find, in a vector of characters, which is the most frequent one?
Thanks
Gabriele Zoppoli, MD
Ph.D. Fellow, Experimental and Clinical Oncology and Hematology, University of
Genova, Genova, Italy
Guest Researcher, LMP, NCI, NIH, Bethesda MD
Work: 301-451-8575
Mobile: 301-204-5642
Hello,
What about
test - c(rep(c(A,C,G,T), 20),C)
table(test)
I am not sure that is an apt representation of the data and problem
you are trying to solve. It also occurred to me that each character
may not be its own element in the vector. If that is so, you would
need to do something a
Hi Gabriele,
This is one way but I'm sure that there is an optimal way of doing so...
x - c(A,B,C,C,C,C,C,B,B)
name - unique(x) # get unique characters
freq - c()
for (a in 1:length(name)){
freq[a] - sum(x==name[a])}# get frequency
out - cbind(name,freq)
Muhammad
1 - 100 of 164 matches
Mail list logo