Displaying 20 results from an estimated 40000 matches similar to: "parallel rbind"
2013 Jan 22
1
c(), rbind and cbind functions - why type of resulting object is double
Hello Everyone,
I am using R 2.15.0 and I came across this behaviour and I was wondering
why I don't get an integer vector or and integer matrix with the following
code:
> z <- c(1, 2:0, 3, 4:8)
> typeof(z)
[1] "double"
> z <- rbind(1, 2:0, 3, 4:8)
Warning message:
In rbind(1, 2:0, 3, 4:8) :
number of columns of result is not a multiple of vector length (arg
2011 May 16
2
rbind with partially overlapping column names
Hello,
I would like to merge two data frames with partially overlapping column
names with an rbind-like operation.
For the follow data frames,
df1 <- data.frame(a=c("A","A"),b=c("B","B"))
df2 <- data.frame(b=c("b","b"),c=c("c","c"))
I would like the output frame to be (with NAs where the frames don't
2013 Oct 20
5
nlminb() - how do I constrain the parameter vector properly?
Greets,
I'm trying to use nlminb() to estimate the parameters of a bivariate normal sample and during one of the iterations it passes a parameter vector to the likelihood function resulting in an invalid covariance matrix that causes dmvnorm() to throw an error. Thus, it seems I need to somehow communicate to nlminb() that the final three parameters in my parameter vector are used to
2009 Nov 25
5
How to sum only a few elements in a line
Hello,
I have a matrix with the numbers 0,1 and 9
I would like to write a function that could sum each line skiping everytime
a number 9 appears
for example
[0 1 0 1 1 9 1]
the sum would be 4.
However I cannot replace 9 by 0 otherwise after the sum is done I wouldn?t
be able to distiguish which ones were real zeros and which ones were nines
replaced by zero just to sum.
Thank you very much
--
2012 Feb 07
2
Canonical package directory name for JAR files?
We have an R package which needs to include a JAR file.
Is there a canonical directory for it?
2012 Nov 30
3
(no subject)
Hello R usuer,
The code given below superimposes a pie diagram on another plot
containing some points. However, I would like to center the pie
diagram on the xy location on the plot, but not on the center. is
there any way to re-center pic diagram.
Any suggestion or better alternative are highly appreciated.
Thank you in advance for your help.
Regards,
Bibke
library(visualFields)
library(car)
2009 May 22
1
stripchart and ordering of plot
Take for example the following stripchart that's created:
b <- 1:5
a <- 11:15
e <- 21:25
f <- -11:-15
foo <- rbind(b,a,e,f)
stripchart(foo ~ rownames(foo))
In this case, I would like the bottom part of the plot to be the f vector,
followed by the e vector, etc.
However, R reorders the matrix and plots according to the alphabetical order
of the rownames of foo. Is there a
2011 Apr 11
3
sort.int(S3object) strips class but not the is.object flag
If x has an S3 class then sort.int(x) returns a value
without an S3 class but which has the is.object flag set,
which, I think, causes identical() give a false/misleading
report:
> x <- structure(1:3, class="unrecognizedClass")
> y <- sort.int(x)
> t <- 1:3
> identical(y, t) # expect TRUE
[1] FALSE
> identical(as.vector(y), as.vector(t)) # expect
2009 Nov 11
2
partial cumsum
Hello,
I am searching for a function to calculate "partial" cumsums.
For example it should calculate the cumulative sums until a NA appears,
and restart the cumsum calculation after the NA.
this:
x <- c(1, 2, 3, NA, 5, 6, 7, 8, 9, 10)
should become this:
1 3 6 NA 5 11 18 26 35 45
any ideas?
thank you and best regards,
stefan
2008 Oct 03
3
Can DESCRIPTION Maintainer: field contain general URL instead of only email address?
Our firm would like to route support requests through
a website instead of using email. However R will refuse
to install a package if DESCRIPTION's Maintainer field
does not have a valid email adress or the special value
"ORPHANED". (The check is done with
tools:::.valid_maintainer_field_regexp.)
I imagine a typical Maintainer line for the package "foo"
might be
2012 Jul 13
4
R-squared with Intercept set to 0 (zero) for linear regression in R is incorrect
Hi,
I have been using lm in R to do a linear regression and find the slope
coefficients and value for R-squared. The R-squared value reported by R
(R^2 = 0.9558) is very different than the R-squared value when I use the
same equation in Exce (R^2 = 0.328). I manually computed R-squared and the
Excel value is correct. I show my code for the determination of R^2 in R.
When I do not set 0 as the
2012 Feb 07
5
Table rearranging
I have a table that looks like this:
measurement?? ?date??? door ?? color
0.93529385?? ?513?? ?open?? ?red
0.97419293?? ?420??? open ?? red
0.962053514?? ?513?? ?closed?? ?red
0.963909937?? ?1230?? ?open?? ?blue
0.97652034?? ?1230?? ?open?? ?green
0.989310795?? ?1230?? ?closed?? ?blue
0.9941022?? ?917?? ?closed?? ?yellow
I would like to create a table that has: Open measurement, Closed
2013 Sep 27
2
Error: C stack usage is too close to the limit when using list.files()
R-helpers:
I'm running a file search on my entire drive (Mac OS X) using:
files_found <- list.files(dir="/",pattern=somepattern,recursive=TRUE,full.names=TRUE)
where somepattern is a search pattern (which I have confirmed via a
unix "find / -name somepattern" only returns ~ 3 results).
I keep getting an error:
Error: C stack usage is too close to the limit
when
2013 Oct 31
1
Extracting values from a ecdf (empirical cumulative distribution function) curve
Hi R users,
I am a new user, still learning basics of R. Is there anyway to extract y
(or x) value for a known x (or y) value from ecdf (empirical cumulative
distribution function) curve?
Thanks in advance.
Mano.
[[alternative HTML version deleted]]
2013 Jan 22
3
density of hist(freq = FALSE) inversely affected by data magnitude
Hi,
I have a couple of observations, a question or two, and perhaps a
suggestion related to the plotting of density on the y-axis within the
hist() function when freq=FALSE. I was using the function and trying
to develop an intuitive understanding of what the density is telling
me. After reading through this fairly helpful post:
2010 Nov 29
2
FW: how to use by() ?
Thank you for the suggestion, Bill. The result is not quite what I would like. Here's sample code for you or anyone else who may be interested:
Al1 = c('A','C','C','C')
Al2 = c('G','G','G','T')
Freq1 = c(0.0078,0.0567,0.9434,0.9908)
MAF = c(0.0078,0.0567,0.0566,0.0092)
m1 = data.frame(Al1=Al1,
2012 Nov 07
3
c weirdness
is there a way to avoid c() appending ".0" and ".1" to seed?
--8<---------------cut here---------------start------------->8---
> c("nons"=1, "seed"=3)
nons seed ## good!
1 3
> c("nons"=1, "seed"=tab[1])
nons seed.0 ## don't want ".0"!
1 2344600
>
2009 Aug 20
5
help with regular expressions in R
I'm having trouble achieving the results I want using a regular expression.
I want to eliminate all characters that fall within square brackets as well
as the brackets themselves, returning an "". I'm not sure if it's R's use of
double slash escapes or something else that is tripping me up. If I only use
one slash I get
1: '\[' is an unrecognized escape in a
2011 Mar 25
2
two minor bugs in rowsum()
(a) In R 2.12.2 rowsum can overflow if given an integer input:
> rowsum(c(2e9L, 2e9L), c("a", "a"))
[,1]
a -294967296
> 2^32 + .Last.value
[,1]
a 4e+09
Should it be changed to coerce its x argument to numeric
(double precision) so it always returns a numeric output?
(b) When rowsum is given an x containing both NaN and NA it
appears to use the last
2013 Nov 05
2
Error message glmer using R: “ 'what' must be a character string or a function”
I am running a multi-level model. I use the following commands with
validatedRS6 as the outcome, random as the predictor and clustno as the
random effects variable.
new<-as.data.frame(read.delim("BABEX.dat", header=TRUE))
install.packages("lme4")
library(lme4)
model1<- glmer(validatedRS6 ~ random + (1|clustno), data=new,
family=binomial("logit"), nAGQ)