similar to: building a subscript programatically

Displaying 20 results from an estimated 5000 matches similar to: "building a subscript programatically"

2012 Feb 08
3
R equivalent of Python str()?
Hi, I was wondering if there's a function in R that is meant to return a string representation of an object. Basically, it's like print() but it doesn't print anything, it only returns a string. I know there's a str() function but it's not quite the same. I mean a function that returns the same string that print() would display. -- Bye, Ernest
2011 Feb 03
3
get caller's name
Hi, Suppose a function that checks an object: stop.if.dims <- function(x) { if (! is.null(dim(x))) { stop("cannot handle dimensional data") } } This would be used by other functions that can only work with dimensionless objects. The problem is the error message would need to include the name of the function that called stop.if.dims, so that the user knows which function got
2011 Jan 28
3
sapply puzzlement
Hi, I have this data.frame with two variables in it, > z V1 V2 1 10 8 2 NA 18 3 9 7 4 3 NA 5 NA 10 6 11 12 7 13 9 8 12 11 and a vector of means, > means <- apply(z, 2, function (col) mean(na.omit(col))) > means V1 V2 9.666667 10.714286 My intention was substracting means from z, so instictively I tried > z-means V1 V2 1 0.3333333
2011 Nov 23
1
how to stack a list of arrays
Hello, I have this list of 2-d arrays: $`0` k d [1,] 0.2011962 4.019537 [2,] 0.2020706 5.722719 [3,] 0.2029451 7.959612 $`1` k d [1,] 0.3148325 2.606903 [2,] 0.3160287 3.806665 [3,] 0.3172249 5.419222 $`2` k d [1,] 0.2332536 4.949390 [2,] 0.2342188 7.115258 [3,] 0.2351840 9.955909 which I need to transform into a data frame like this
2011 Aug 15
1
accumulative grouping of time series
HI there, Consider a data set like this: > x <- data.frame(a=1:10, b=11:20, t=c(1,1,1,2,2,2,3,3,3,3)) > x a b t 1 1 11 1 2 2 12 1 3 3 13 1 4 4 14 2 5 5 15 2 6 6 16 2 7 7 17 3 8 8 18 3 9 9 19 3 10 10 20 3 Here x$t is a vector of integers that represent a moment in time. I would like to calculate a function of a & b at each moment (t0), but using the rows
2012 Jan 31
1
dimensions dropped on assignment
Hi there, This is a problem I've run into and do not know how to avoid. It happens when I make an assignment using the dimension names as the subscript of the array. The end result is a dimenensionless array (i.e. a vector) which I don't want. See: > out <- array(0, 5, list(1:5)) > dim(out) [1] 5 > out[names(out)] <- 1 > dim(out) NULL I tried to include a
2013 Apr 03
3
arrayInd and which
Folks, I have Googled but not found much regarding arrayInd aside from the "which" help page. Any good examples or docs on what arrayInd does that is better or different from which()? In addition take the following 20x10 matrix: td<-structure(c(1, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 4, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 1, 6, 6, 6, 6, 6, 6, 6, 1, 6, 6, 6, 6,
2016 May 23
2
data frame method for as.table()
Hello, Currently it's possible to convert an object of class table to a data frame with as.data.frame.table(), but there's no ready-made function, AFAIK, to do the reverse operation, i.e. conversion of a data frame to a table. Do you think it would be a good idea to add a data.frame method to as.table(), to allow such conversions? The idea is that if `x' is a table and `y <-
2010 Sep 11
1
'programatically' list or call objects for use in a function?
Esteemed R users and developers, How does one 'programatically' list or call objects for use in a function? For example, i thought i could do something better than this: save(A.cwb, B.cwb, C.cwb, D.cwb, E.cwb, F.cwb, file="afile.RData") with something like these- prfxs <- c("A", "B", "C", "D", "E", "F") #**
2005 Sep 28
3
is it possible to form matrix of matrices...and multiple arrays
Dear sirs, 1...........Kindly tell me is it possible to form a matrix which contains a no of matrices.. for eg.. if a,b,c,d are matrices.... and e is a matrix which contains a,b,c,d as rows and columns.. 2..........Is it possible to form array of array of arrays for eg.. "A" contains two set of arrays (1,2)...and each A[1] and A[2] individually contains two set of arrays I tried like
2006 Oct 04
1
Re: Programatically checking if we''re in a domU or dom0
> Personally, I use the following command in a > startup script to check if we''re in a privileged > domain: > > grep -qsE ''^control_d$'' /proc/xen/capabilities Hi Andrew, thanks for your tip. Now I can easily determine wether I''m running on a modified kernel or not (by checking for the presence of /proc/xen). However, once I''ve found
2006 Oct 05
0
Re: Programatically checking if we''re in a domU or dom0
Thanks for your answers... But IMHO it''s hacky and error-prone to rely on the name of the host to determine if it''s a domU or a dom0 (or an unmodified kernel) :( I don''t like that much neither changing the name of the kernel :-/ I need to be able to determine, as a normal user (that is: non-root), if I''m running in a domU or not (I can already tell if
2003 Jul 30
6
reverse array indexing
Hi, Suppose I have a multidimensional array: tmp <- array(1:8, c(2,2,2)) is there a function out there that, given a one-dimensional array index, will return the separate indices for each array dimension? for instance, tmp[8] is equivalent to tmp[2,2,2]. I'd like to derive the vector (2,2,2) from the index 8. thanks, Brad Buchsbaum
2005 Jul 28
1
Programatically Modifying Users
Hi all, I have been lurking here on and off for a while and have recently returned after being off-list for a few months, I've searched the MARC list archives and can't see any useful information for my situation. Basically, I have a system that calls out to the samba command line utilities pdbedit/smbpasswd etc to modify user account information. This is okay, but very slow and
2007 Mar 05
3
programatically stopping acts_as_ferret drb server
I need a way to kill the ferret_server drb process programatically, so I can start/stop it as part of the capistrano deployment process. This should be as simple as adding some sort of stop method to ActsAsFerret::Remote::Server. I was just messing around and was able to do it by modifying method_missing to look for the :stop method and then calling DRb.thread.exit -- this is not good enough for
2004 Feb 23
2
Error in multiple xyplots
Dear R-listers, I got an error when I try to plot two grouped data into a single win.metafile device: library(lattice) trellis.device(device="win.metafile",color=F,filename="Profiles-Var1.wmf") par(mfrow=c(1,2)) # First plot xyplot(log(v)~t|id,data=Con.20, main="Group A: Control, Var-1", xlab="ocasion",ylab="var1", panel=function(x,y) {
2013 Jul 01
1
Male and female signs as subscript in plot
Hello, I'd like to add labels to my plot that include a male or female symbol as subscript. I'm working in Windows Vista and R 3.0.0. I am able to add the male symbol to the plot as regular text (NOT as subscript), e.g. with: mtext("Male\u2642") This displays the word "Male" followed by the male symbol on the plot. But "\u2642" does not work when I try to
2018 Jun 08
3
Subsetting the "ROW"s of an object
> On Jun 8, 2018, at 10:37 AM, Herv? Pag?s <hpages at fredhutch.org> wrote: > > Also the TRUEs cause problems if some dimensions are 0: > > > matrix(raw(0), nrow=5, ncol=0)[1:3 , TRUE] > Error in matrix(raw(0), nrow = 5, ncol = 0)[1:3, TRUE] : > (subscript) logical subscript too long OK. But this is easy enough to handle. > > H. > > On
2018 Jun 08
4
Subsetting the "ROW"s of an object
> On Jun 8, 2018, at 11:52 AM, Hadley Wickham <h.wickham at gmail.com> wrote: > > On Fri, Jun 8, 2018 at 11:38 AM, Berry, Charles <ccberry at ucsd.edu> wrote: >> >> >>> On Jun 8, 2018, at 10:37 AM, Herv? Pag?s <hpages at fredhutch.org> wrote: >>> >>> Also the TRUEs cause problems if some dimensions are 0: >>>
2005 Apr 12
2
SIGUP? Losing Share
Hello, I'm new to the list and pretty much a newbie to linux and samba. I'm quick learner though. I have been losing my samba share upon ocasion recently, below is a portion of the syslog from the time period that I think is when the share goes down. A reboot of the server or a restart of the smbd fixes the problem (....until it happens again) I don't know what SIGUP is or why