Hi
Just for completeness, if you want to get rid of all rows regardless in which
column they are
res3 <- res1[complete.cases(res1),]
identical(res2, res3)
[1] TRUE
Petr
> -Original Message-
> From: arun [mailto:smartpink...@yahoo.com]
> Sent: Friday, March 14, 2014 3:19 PM
> To: dila r
Hi there,
I just find a fancy plot like the following:
http://www.nature.com/nature/journal/v505/n7481/images_article/nature12784-f2.jpg
I am wondering how to plot something like that in R. Which package will
be convenient for doing such things.
BTW, the link that points to R graph gallery
Because x refers to the local version, not the global one.
In case you have not read this before, using <<- is a really really bad idea.
Your code will become confusing and likely be wrong if you ignore this warning.
Return a value from the function and save it in the calling environment when
y
Solution is to not use ifelse. Use if...else...
---
Jeff NewmillerThe . . Go Live...
DCN:Basics: ##.#. ##.#. Live Go...
Live: OO#
Hi everyone.
I have three dataframes (A, B and C). B and C are subsets of the rows of A, for
example...
> A<-as.data.frame(cbind(1:5,21:25))
> A
V1 V2
1 1 21
2 2 22
3 3 23
4 4 24
5 5 25
> B<-A[1:4,]
> B
V1 V2
1 1 21
2 2 22
3 3 23
4 4 24
> C<-A[3:5,]
> C
V1 V2
3 3 23
4 4 24
5
Hi
Please explain why the function 'foo()' is not printing x as 8 in the
following code :
> foo <- function(){
+ x <- 10
+ if(x){
+ x <<- 8
+ }
+ print(x)
+ }
> foo()
[1] 10
> x
[1] 8
>
--
*AROONALOK PYNE*
BE Graduate
Department Of Computer Science And Engineering
Jadavpur University, Kolkata-
http://www.cybaea.net/Blogs/Faster-R-through-better-BLAS.html any help?
On Mar 16, 2014 9:38 PM, "Russell Bainer" wrote:
> Thanks guys. I'll look into this and tell you if I come up with anything.
>
> -R
>
>
> On Saturday, March 15, 2014, Jeff Newmiller
> wrote:
>
> > Comparing with an unspecifi
Thanks guys. I'll look into this and tell you if I come up with anything.
-R
On Saturday, March 15, 2014, Jeff Newmiller
wrote:
> Comparing with an unspecified benchmark makes answering this too hard.
> Following instructions in the Posting Guide will lead to more accurate Q
> and A.
>
> Note
Did you really intend to make all of the x values the same? If so, try one line
instead of the for loop:
dfr$x[ 2:n ] <- dfr$x[ 1 ]
If that was merely an error in your example, then you could use a different
one-liner:
dfr$x[ 2:n ] <- dfr$x[ seq.int( n-1 ) ]
In either case, the speedup is con
Duncan's analysis suggests another way to do this:
extract the 'x' vector, operate on that vector in a loop,
then insert the result into the data.frame. I added
a df="quicker" option to your df argument and made the test
dataset deterministic so we could verify that the algorithms
do the same thin
On 14-03-16 2:57 PM, Göran Broström wrote:
I have always known that "matrices are faster than data frames", for
instance this function:
dumkoll <- function(n = 1000, df = TRUE){
dfr <- data.frame(x = rnorm(n), y = rnorm(n))
if (df){
for (i in 2:NROW(dfr)){
if
Hello,
This is to be expected. Matrices can hold only one type of data so the
problem is solved once and for all, data frames can have many types of
data so the code to handle them must determine which type to handle on
every access.
Hope this helps,
Rui Barradas
Em 16-03-2014 18:57, Göran
Joshua,
Thanks. I am going to check.
On Mon, Mar 17, 2014 at 11:10 AM, Joshua Ulrich wrote:
> On Sun, Mar 16, 2014 at 6:27 AM, Bill wrote:
> > Hello Pascal,
> > Yes that is what I was worried about. The date-stamps are there and I
> would
> > like to use that information but I think using as.ts
On Sun, Mar 16, 2014 at 6:27 AM, Bill wrote:
> Hello Pascal,
> Yes that is what I was worried about. The date-stamps are there and I would
> like to use that information but I think using as.ts will not do this.
> Does anyone know how this is done?
It cannot be done. The ts class is used to "repr
Hi,
Try:
data_test<-data.frame(id, dates, info, sqfootage,
lotsize,stringsAsFactors=FALSE)
data_test[order(with(data_test,as.Date(dates,"%m/%d/%Y"))),]
id dates info sqfootage lotsize
3 ID3 2/03/2013 siding 3000 0.75
2 ID2 1/16/2014 wood 2000 0.50
1 ID1 2/16/2014 br
Hi Luigi
It always helps to know what your data is
str(AVG)
'data.frame': 8 obs. of 2 variables:
$ stimulation: Factor w/ 8 levels "Unstimulated",..: 1 2 3 4 5 6 7 8
$ copy : num 1006 1750 7439 1058 2952 ...
> AVG
stimulation copy
1 Unstimulated 1005.80527
2ESAT6 1750
Thank you very much for your posts. I updated the example, which was taken
from the following:
http://cran.r-project.org/doc/contrib/Torfs+Brauer-Short-R-Intro.pdf
Hopefully the below is a bit more representative question, but unfortunately,
it looks like I'm not inputting the dates informati
Dear Caroline,
Yes, it seems you have complete separation for the 'Timepoint'
variable. This means that the likelihood is unbounded for that
parameter and the optimizer just terminates when it gets far enough
out on an asymptote and improvements are below a threshold. This is
also the reason the v
Hi,
Try:
plot(copy~as.numeric(stimulation),data=AVG,xaxt="n",xlab="stimulation")
axis(1,seq(length(AVG$stimulation)),label=AVG$stimulation)
#or
library(ggplot2)
qplot(stimulation,copy,data=AVG)
A.K.
On Sunday, March 16, 2014 2:28 PM, Luigi Marongiu
wrote:
Dear all,
I was trying to plot th
R-helpers:
I'm having some trouble with this one -- I figure because I'm a bit of
a noob with S3 classes... Here's my challenge: I want to write a
custom predict statement that is triggered based on the presence and
class of a *newdata* parameter (not the "object" parameter). The
reason is I am
Achim Zeileis uibk.ac.at> writes:
>
> On Thu, 13 Mar 2014, Tim Marcella wrote:
>
> > Hi,
> >
> > I am working with hurdle models in the pscl package to model zero
> > inflated overdispersed count data and want to incorporate censored
> > observations into the equation. 33% of the observed pos
Hi guys,
I ran the below R code:
> department <- c(rep("B", 2), rep("C", 2), rep("D", 2), rep("E", 2),
rep("F", 2))
> gender <- rep(c("Male", "Female"), 5)
> admitted <- c(353, 17, 120, 202, 138, 131, 53, 94, 22, 24)
> not.admitted <- c(207, 8, 205, 391, 279, 244, 138, 299, 351, 317)
> cbind(depa
Dear all
I have ordinal data (from a questionnaire with 4 levels) for 2 groups (30
subjects each) and 2 timepoints. So I used a cumulative link mixed model to fit
the data (nr = subject number).
mod_FV<-clmm2(FV~GruppeVerbelendung+Timepoint,random=nr,data=data,Hess=TRUE,nAGQ=10,na.action=na.om
I have always known that "matrices are faster than data frames", for
instance this function:
dumkoll <- function(n = 1000, df = TRUE){
dfr <- data.frame(x = rnorm(n), y = rnorm(n))
if (df){
for (i in 2:NROW(dfr)){
if (!(i %% 100)) cat("i = ", i, "\n")
dfr
Dear all,
I was trying to plot the average of different variables at the same time; I
used the aggregate function and I obtained correctly the averages I wanted.
However when I have tried to plot the data the outlook of the data is a bar
rather than by a symbol; even using the "pch" or the "col" ar
Hi everyone,
I want to analyse a multivariate dataset with a permutational ANOVA. I usually
use "adonis" in the vegan package. Is there a way to incorporate random factors
in such analyses as well?
thanks & all the best!
Florian
Dr. Florian Menzel
Department of Evolutionary Biology, Institute
Thanks John. That worked. It was an easy solution. I'm in the process of
switching from Stata and some of these small things are still hanging me up.
Jason
-Original Message-
From: John Fox [mailto:j...@mcmaster.ca]
Sent: Sunday, March 16, 2014 9:51 AM
To: Gainous,Jason
Cc: r-help@r-pr
Dear Jason,
Your suspicion is correct: the cases with NAs in either ft_dpc_r or pid_x
are absent from the residuals but not from pid_x.
There are several ways to deal with this problem, but one straightforward
way is to use na.exclude in place of the default na.omit in the call to lm,
as in lm(f
On 14-03-16 2:13 AM, Mike Miller wrote:
On Sat, 15 Mar 2014, peter dalgaard wrote:
On 15 Mar 2014, at 20:54 , Mike Miller wrote:
$ cat data1.txt
0.005
0.00489
I don't know why it shows 17 digits and doesn't round to 15, but it is showing
that the numbers are different, for some
Hello Pascal,
Yes that is what I was worried about. The date-stamps are there and I would
like to use that information but I think using as.ts will not do this.
Does anyone know how this is done?
Thank you.
On Wed, Mar 12, 2014 at 1:02 AM, Pascal Oettli wrote:
> Hello,
>
> On Tue, Mar 11, 2014
Try:
t[order(t$z),]
#or
t[with(t,order(z)),]
A.K.
On Sunday, March 16, 2014 12:27 AM, Jason Rupert wrote:
Evidently, I'm overlooking something simple. I'm trying to used order with
data.frame.
For example:
t = data.frame(x = c(11,12,14), y = c(19,20,21), z = c(10,9,7))
t[order(z), ]
31 matches
Mail list logo