Re: [R] Arguments to utils:::menuInstallPkgs

2022-09-23 Thread Dessye Belay
Sent from Mail for Windows 10 [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do re

Re: [R] arguments imply differing number of rows

2017-09-20 Thread Shivi Bhatia
Thank you Bob, this is what i was looking for. Really appreciate. Regards, Shivi On Wed, Sep 20, 2017 at 8:41 PM, Bob O'Hara wrote: > 4000:6000 gives you 4000, 4001, ..., 6000. I suspect you want > population= c(seq(4000, 6000, length=5), seq(3500, 4300, length=5), > seq(3000, 3200, length=5))

Re: [R] arguments imply differing number of rows

2017-09-20 Thread ruipbarradas
Hello, Just count: city is 3*5 == 15, population is length(4000:6000) + length(3500:4300) + length(3000:3200) == 2001 + 801 + 201 == 3003 Hope this helps, Rui Barradas Citando Shivi Bhatia : Hi Team, I using the syntax as: data.df<- data.frame( city= c(rep(c("Delhi",

Re: [R] arguments imply differing number of rows

2017-09-20 Thread Bert Gunter
What do you think 4000:6000 means? Perhaps you need to spend time with an R tutorial or two and stop searching google. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom C

Re: [R] arguments imply differing number of rows

2017-09-20 Thread Bob O'Hara
4000:6000 gives you 4000, 4001, ..., 6000. I suspect you want population= c(seq(4000, 6000, length=5), seq(3500, 4300, length=5), seq(3000, 3200, length=5)) Bob On 20 September 2017 at 17:07, Shivi Bhatia wrote: > Hi Team, > > I using the syntax as: > > data.df<- data.frame( > city= c(rep(c("D

[R] arguments imply differing number of rows

2017-09-20 Thread Shivi Bhatia
Hi Team, I using the syntax as: data.df<- data.frame( city= c(rep(c("Delhi", "Bangalore","Chandigarh"),each=5)), population= c(4000:6000,3500:4300,3000:3200) ) But i am getting the error as arguments imply differing number of rows: 15, 3003. Tried searching google but could not understand &

Re: [R] Arguments imply differing number of rows: 1, 0

2017-03-28 Thread Gerrit Eichner
Hi, John, see inline. Am 27.03.2017 um 20:47 schrieb John Murtagh: Hi All, I am trying to generate a cdf plot by using ggplot and have looked at some examples online. However when I try to replicate it I get the following error: "arguments imply differing number of rows: 1, 0" I made a searc

[R] Arguments imply differing number of rows: 1, 0

2017-03-28 Thread John Murtagh
Hi All, I am trying to generate a cdf plot by using ggplot and have looked at some examples online. However when I try to replicate it I get the following error: "arguments imply differing number of rows: 1, 0" I made a search and it seems from what I gather the nrows!=ncol and that doesn't work

Re: [R] Arguments to utils:::menuInstallPkgs

2016-04-09 Thread Jose Claudio Faria
OK, many thanks Duncan! ///\\\///\\\///\\\///\\\///\\\///\\\///\\\///\\\ Jose Claudio Faria Estatistica UESC/DCET/Brasil joseclaudio.faria at gmail.com Telefones: 55(73)3680.5545 - UESC 55(73)99966.9100 - VIVO 55(73)99100.7351 - TIM 55(73)98817.6159 - OI 55(73)98129.9942 - CLARO ///\\\///\\\///\\\

Re: [R] Arguments to utils:::menuInstallPkgs

2016-04-09 Thread Duncan Murdoch
On 09/04/2016 8:14 AM, Jose Claudio Faria wrote: Dears, Is it possible (in any viable way) to pass arguments to the base function (install.packages I think) using the utils:::menu? No, but why not just call install.packages directly? (If you are using Rgui in Windows, you can add menu items

[R] Arguments to utils:::menuInstallPkgs

2016-04-09 Thread Jose Claudio Faria
Dears, Is it possible (in any viable way) to pass arguments to the base function (install.packages I think) using the utils:::menu? For example: > utils:::menuInstallPkgs(loc=.libPaths()[2]) > utils:::menuInstallLocal(loc=.libPaths()[2]) Thanks, ///\\\///\\\///\\\///\\\///\\\///\\\///\\\///\\\

Re: [R] Arguments in functions when packaging

2014-01-28 Thread Duncan Murdoch
On 14-01-28 2:48 AM, Eva Prieto Castro wrote: Hi everybody, I have a doubt in relation with arguments in functions when packaging: Does it make sense the fact of having dots as an argument when it is the only argument?. I mean you have a package and a function that will be used directly by the

[R] Arguments in functions when packaging

2014-01-27 Thread Eva Prieto Castro
Hi everybody, I have a doubt in relation with arguments in functions when packaging: Does it make sense the fact of having dots as an argument when it is the only argument?.  I mean you have a package and a function that will be used directly by the user has dots as an argument; for example:

[R] arguments must have same length

2012-05-11 Thread suntime
> score<-read.csv("http://users.stat.umn.edu/~chen2285/hw/ACT.csv";) > interaction.plot(sex,rep(1,861),score,fun=mean,legend=F,main="profile of > sex") Error: tapply(response, list(x.factor, trace.factor), fun) : arguments must have same length > length(sex) [1] 861 > length(type) [1] 861 > le

Re: [R] arguments in merge() not accepted

2012-01-16 Thread R. Michael Weylandt
What is? str(data1) str(data2) The man page actually states that the data.frame method of the generic merge() has that argument, but it is not guaranteed that other methods will have the same argument list. (read ?UseMethod if that sentence doesn't make sense) In fact, I know xts/zoo don't. Mich

[R] arguments in merge() not accepted

2012-01-16 Thread Lukas Kohl
dear r-listers, this may be some rally stupid mistake, but googling didn't help me any further: > merge(data1, data2, all.x=T) gives back: : Error in merge(data1, data2, all.x = T) : : unused argument(s) (all.x = T) [same with any other argument i try to put in..] although the man page states

Re: [R] Arguments to order()

2011-04-23 Thread David Neu
On Sat, Apr 23, 2011 at 7:06 PM, Duncan Murdoch wrote: > On 11-04-23 2:00 PM, David Neu wrote: >> >> Hi, >> >> The rows of a data frame can be sorted lexicographically as shown in >> this example, >> >> my.df<- data.frame(x=c(1,1,1,2,2), y=c(1,2,3,2,1)) >> my.df[order(my.df$x,my.df$y, decreasing=T

Re: [R] Arguments to order()

2011-04-23 Thread Duncan Murdoch
On 11-04-23 2:00 PM, David Neu wrote: Hi, The rows of a data frame can be sorted lexicographically as shown in this example, my.df<- data.frame(x=c(1,1,1,2,2), y=c(1,2,3,2,1)) my.df[order(my.df$x,my.df$y, decreasing=TRUE), ] however, I'm wondering if it's possible to pass a variable in as the

[R] Arguments to order()

2011-04-23 Thread David Neu
Hi, The rows of a data frame can be sorted lexicographically as shown in this example, my.df <- data.frame(x=c(1,1,1,2,2), y=c(1,2,3,2,1)) my.df[order(my.df$x,my.df$y, decreasing=TRUE), ] however, I'm wondering if it's possible to pass a variable in as the first argument to order() so that the a

Re: [R] Arguments of a function

2011-03-18 Thread Lisa
Thank you very much! -- View this message in context: http://r.789695.n4.nabble.com/Arguments-of-a-function-tp3387643p3388615.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailma

Re: [R] Arguments of a function

2011-03-18 Thread Bert Gunter
?do.call ## read it CAREFULLY, please. do.call(runif,as.list(c(1,range))) -- Bert On Fri, Mar 18, 2011 at 9:10 AM, Lisa wrote: > Hi, everybody, > > I just want to pass arguments to a function as below: > > range <- c(0.1, 0.5) > > runif(1, range) > > But it doesn’t work. > > Does anyone have a

[R] Arguments of a function

2011-03-18 Thread Lisa
Hi, everybody, I just want to pass arguments to a function as below: range <- c(0.1, 0.5) runif(1, range) But it doesn’t work. Does anyone have any suggestions to offer? Thanks. Lisa -- View this message in context: http://r.789695.n4.nabble.com/Arguments-of-a-function-tp3387643p3387643

Re: [R] Arguments of a function

2011-03-18 Thread D Kelly O'Day
You need to change your second line: range <- c(0.1, 0.5) runif(1, range[1], range[2]) -- View this message in context: http://r.789695.n4.nabble.com/Arguments-of-a-function-tp3387643p3388400.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] Arguments in functions

2010-12-16 Thread Phil Spector
Paul - Please take a look at the help file for boot, i.e. type ?boot at the R prompt. There you will see, along with other information: statistic: A function which when applied to data returns a vector containing the statistic(s) of interest. When ‘sim="parametric"’

[R] Arguments in functions

2010-12-16 Thread Prew, Paul
Hello, I'm not much of a programmer, and am trying to understand the workings of the function below called "RStatFctn" within this bootstrap procedure. RStatFctn is defined to have two arguments: "x", intended to be a data vector; and "d" intended to be an index (or so it looks to me). Later

Re: [R] arguments must have the same length

2010-11-01 Thread Michael Sumner
It's not night time everywhere. The error message suggests that your arguments have different lengths, and that this is required. Perhaps a function that takes two vector arguments? Please provide the code you are running, hopefully with a reproducible example as per the posting guide. BTW, plea

[R] arguments must have the same length

2010-11-01 Thread Shari Kay Hunter
Hi, anyone up in the night working? Thanks for being there. I'm getting this error message "arguments must have the same length." Can't seem to straighten it out. Any suggestions? Thanks so much! PS I saw that someone asked a similar question, but I don't see that anyone had posted a reply... --

Re: [R] Arguments of a function

2010-01-09 Thread Gabor Grothendieck
Normally one designs their function to input a formula in such a case rather than design it to take the names directly. Thus: f <- function(formula = ~ x1 + x2) { xs <- c(x1 = 1, x2 = exp(1), x3 = 2*pi) v <- all.vars(formula) stopifnot(length(v) == 2, all(v %in% names(xs))) sum(xs[v]) }

Re: [R] Arguments of a function

2010-01-09 Thread Peter Ehlers
You could define a list and then just access the appropriate elements of that list: my.f <- function(a, b) { x1 = equation 1 x2 = equation 2 x3 = equation 3 L <- list(x1, x2, x3) y <- L[[a]] + L[[b]] } my.f(1,2) my.f(2,3) -Peter Ehlers Lisa wrote: Dear all, I have a question about

Re: [R] Arguments of a function

2010-01-08 Thread Jim Lemon
On 01/09/2010 05:15 AM, Lisa wrote: Dear all, I have a question about how to set arguments in my own function. For example, I have a function that looks like this: my.f<- function(a = x1, b = x2) { x1 = equation 1 x2 = equation 2 x3 = equation 3 y = a + b } x1, x2, and x3 are t

Re: [R] Arguments of a function

2010-01-08 Thread Lisa
That's what I want. Thank you so much. Lisa Henrique Dallazuanna wrote: > > Try this: > > my.f <- function(a, b) { > x1 <- 2 * 3 > x2 <- 3 / 6 > x3 <- 4 * 4 / 5 - sqrt(2) > y <- get(deparse(substitute(a))) + get(deparse(substitute(b))) > return(y) > } > > my.f(x

Re: [R] Arguments of a function

2010-01-08 Thread Henrique Dallazuanna
Try this: my.f <- function(a, b) { x1 <- 2 * 3 x2 <- 3 / 6 x3 <- 4 * 4 / 5 - sqrt(2) y <- get(deparse(substitute(a))) + get(deparse(substitute(b))) return(y) } my.f(x1, x2) On Fri, Jan 8, 2010 at 4:15 PM, Lisa wrote: > > Dear all, > > I have a question about

[R] Arguments of a function

2010-01-08 Thread Lisa
Dear all, I have a question about how to set arguments in my own function. For example, I have a function that looks like this: my.f <- function(a = x1, b = x2) { x1 = equation 1 x2 = equation 2 x3 = equation 3 y = a + b } x1, x2, and x3 are temporary variables (intermediate resu

Re: [R] Arguments

2009-11-27 Thread Gabor Grothendieck
See ?commandArgs Also the getopt and optparse CRAN packages. On Fri, Nov 27, 2009 at 4:20 AM, yonosoyelmejor wrote: > > hello,I would like to ask a question,Is there any way to pass arguments to a > script?I have this code: > > Invernadero<-read.table(file.choose(),header=T,sep=",") > > attach(In

[R] Arguments

2009-11-27 Thread yonosoyelmejor
hello,I would like to ask a question,Is there any way to pass arguments to a script?I have this code: Invernadero<-read.table(file.choose(),header=T,sep=",") attach(Invernadero) names(Invernadero) Invernadero<-ts(Invernadero<-argument) //Here introduce the argument plot(Hora,Invernadero,main=ar

Re: [R] Arguments for Plot()

2009-11-17 Thread Karl Ove Hufthammer
On Tue, 17 Nov 2009 14:18:34 +0200 Tal Galili wrote: > Do you mean maybe: > > plot(x, ylim= range(x) ) Also, the various plot arguments are listed in ?plot.default It may be a bit confusing that they're not listed in ?plot but the help page *does* have a link to the help page for 'plot.default

Re: [R] Arguments for Plot()

2009-11-17 Thread Tal Galili
Do you mean maybe: plot(x, ylim= range(x) ) ? -- My contact information: Tal Galili E-mail: tal.gal...@gmail.com Phone number: 972-52-7275845 FaceBook: Tal Galili My Blogs: http://www.talgalili.com (Web and general, Hebrew) http://www.biostatistics

[R] Arguments for Plot()

2009-11-17 Thread Yoseph Zuback
Hello, I found a really awesome argument for the plot() function yesterday, I didn't write it down and really regretting it as I can't find the post that has it. I have a plot(e,y) One value really deviates and throws my y-axis off. I know I can do something like this: "x = seq(-0.4, 0.4, lengt

Re: [R] Arguments for Rcmd BATCH

2009-01-11 Thread Andrew Hicks
-project.org Subject: RE: [R] Arguments for Rcmd BATCH I suggested you use Rscript, please do. R CMD BATCH is the Unix-alike notation. Rcmd BATCH is the recommended way on Windows, but R CMD BATCH is also accepted. There is nothing to reproduce here, so here is a simple example. tystie% cat foo.R args

Re: [R] Arguments for Rcmd BATCH

2009-01-10 Thread Andrew Hicks
Hicks -Original Message- From: Prof Brian Ripley [mailto:rip...@stats.ox.ac.uk] Sent: 10 January 2009 18:18 To: Andrew Hicks Cc: r-help@r-project.org Subject: Re: [R] Arguments for Rcmd BATCH Your R is far too old, and in particular too old for the example you are trying. Please do

Re: [R] Arguments for Rcmd BATCH

2009-01-10 Thread Prof Brian Ripley
orry to impose on you but guess I am still doing something wrong. I have looked through the documentation but cannot find much on this or many examples. Many thanks, Andrew Hicks -Original Message- From: Prof Brian Ripley [mailto:rip...@stats.ox.ac.uk] Sent: 10 January 2009 18:18

Re: [R] Arguments for Rcmd BATCH

2009-01-10 Thread Prof Brian Ripley
Your R is far too old, and in particular too old for the example you are trying. Please do you as asked in the posting guide to do before posting, and upgrade. Then you will have Rscript, as described in the current 'An Introduction to R' manual for this purpose (with examples). On Sat, 10

[R] Arguments for Rcmd BATCH

2009-01-10 Thread Andrew Hicks
Sorry to bother you and I hope this will be easy to solve. I am trying to run R scripts in batch, called from another programme, under Windows XP. I have R 2.4.1 I need to be able to pass a list of numeric arguments to the script as well. The Rscript and its input data file are attached

Re: [R] Arguments to lm() within a function - object not found

2008-08-13 Thread Pete Berlin
Thanks very much for the quick reply. I had looked at the help for lm, but I clearly skimmed over the critical part explaining where weights is evaluated. Thanks, Pete On 13/8/2008, Prof Brian Ripley wrote: >On Wed, 13 Aug 2008, Pete Berlin wrote: > >> Hi all, >> >> I'm having some difficulty

Re: [R] Arguments to lm() within a function - object not found

2008-08-13 Thread Prof Brian Ripley
On Wed, 13 Aug 2008, Pete Berlin wrote: Hi all, I'm having some difficulty passing arguments into lm() from within a function, and I was hoping someone wiser in the ways of R could tell me what I'm doing wrong. I have the following: lmwrap <- function(...) { wts <- somefunction() print(wts)

[R] Arguments to lm() within a function - object not found

2008-08-13 Thread Pete Berlin
Hi all, I'm having some difficulty passing arguments into lm() from within a function, and I was hoping someone wiser in the ways of R could tell me what I'm doing wrong. I have the following: lmwrap <- function(...) { wts <- somefunction() print(wts) # This works, wts has the values I expec

[R] Arguments to lm() within a function - object not found

2008-08-13 Thread Pete Berlin
Hi all, I'm having some difficulty passing arguments into lm() from within a function, and I was hoping someone wiser in the ways of R could tell me what I'm doing wrong. I have the following: lmwrap <- function(...) { wts <- somefunction() print(wts) # This works, wts has the values I expec

Re: [R] Arguments become nonnumeric

2007-12-09 Thread jim holtman
Several different ways. You can look in the Intro to R to learn more: > my.list <- list(a=matrix(1:9,3), b=1:4, c="this is a string", d=list(1,2,3)) > my.list $a [,1] [,2] [,3] [1,]147 [2,]258 [3,]369 $b [1] 1 2 3 4 $c [1] "this is a string" $d $d[[1]

Re: [R] Arguments become nonnumeric

2007-12-09 Thread Mag. Ferri Leberl
Thank you, this seems promissing. How can I address then a certain element e.g. to add the second and the third component? Faithfully, Mag. Ferri Leberl Am Sonntag, den 09.12.2007, 07:11 -0800 schrieb jim holtman: > You program contains: > > de.dd<-c("Dresden",51,2,13,44) > > and since you are

Re: [R] Arguments become nonnumeric

2007-12-09 Thread jim holtman
Meant to say coerced to "character". See "?c" On Dec 9, 2007 6:14 AM, Mag. Ferri Leberl <[EMAIL PROTECTED]> wrote: > Dear Everybody, > Enclosed are the tiny beginning of a program and its output. > As a pity, if I load the image the elements of > are non numerical; returns de.dd[2] + de.dd[3]

Re: [R] Arguments become nonnumeric

2007-12-09 Thread jim holtman
You program contains: de.dd<-c("Dresden",51,2,13,44) and since you are mixing characters with numerics and putting them into a single vector, the data is coerced to a common data type, which in this case is numeric. What are you trying to do? Do you want to use a list? > de.dd [1] "Dresden" "5

[R] Arguments become nonnumeric

2007-12-09 Thread Mag. Ferri Leberl
Dear Everybody, Enclosed are the tiny beginning of a program and its output. As a pity, if I load the image the elements of are non numerical; returns . How can I keep the numbers numerical? Thank you in advance. hopefully, Mag. Ferri Leberl #Programm zur Erstellung eines Wasserwegenetzplanes #

Re: [R] Arguments to "personalised" plot()

2007-10-07 Thread Ted Harding
On 07-Oct-07 21:51:29, Rolf Turner wrote: > > On 8/10/2007, at 10:01 AM, Deepayan Sarkar wrote: >>[...] >> I'm not sure exactly which part you didn't expect. Given this >> definition of plotb, I would expect >> >> plotb(x,cos(x)) >> >> to expand to >> >> plot(x, pch="+", col="blue", cos(x)) >> >>

Re: [R] Arguments to "personalised" plot()

2007-10-07 Thread Rolf Turner
On 8/10/2007, at 10:01 AM, Deepayan Sarkar wrote: > On 10/7/07, Ted Harding <[EMAIL PROTECTED]> wrote: >> Hi Folks, >> >> I'm curious for an explanation of the following -- it's a >> matter of trying to understand how R parses it. >> >> I've written sundry little "helper" variants of functions, >

Re: [R] Arguments to "personalised" plot()

2007-10-07 Thread Ted Harding
On 07-Oct-07 21:01:08, Deepayan Sarkar wrote: > On 10/7/07, Ted Harding <[EMAIL PROTECTED]> wrote: >> Hi Folks, >> >> I'm curious for an explanation of the following -- it's a >> matter of trying to understand how R parses it. >> >> I've written sundry little "helper" variants of functions, >> in p

Re: [R] Arguments to "personalised" plot()

2007-10-07 Thread Deepayan Sarkar
On 10/7/07, Ted Harding <[EMAIL PROTECTED]> wrote: > Hi Folks, > > I'm curious for an explanation of the following -- it's a > matter of trying to understand how R parses it. > > I've written sundry little "helper" variants of functions, > in particular plot(), to save repetitively typing the same

[R] Arguments to "personalised" plot()

2007-10-07 Thread Ted Harding
Hi Folks, I'm curious for an explanation of the following -- it's a matter of trying to understand how R parses it. I've written sundry little "helper" variants of functions, in particular plot(), to save repetitively typing the same options over and over again. For example: plotb <- function(x