search for: dimensionless

Displaying 11 results from an estimated 11 matches for "dimensionless".

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 an argument that was incorrect. How do I do this? Or maybe there is another way... -- Ernest
2006 Nov 21
2
keeping dim() for array
Hi All, I noticed the following: pip = array(1:6, dim = c(3,2)) dim(pip) [1] 3 2 pup = pip[1,] dim(pup) NULL I bet there is a *good* reason why one row of an array is *dimensionless*, but it's highly inconvenient for my purpose, i.e. to use apply() after an array goes through a number of logical steps and is redimensioned, sometimes to one single row. How do I keep dim(pup) to 1 2? Since pup is at the end of a number of if(), it does not necessarily end up as one row...
2012 Jun 08
3
Rose plot (like a windrose)
Dear R Gurus, I spent some time in looking for help but didn't find a way to do what I want. I do have a vector (in Degrees) containing of 360 elements, one element per degree on a circle. The data is dimensionless and in the range of -0.2 to 0.5. An Example: Wind Dir [degrees], Value 1, 0.1 2 , 0.3 3 , 0.01 .,. .,. 180,-0.01 181,-0.2 .,. .,. .,. 359,.0.3 360,.0.5 Now I want to have some kind of "rose" plot, a bit like a wind rose. Where the actual values per degree are plottet on a circle...
2009 Feb 06
1
Operations on difftime (abs, /, c)
...tions and I see no obvious reason that they should give an error: sec <- as.difftime(-3:3,units="secs") hour <- as.difftime(-3:3,units="hours") abs( sec ) => error ... why not 3 2 1 0 1 2 3 secs? hour/sec => error ... why not 3600, 3600, ... (dimensionless numbers)? Of course, it is trivial to overload these operations for difftime-class arguments: abs.difftime <- function(x) ifelse(x<0,-x,x) > abs(sec) [1] 3 2 1 0 1 2 3 `/.difftime` <- function (e1, e2) { if (!inherits(e2, "difftime"))...
2009 Feb 06
1
Operations on difftime (abs, /, c)
...tions and I see no obvious reason that they should give an error: sec <- as.difftime(-3:3,units="secs") hour <- as.difftime(-3:3,units="hours") abs( sec ) => error ... why not 3 2 1 0 1 2 3 secs? hour/sec => error ... why not 3600, 3600, ... (dimensionless numbers)? Of course, it is trivial to overload these operations for difftime-class arguments: abs.difftime <- function(x) ifelse(x<0,-x,x) > abs(sec) [1] 3 2 1 0 1 2 3 `/.difftime` <- function (e1, e2) { if (!inherits(e2, "difftime"))...
2008 Oct 30
2
Adding PDU support to NUT
...be extended with the following data: outlet.n.current: Current (milliamps RMS) outlet.n.current.maximum: Maximum seen current (milliamps RMS) outlet.n.realpower: Current value of real power (Watts) outlet.n.voltage: Voltage (V) outlet.n.powerfactor: Power Factor (dimensionless value between 0.00 and 1.00) outlet.n.power: Apparent power (VA) - status_{}() needs only to process when device.type=ups More generally, I think that NUT is able to handle the smart power devices that will appear in the future. And the above change will help in going in that direction....
2009 Aug 19
5
scale or not to scale that is the question - prcomp
Dear all here is my data called "rglp" structure(list(vzorek = structure(1:17, .Label = c("179/1/1", "179/2/1", "180/1", "181/1", "182/1", "183/1", "184/1", "185/1", "186/1", "187/1", "188/1", "189/1", "190/1", "191/1", "192/1",
2006 Sep 22
4
Creating Movies with R
...2*lam1*t)-1)/(2*lam1)-2/(lam1+lam2)*(exp(lam1*t+lam2*t)-1) + (exp(2*lam2*t)-1)/(2*lam2) ) } rho_x<-function(x,expect_position,sigma_pos) { 1/sqrt(2*pi*sigma_pos)*exp(-1/2*(x-expect_position)^2/sigma_pos) } #### Now the physical parameters tau<-0.1 beta<-1/tau St<-tau ### since I am in dimensionless units and tau is already in units of 1/|alpha| D=2e-2 q<-2*beta^2*D ############### Now the grid in space and time time<-5 # time extent tsteps<-501 # time steps newtime<-seq(0,time,len=tsteps) #### Now the things specific for the dynamics along x lam1<- -beta/2*(1+sqrt(1+4*St)) lam...
2012 Feb 20
2
Column wise matrix multiplication
Hi all, I am trying to multiply each column of a matrix such to have a unique resulting vector with length equal to the number of rows of the original matrix. In short I would like to do what prod(.) function in Matlab does, i.e. A <-matrix(c(1:10),5,2) V = A[,1]*A[,2] Thank you Graziano [[alternative HTML version deleted]]
2012 Feb 07
2
units for mapproject() function result
Does anyone know what the units are for projected coordinates obtained using mapproj's mapproject function with an Albers projection? Thanks for any and all help! Buck Stockhausen *************************************************** * Dr. William T. Stockhausen * *************************************************** * Resource Ecology and Fisheries Management * *
2018 Nov 06
0
An update on the vctrs package
...tion that captures the number of ?observations? in a vector. This particularly important for data frames because it?s useful to have a function such that `f(data.frame(x))` equals `f(x)`. No base function has this property: `NROW()` comes closest, but because it?s defined in terms of `length()` for dimensionless objects, it always returns a number, even for types that can?t go in a data frame, e.g. `data.frame(mean)` errors even though `NROW(mean)` is `1`. ``` r vec_size(1:10) #> [1] 10 vec_size(as.POSIXlt(Sys.time() + 1:10)) #> [1] 10 vec_size(data.frame(x = 1:10)) #> [1] 10 vec_size(array(dim =...