similar to: Assigning a function to the 'times' argument of rep()

Displaying 20 results from an estimated 300 matches similar to: "Assigning a function to the 'times' argument of rep()"

2012 Feb 23
3
I'm sure I'm missing something with formatC() or sprintf()
I have a four-digit string I want to convert to five digits. Take the following frame: zip 2108 60321 60321 22030 91910 I need row 1 to read '02108'. This forum directed me to formatC previously (thanks!) That usually works but, for some reason, it's not in this instance. Neither of the syntaxes below change '2108' to '02108.' The values in cand_receipts[,1] are of
2012 Dec 08
5
How to efficiently compare each row in a matrix with each row in another matrix?
Dear expeRts, I have two matrices A and B. They have the same number of columns but possibly different number of rows. I would like to compare each row of A with each row of B and check whether all entries in a row of A are less than or equal to all entries in a row of B. Here is a minimal working example: A <- rbind(matrix(1:4, ncol=2, byrow=TRUE), c(6, 2)) # (3, 2) matrix B <-
2011 Dec 04
3
Prediction from censReg?
Hi - First post, so excuse any errors in protocol: Wanted to ask if there's an easy way to use 'predict' with objects of class 'censReg', 'maxLik', 'maxim' or 'list'. Have a left-censored dataset, attempting to use a Tobit model and am working with the censReg package. I like how easy it is to move from glm models to predictions with
2012 Mar 20
1
passing xlim to coord_map in ggplot2
I'm sure this is smack-head moment, but I haven't been able to find an example of this on Nabble or SO, so thought I'd ask. This works: michigan <- map_data('county', 'michigan') mich_points <- data.frame(x = rnorm(n = 200, median(michigan[,1]), 0.75), y = rnorm(n = 200, median(michigan[,2]), 0.75)) ggplot() + geom_path(aes(long, lat, group = group), data =
2012 Mar 27
1
Unique instances of a string in a vector -- there must be a better way to do this
I'm sure there's a better way to do this using plyr. I just can't nail the right series of commands. I've got a vector of strings. I want to remove all where the string's count within the vector is > 1. Right now I'm using: Where x2 is the original data.frame and my character strings live in x2[,3]. Based on my results, that looks like it works, though if someone
2012 Mar 28
1
Why does this work? plyr within-subset normalization
Working code that normalize each row's value against the subset's maximum. Does the invocation of max() somehow instruct R to 'step back' and evaluate the subset? Thanks, Zack -- View this message in context: http://r.789695.n4.nabble.com/Why-does-this-work-plyr-within-subset-normalization-tp4512989p4512989.html Sent from the R help mailing list archive at Nabble.com.
2012 Mar 12
1
Installing RMySQL -- 64-bit Windows 7
Trying to install RMySQL on 64-bit Windows 7. Using R-2.14.2 with Rtools214 and MySQL Server 5.5. Read through several step-by-steps of RMySQL source installation. Troubleshooting: - Copied libmysql.dll to R-2.14.2/bin AND R-2.14.2/bin/i386. - Copied libmysql.dll and libmysql.lib to MySQL Server 5.5\lib\opt. - Entered MYSQL_HOME=C:\Program Files\MySQL\MySQL Server 5.5 into Renviron.site,
2012 Apr 04
1
Subscript Error
json_dir is a list of JSON lists mapping lat/long route points between locations using CloudMade's API. post_url is the URL of the HTTP request for (n in json_dir) { i = i + 1 if (typeof(json_dir[[i]]) != "NULL") { if (i == 1) { dat_add <- ldply(json_dir[[i]], function(x) t(data.frame(x)), .progress = "text")
2008 Jan 23
3
Problem with UL followed by OL
I got a problem with UL followed by by OL when I using perl module "Text-Markdown-1.0.5". I wrote the following markdown code. - a - b 1. 1 2. 2 I expected that Text-Markdown would produce the following HTML. <ul> <li>a</li> <li>b</li> </ul> <ol> <li>1</li> <li>2</li> </ol> However, "Text-Markdown-1.0.5"
2003 Dec 23
1
Can't add printer drivers.
I am having quite some difficulty adding printer drivers to the print$ share of my Linux box. Here are the details: Debian Gnu/Linux with kernel 2.4.18 on a Sun Ultra 2. Samba version 2.2.3a. CUPS version 1.1.19. I am following along in the printer_driver2.txt file. Here are the relevant lines of my smb.conf: [global] username map = /etc/samba/user.map workgroup = CDE server string = %h
2004 Sep 29
2
defining a template for functions via do.call and substitute.
Hi, Given a function fun <- function(a, b) a + b how do I generate the function 'function(x, y) x + y'? Working from the help files and Bill Venables' R-news article (June 2002), I have tried various permutations with substitute without success. e.g. do.call("substitute", list(fun, list(a = as.name("x"), b = as.name("y")))) Regards, John.
2018 Nov 08
2
panic when using dovecot master account
Hello, I am running dovecot 2.2.34 (874deae), on Debian stable, from backports. I just tried the master account, and although everything worked in the email client, I had logs in the error logs: > imap(mirina): Panic: file mail-index-sync.c: line 413 > (mail_index_sync_begin_to2): assertion failed: (!index->syncing) > Nov 08 22:06:24 osaka dovecot[1450]: imap(mirina): Error: Raw
2006 Mar 29
3
Self-referential many-many joins with :through
I thought I had this nailed but.. now I''m seeing spots.. I''ve included my models below, feel free to ignore them. I''m really just after an example that works. I couldnt find one on the wiki... which is fair enough considering Ricks patch: http://dev.rubyonrails.org/changeset/4022 that fixed them only went through 5 days ago.. Cheers -henster
2006 Mar 15
3
Self-referential join model does not work
I have been trying to model a labeled graph using ActiveRecord (trunk version). Basically, I have a ''Node'' model which represents a node linking to other nodes. Links (aka edges) are labeled (i.e., have a ''label'' attribute and other behavior). Thus I decided to model edges as an ''Edge'' model and use a ''has_many :trough''
2006 Jun 19
1
lattice xyplot - aligning date labels so that they align with the grid lines in panel.grid
Hi, I have a basic question about aligning date labels for the x-axis in an xyplot so that they align with the grid lines from the panel.grid argument. For example, with x <- data.frame( date = seq(as.Date("2005/01/01"), as.Date("2006/06/01"), length.out = 20), value = runif(20)) xyplot(value ~ date, data = x, panel = function(x, y, subscripts, ...) {
2018 Nov 09
2
panic when using dovecot master account
On 2018-11-09 05:25, Aki Tuomi wrote: > This seems to have nothing to do with master account or not. Does this > happen if you try to open the virtual mailbox again? > > Aki > >> On 09 November 2018 at 00:13 Andr? Rodier <andre at rodier.me> wrote: >> >> >> Hello, >> >> I am running dovecot 2.2.34 (874deae), on Debian stable, from
2004 Oct 06
3
lapply with argument "X"
Hi, I am probably making a simple mistake but I can't see it > X Error: Object "X" not found > exists("X") [1] FALSE > lapply("X", exists) [[1]] [1] TRUE Why is lapply producing true? Is it something to do with the first argument of lapply also being called 'X'? > version _ platform i386-pc-mingw32 arch i386
2004 Sep 29
2
defining a template for functions via do.call and substit ute.
Here's one not-so-straightforward way: > f <- function(a, b) a + b > flist <- as.list(f) > names(flist)[1:2] <- c("x", "y") > flist[[3]] <- do.call("substitute", list(body(f), list(a=as.name("x"), b=as.name("y")))) > g <- as.function(flist) > g function (x, y) x + y HTH, Andy > From: john.gavin at ubs.com
2007 Feb 05
2
Rconsole - setting the size and location of Windows help files (Rgui)
Hi, Using the Rconsole file I can specify the size and location of the Rgui windows on NT. e.g. # Dimensions (in characters) of the console. rows = 51 columns = 100 How can I specify the size of the help windows that popups when I ask for help? e.g. '?help' I would like the popup window to have say rows = 51 and columns = 100, just like the main window but a different location on the
2016 Jan 15
1
Error in socketConnection(master, port = port, blocking = TRUE, open = "a+b", : cannot open the connection
Dear All I have sucessfully created cluster of four nodes using localhost in my local machine by executing the following command > cl<-makePSOCKcluster(c(rep("localhost",4)),outfile='',homogeneous=FALSE,port=11001) starting worker pid=4271 on localhost:11001 at 12:12:26.164 starting worker pid=4280 on localhost:11001 at 12:12:26.309 starting worker pid=4289 on