similar to: R equivalent of Python str()?

Displaying 20 results from an estimated 5000 matches similar to: "R equivalent of Python str()?"

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 Nov 01
4
building a subscript programatically
Hi, On ocasion, you need to subscript an array that has an arbitrary (ie. not known in advance) number of dimensions. How do you deal with these situations? It appears that it is not possible use a list as an index, for instance this fails: > x <- array(NA, c(2,2,2)) > x[list(TRUE,TRUE,2)] Error in x[list(TRUE, TRUE, 2)] : invalid subscript type 'list' The only way I know is
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
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 <-
2012 Feb 03
2
sapply help
Hi every one. I'm learning how to use sapply (and other function of this family). Here's what I'm trying to do. I have a vector of lets say 5 elements. I also have a matrix of nX5. I would like to know how many element by column are inferior to each element of my vector. On this example: v = c(1:5) M = matrix(3,2,5) I would like to have a vector at the end which give me 0 0 0 2 2
2012 Feb 07
1
using mclapply (multi core apply) to do matrix multiplication
Dear all, I am trying to multiply three different matrices and each matrice is of size 16384,16384 the normal %*% multiplciation operator has not finished one day now. As I am running a system with many cores (and it seems that R is using only one of those) I would like to write fast a brief function that converts the typical for loops of a matrix multiplication to a set of lapply sets (mclapply
2012 Feb 06
2
Reordering levels of a factor when the factor is part of a data frame
Hello R-users,    I have a data frame whose names of columns I don't know a priori, but the user of my code will know them. The user is supposed to save the name of the column that will need some reordering of the levels of the factor later on. The name of the column will be saved in an object called: variab the data frame is called df. If I try to the do following:
2012 Feb 03
3
replicate rows
Hello, I have a matrix of 17 rows and 20 columns. I want to replicate this matrix 20 times, but I only want to replicate the rows. How do I do that? Kind regards / Met vriendelijke groet / Med venlig hilsen, Dr. Gijs Schumacher Postdoctoral Researcher Department of Political Science and Public Management, University of Southern Denmark & Department of Political Science, VU University
2003 Sep 16
3
Follow Me
Ernest, I hadn't thought of doing that, though having that added protection would be nice. However, what I'm trying to do it have an incoming call at my home number follow me to my cell phone for selected numbers -- Since I already have three way calling, I'd like get Asterisk to essentially three way my cell phone into the call (or my office number, etc.) I understand the
2003 Dec 08
1
Re: Asterisk-Users digest, Vol 1 #2120 - 14 msgs
In response to the postings by Andrew Kohlsmith and Ernest W. Lessenger: Andrew, I modified the exten line in extensions.conf as you suggested. Unfortunately, It still does not work... Ernest, I spent approx. 4 hours reading list archives (and anything else Google served up) on how to configure iax.conf and extensions.conf to work with Voicepulse. Then, I sent an email to voicepulse
2018 Nov 23
1
[tryExcept] New try Function
Hi Emil, First, thanks for the response. As you mentioned, a lot of times tryCatch does the work, as you can return a value. However, sometimes it is useful to assign several variables when an error occurs. You could do it with <<-, but I prefer to reduce it's usage unless completely necessary. I guess that the attachment was missed in the moderation. Here it is the function:
2003 Sep 15
2
Cisco 7905
Can anyone tell me the features of the Cisco 7905 with SIP? I mean things like number of lines, speakerphone, transfer buttons, etc. I've seen the Cisco material, but all it told me was how nifty it is and how wonderful the XML interface will be ;) Thanks, --Ernest
2011 Mar 12
1
hardware compatibility list
Arnaud Quette <aquette.dev at gmail.com> va escriure (2011-02-28 14:48): > > 2011/2/14 Ernest Sales <ersaloz at gmail.com> > > > Arjen de Korte <nut+users at de-korte.org> va escriure: > > > This is a known problem in nut-2.4.3 and should be solved in > > > nut-2.6.0. We have also dropped the megatec and > megatec_usb drivers, > > >
2012 Feb 08
2
Memory allocation problem (again!)
Dear all, I know this problem was discussed many times in forum, however unfortunately I could not find any way out for my own problem. Here I am having Memory allocation problem while generating a lot of random number. Here is my description: > rnorm(50000*6000) Error: cannot allocate vector of size 2.2 Gb In addition: Warning messages: 1: In rnorm(50000 * 6000) : Reached total allocation
2003 Oct 01
1
Audiocodes gateway and asterisk
Is anyone on the list using an Audiocodes gateway with asterisk and SIP? I'm looking at that platform, but I have a couple of issues: 1) Echo cancellation. The echo that I'm hearing with an X100P is unacceptable. Does the Audiocodes do better? 2) Line signalling. I'm using Kewlstart with the X100P, but it looks like the audiocodes uses loopstart only. How does this work with
2003 Oct 21
1
SNOM 200 beta build + MOH
I'm using the SNOM 200 latest SIP beta (so that I can have the GSM codec, etc). Everything seems to be working fine, but the music on hold doesn't play when I use the HOLD button on the snom. Any suggestions? Thanks, --Ernest
2007 Jan 04
3
hidups can't find device
Hello, I try to install my APC Back-UPS RS 800 on my debian system (Etch): Linux aigner 2.6.18-3-686 #1 SMP Mon Dec 4 16:41:14 UTC 2006 i686 GNU/Linux When i try to start the driver an i use hidups i get this failure massage: aigner:/lib/nut# upsdrvctl start Network UPS Tools - UPS driver controller 2.0.4 Network UPS Tools: HID UPS driver 0.13 (2.0.4) Warning: This is an experimental driver.