Hi,
I want to do the follow thing
Input :
a <- c(1,3,6,9)
b<-c(10,7,20,2)
Expected outcome :
d<-list(1:10,3:7,6:20,2:9)
Thanks !!
Tanvir Ahamed
Göteborg, Sweden | mashra...@yahoo.com
__
R-help@r-project.org mailing list -- To UNSUBS
Hi Tanvir,
Not at all elegant, but:
make.seq<-function(x) return(seq(x[1],x[2]))
apply(matrix(c(a,b),ncol=2),1,make.seq)
Jim
On Wed, Jun 22, 2016 at 5:32 PM, Mohammad Tanvir Ahamed via R-help
wrote:
> Hi,
> I want to do the follow thing
>
> Input :
> a <- c(1,3,6,9)
>
>
> b<-c(10,7,20,2)
>
>
>
On 22/06/16 20:00, Jim Lemon wrote:
Hi Tanvir,
Not at all elegant, but:
make.seq<-function(x) return(seq(x[1],x[2]))
apply(matrix(c(a,b),ncol=2),1,make.seq)
Not sure that this is more "elegant" but it's a one-liner:
lapply(1:length(a),function(i,a,b){a[i]:b[i]},a=a,b=b)
cheers,
Rolf
On W
Now why didn't I think of that?
apply(matrix(c(a,b),ncol=2),1,function(x)x[1]:x[2])
Jim
On Wed, Jun 22, 2016 at 6:14 PM, Rolf Turner wrote:
> On 22/06/16 20:00, Jim Lemon wrote:
>>
>> Hi Tanvir,
>> Not at all elegant, but:
>>
>> make.seq<-function(x) return(seq(x[1],x[2]))
>> apply(matrix(c(a,b
There's also
mapply(a, b, FUN=seq, SIMPLIFY=FALSE)
(turn off simplication so that you don't unexpectedly get a matrix whenever all
elements of results have same length. This also affects apply()-based
solutions.)
...except that according to original spec, one should ensure a < b. So
myseq <-
or as a one-liner
mapply(pmin(a, b), pmax(a,b), FUN=seq, SIMPLIFY=FALSE)
On 22/06/2016 10:23, peter dalgaard wrote:
There's also
mapply(a, b, FUN=seq, SIMPLIFY=FALSE)
(turn off simplication so that you don't unexpectedly get a matrix whenever all
elements of results have same length. This als
Thanks everyone for the solutions !!
Tanvir Ahamed
Göteborg, Sweden | mashra...@yahoo.com
- Original Message -
From: Keith Jewell
To: r-h...@stat.math.ethz.ch
Sent: Wednesday, 22 June 2016, 11:54
Subject: Re: [R] [FORGED] Re: Generate list if sequence form two vector element
or as
Hi again!
21.06.2016, 21:33, chalabi.el...@yahoo.de wrote:
Hi Kimmo, Thanks for your reply. I think now my problem is that I
don't understand what does factor(df.classes[training]) do?
Sorry, my mistake, should habe been 'df$speed'. Please try the following:
--- snip ---
set.seed(7) training
Hey,
Does anyone know how to remove labels from a biplot? I want to input them
manually as they are currently overlapping.
Thanks
--
Le gach dea ghui,
Shane
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list -- To UNSU
o.k I found that I have to update my local copy of ncbi,
but when I do:
*ncbit(update=TRUE)*
I get:
*"NCBI GenBank taxonomy assembled 2013-03-29"*
Why it was not updated?
Thanks
Nomi
2016-06-20 14:11 GMT+03:00 Nomi Hadar :
> Hello,
>
> I have troubles with the gbresolve function from the *g
Since R is open source, the source code for packages is stored on CRAN mirrors.
A little navigation gets us to
https://cloud.r-project.org/src/contrib/Archive/car/
Loading car_1.2-16.tar.gz, the last version before car_2.0 gives the code for
Ask():
# change an argument to a function interacti
wow. Cool.
Many thanks,
Ashim
On Wed, Jun 22, 2016 at 9:08 PM, David L Carlson wrote:
> Since R is open source, the source code for packages is stored on CRAN
> mirrors. A little navigation gets us to
>
> https://cloud.r-project.org/src/contrib/Archive/car/
>
> Loading car_1.2-16.tar.gz, the la
The xlabs= (rows) and ylabs= (columns) arguments handle the labels, but they do
not recycle so you need to specify values for each row and each column:
> set.seed(42)
> x <- matrix(rnorm(500), 50, 10)
> biplot(prcomp(x), xlabs=rep("", 50), ylabs=rep("", 10))
-
I should have mentioned that the points are invisible without the labels and
there is no way to use plot symbols. Something like this is probably what you
wanted.
> biplot(prcomp(x), xlabs=rep("*", 50), ylabs=rep("", 10))
Gives you the arrows and asterisks for the points. But labeling them is n
Hit the same error message when trying install.packages('rJava')
in R 3.2.2 under SuSE Linux, version Leap 42.1 :
Begin of error message
configure: error: One or more Java configuration variables are not set.
Make sure R is configured with full
Dear Kimmo,
I already used df$speed[training] in df.xyf but I get this error:
Error in xyf(Xtraining,factor(df$speed[training]),grid=somgrid(5, :
NA/NaN/Inf in foreign function call (arg 1)
On Wednesday, June 22, 2016 3:48 AM, K. Elo wrote:
Hi again!
21.06.2016, 21:33, chalabi.el...@ya
Hello.
I am running into difficulties running some older scripts I produced in
2014 to handle raster data using the R package "raster". I have the
feeling that some behavior has changed with an upgrade but don't
remember what version I was using when I wrote the scripts. Can
somebody help me tro
Hi!
22.06.2016, 22:00, chalabi.el...@yahoo.de wrote:
Dear Kimmo,
I already used df$speed[training] in df.xyf but I get this error:
Error in xyf(Xtraining,factor(df$speed[training]),grid=somgrid(5, :
NA/NaN/Inf in foreign function call (arg 1)
Please check for zeros (0) and NAs in df$spee
I think there is a bug in raster::removeTmpFiles(). Near the end it has
f <- f[dif > h]
if (length(f) > 1) {
unlink(f, recursive = TRUE)
}
so it only tries to remove the files listed in 'f' if there is more than
one of them.
Perhaps the author meant to use '>='
Hi,
Below is a reproducible example that produces the estimate of "totexp13" (total
health care expenditure 2013) for the subpopulation that includes "Asians with
diabetes diagnosed" in MEPS. The R script below downloads file from the web for
processing.
Issue/Question: The R/survey package do
hi pradip, with meps you should be able to match precisely between r+survey
and those other languages[1]
if i had to guess, i would say that your sas and stata code is actually
doing the equivalent of this, which is not correct. check the journal
article table #1 for syntax comparisons
desig
21 matches
Mail list logo