similar to: transforming a matrix of logical to 0 and 1 while keeping the dim of matrix

Displaying 20 results from an estimated 20000 matches similar to: "transforming a matrix of logical to 0 and 1 while keeping the dim of matrix"

2010 Dec 19
2
Resource for learning C/R interface
Hi all, Is there any tutorial for learning C/R interface ? Thanks Regards, Julian [[alternative HTML version deleted]]
2011 Feb 25
1
Question about foreach (with doSNOW), is that a bug?
Hi all, Within a foreach loop with doSNOW, we cant call functions which come from the non-default package. We need to load(require/library) the package once more within the foreach loop. Anyone knows why would happen like this? Is it caused by the snow package and something happened when "snow" parallelize the job? Other than load the package once more with in the foreach loop, is
2011 May 26
1
Question about ggplot2
Hi all, Is there any way for me to to string in the argument of qplot or ggplot? for example qplot(x='carat',y='price',data=diamonds,geom=c('point','smooth')) instead of qplot(x=carat,y=price,data=diamonds,geom=c('point','smooth')) Thanks!! Regards, TszKin Julian [[alternative HTML version deleted]]
2012 Aug 25
2
date
Hi, I have dates as follows: 1/4/2006 0:00:00 AM It is a factor at present. How do I find out the day of the week from this? How do I convert to Julian date format? Thanks. Chetty -- Professor of Family Medicine Boston University Tel: 617-414-6221, Fax:617-414-3345 emails: chettyvk@gmail.com,vchetty@bu.edu [[alternative HTML version deleted]]
2012 Apr 21
2
Date object
HI, I have to work with data objects. I have trouble. I would like to convert date to a integer of Julian dates omitting hours, minutes etc. I tried as. Date and also as.POSIXlt, ct etc. Please help me to compute the following difference. I get an "NA" for output. 1/14/2006 0:00:00 AM -1/9/2006 0:00:00 AM Thanks. Chetty -- Professor of Family Medicine Boston University Tel:
2007 Oct 07
2
@dim = Date.civil(2007,8,1).day fails on OS X
the above line of code always produces an "invalid date" when run via a controller on OS X, ROR v1.2.3 install via MacPorts. I ran the same controller on Kubunut 7 with no issue thanks -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core"
2001 Nov 09
2
Transforming matrix to data.frame: problems
Hi all, I have problems transforming a matrix into a data.frame: If I do: > is.matrix(parcelas.cobtot.conti) [1] TRUE > dim(parcelas.cobtot.conti) [1] 25 64 > a <- data.frame(parcelas.cobtot.conti) > is.data.frame(a) [1] TRUE > > dim(a) [1] 1600 3 Why a does not have the same dimensions than parcelas.cobtot.conti? I've tested with caith and the behaviour there
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?
2003 Apr 10
6
Transforming matrix
hi everybody, anyone knows how we can transform a binary matrix with TRUE and FALSE to 0 and 1 without looping? Thx --------------------------------- [[alternate HTML version deleted]]
2008 Mar 05
3
How to make a 2-dim array being "interpreted" as an array rather than as a matrix
Dear List A 2-dimensional array seems to be "interpreted" as a matrix whereas higher dimensional arrays are interpreted as arrays, e.g. > a1 <- array(1:8,c(2,2,2)) > class(a1) [1] "array" > a2 <- array(1:4,c(2,2)) > class(a2) [1] "matrix" If I write a generic function (apologies if this is the wrong word) on arrays as foo <- function(x)
2010 Nov 08
4
Create Matrix of 2 Dim from two vectors
Hello, I have two data. x<-c(1, 2, 3) y<-c(4,5,6) How do i create matrix of 3 by 3 from this two, such that (1,4) (1,5) (1,6) (2,4) (2,5) (2,6) (3,4) (3,5) (3,6) I tried some thing like this: xy <- as.data.frame(c(0,0,0), dim=c(3,3)) for(i in 1:3) for(j in 1:3) xy[i][j]<-c(x[i],y[j]) but i got errors..!!!! any help would appreciate -- View this message in
2009 Mar 13
1
transforming a matrix
Hello, I have a matrix such as > X = matrix(c(1:4,29,32,56,-45), ncol=2) and I want one like > Y=matrix(c( 1 , 34 , 1 , 34 , 2 , -56 , 1 , 34 , 3 , 27 , 1 , 34 , 1 , 34 , 2 , -56 , 2 , -56 , 2 , -56 , 3 , 27 , 2 , -56 , 1 , 34 , 3 , 27 , 2 , -56 , 3 , 27 , 3 , 27 , 3 , 27 ), ncol=4, byrow=T) How do I do this in an efficient and elegant way? Many thanks, Dimitri [[alternative HTML
2011 May 30
3
Transforming a data matrix into a vector
Hi, I am trying to transform a data matrix into a vector and have not be able to accomplish want I am looking for. The setup is as follows. I start with a 3 x 3 matrix: 5 1 3 3 3 2 1 2 4 I would like to transorm it into a 27 x 1 vector of the follwing form 5 5 5 1 1 1 3 3 3 . . . 1 1 1 2 2 2 4 4 4 In essense I want to create a vector in which each element of the original matrix is repeated
2003 Mar 15
1
formula, how to express for transforming the whole model.matrix, data=Orthodont
Hi, R or S+ users, I want to make a simple transformation for the model, but for the whole design matrix. The model is distance ~ age * Sex, where Sex is a factor. So the design matrix may look like the following: (Intercept) age SexFemale age:SexFemale 1 1 8 0 0 2 1 10 0 0 3 1 12 0 0 4
2008 Mar 28
1
Beginner help with retrieving frequency and transforming a matrix
Hi All, Just hoping some one can give me a hand with a problem... I have a dataframe (DF) with about 5 million entries that looks something like the following: >DF ID Cl Co Brd Ind A AB AB 1 S-3 IND A BR_F BR_F01 1 0 0 2 S-3 IND A BR_F BR_F01 1 0 0 3 S-3 IND A BR_F BR_F01 1 0 0 4 S-3 IND A BR_F BR_F01 1 0 0 5 S-3 IND A BR_F BR_F01 1 0 0 6 S-3 IND A BR_F
2009 Nov 12
1
Transforming a dataframe into a response/predictor matrix
I currently have a data frame whose rows correspond to each student and whose columns are different variables for the student, as shown below: Lastname Firstname CATALOG_NBR Email StudentID EMPLID Start 1 alastname afirstname 1213 *@uark.edu 10295236 # 12/2/2008 2 anotherlastname anotherfirstname 1213 **@uark.edu ## 10295236 9/3/2008 Xattempts Q1
2004 Dec 31
2
FC2 & ztcfg - cannot find channel 2
When I try to start up zaptel, whilst running ztcfg, I get the following error: Jan 1 10:48:18 bu ztcfg: ZT_CHANCONFIG failed on channel 2: No such device or address (6) My /etc/zaptel.conf is: fxsks=1 fxoks=2 loadzone = au defaultzone=au Channel 1 is a X101P card connected to the PSTN and channel 2 is a S100U box driving an analogue phone. The zaptel kernel module gets loaded OK as does the
2012 Feb 18
2
transforming a data frame to matrix
Hello > orderulcount Group.1 Group.2 Group.3 x V5 7 C L 0.0 30 C / L 19 C L 0.2 27 C / L 31 C L 0.4 15 C / L 43 C L 0.6 7 C / L 54 C L 0.8 2 C / L 10 C S 0.0 27 C / S 22 C S 0.2 10 C / S 34 C S 0.4 6 C / S 46 C S 0.6 1 C / S 1 D
2006 Feb 27
3
how to use the basis matrix of "ns" in R? really confused by multi-dim spline filtering?
Hi all, Could anybody recommend some easy-to-understand and example based notes/tutorials on how to use cubic splines to do filtering on multi-dimension data? I am confused by the 1-dimensional case, and more confused by multi-dimensional case. I found all the books suddenly become very abstract when it comes to this subject. They don't provide examples in R or Splus at all. Specifically,
2017 Nov 22
2
ccomp Composition and ggtern plot...
Dear Users, I would like to use compositions package with ggplot/ggtern, other composition classes of compositional package can be used with ggtern by converting to data frame but I could do anything with c(ount)comp class. Ggplot/ggtern can not recognise comp and also can not be converted to data frame. Is there any other way to do this? Thank you in advance, Levent TERLEMEZ.