similar to: storing matrix(variables) in loop

Displaying 20 results from an estimated 1000 matches similar to: "storing matrix(variables) in loop"

2009 Dec 01
3
Using two (...) in a function
Hello R-Helpers, I am not sure if it is a very simple question but I would like to use two (...) in a function, for example, this is a script where I would like to input the variable names (in one of the (...)) and the variances associated to those variables which are not calculated in the script because there is a specific software to calculate it (the other (...)) data <- function
2009 Sep 17
3
How to separate a function by 2 probabilities
Good Mourning, I have a function to generate a matrix as I show part of it; g[j,i]<-if (gen[j,i]==0) al1[i,1]+al1[i,1] else ... However i would like that this function occurred with a probability P and that another function (another formula to generate g matrix) with probability P-1 That?s it, if P is .7, i would like that in 70% of the times (for random i and j) the matrix g was generated
2009 Mar 25
3
Converting a Matrix to a Vector
Say I have: > set.seed( 1 ) > m <- matrix( runif(5^2), nrow=5, dimnames = list( c("A","B","C","D","E"), > c("O","P","Q","R","S") ) ) > m O P Q R S A 0.2655087 0.89838968 0.2059746 0.4976992 0.9347052 B 0.3721239 0.94467527 0.1765568
2010 Nov 07
2
remove data frame from list of data frames
I have a list of data frames like this: a<- data.frame(x=runif(10), y = runif(10), Acc = 1) b<- data.frame(x=runif(10), y = runif(10), Acc = 0) ls<- list(a,b) and I want to remove the data frames from ls that have Acc values other than 1. How do I do that? Thanks for any help! Matthew
2007 Mar 03
1
function doesnt return/create object
hello, i have written a function to extract certain lines from a matrix. the result is a matrix with 6 cols, named dynamically according to the functions arguments. the problem is now, that i'm not able to return the resultmatrix for further use. the object is not being created. example from my console: getans(27,27) [...] [189,] 3969 161 27 1 0 1 [190,] 2142 87 27
2004 Nov 29
2
[BASIC] Solution of creating a sequence of object names
Dear R-users, I state that this is for beginners, so you may ignore this in order not to be irritated. By the way, "patience" is another important thing, together with "kindness", we should keep in mind when we teach students and our own children as Jim Lemon pointed out well in the context of the Socratic method. You may know that being kind does not mean giving
2009 Dec 29
1
extract value from first column based on value in second column
Hi all, I have two columns of data, the first consists of parameter estimates and the second probability estimates. I would like to extract the value from the first column based on the max value of column two, but not sure how to do this other than by extracting the value and then manually finding the value in the first column. Anyone know how to do this? Basically, I need to find the row
2009 Sep 27
2
Count number of zeros in a collumn
I have a matrix 700x2000 which is sampled in each cycle from another matrix 788x2000 with the numbers 0,1 and 9 There is one specific collumn of this matrix, dart[,1977], that usually, after the samplimg procedure has only 1 and 9 (because the zero frequency in this collumn is low). However, when this happens, I want to include an IF conditional in my code. so basically what i wanted to do was to
2009 Sep 22
2
chage the output file name
After I run my script I save all my output e.g. write.table(d, file = "C:/PINEheight.txt) write.table(v, file = "C:/PINEvolume.txt) write.table(v, file = "C:/PINEdiameter.txt) write.table(v, file = "C:/PINEdensity.txt) and then I would like to run again with another tree and save again e.g write.table(d, file = "C:/POPULUSheight.txt) Is there anyhow I can define a
2010 May 28
3
how to create automatically names for vectors in a loop?
Hi, I want to generate a number of vectors and store them with different names, like this: x=1 while (x<100) { vector#x# = rnorm(100) x=x+1 } where each vector has, at its hand, instead of #x# a number which goes from 1 to 99. How can I do this? Thanks Gabriele Zoppoli, MD Ph.D. Fellow, Experimental and Clinical Oncology and Hematology, University of Genova, Genova, Italy Guest
2009 Oct 28
1
Is there a faster way to do it?
#Mdarts is a matrix 2343x788 #frequencia is a vector 2343x1 # 9 in Mdarts[fri,frj] stands for my missing values which i want to replace by the value in the vector frequencia Mdarts<-t(matrix(scan("C:/GWS/CNB/dartg.txt"),ncol=nindT,nrow=nm, byrow=T)) frequencia <- matrix(scan("C:/GWS/CNB/freq.txt"),ncol=1) for (fri in 1:nindT){ for (frj in 1:nm){ Mdarts[fri,frj] <- if
2010 Mar 26
2
Is there a faster way to do this?
Hi guys, I am still learning R, and not well familiar with all the apply functions. I am trying to find faster alternatives to replace the for cycle. Is there a faster way to do the example below? nm <- 1000 b <- matrix (rnorm (5000, 0, 1), nrow = 500, ncol = nm) a <- matrix (0, nm, nm) for (i in 1 : nm) { for (j in 1 : nm) { if ( j == i) { next } a[i, j] <- t (b [, i]) %*% b[, j] } }
2009 Sep 18
1
Incorrect Dimension
I am new in R and i am having trouble here. I?ve already searched in the list but hasn?t helped When i run this script above i get the message "Error in gen[j, i] : incorrect number of dimensions". However gen is 1000x200 (ind x loc) and so is g could anybody help me for (i in 1 : loc) { #loc=200 for (j in 1 : ind) { #ind=1000 g1 <= function ( gen ) matrix ( if (gen[j, i]
2010 Jul 19
2
replacing elements of distance matrix
Hi! I am trying to implement non-bipartite matching. I have around 500 sites which can be clustered by 10 regions. I am able to calculate pairwise Mahalanobis distances between sites (thanks to another post in the forum). However, I want to constrain my match to sites within the same region. Thus I want to replace elements of the distance matrix with a high value, say 999999, for sites not of the
2016 Nov 02
5
Problems with GPO
I'm having problems with GPO in Samba 4.2.1 I created a GPO to Block Control Panel and applied in my Domain OU. In desktop client I typed "gpupdate /force" and appear a success message that to ask reboot my system. After rebuot the GPO don't work. Other GPOs as WSUS update, Wallpaper and others, don't work too. Following is the result of command: GPRESULT /H
2015 Sep 04
2
Deny Access Message with GPO
My user is member of the 'Group Policy Creator Owners' group, but when I try to create a GPO, the following message appear: Denied Access. I am using* Group Policy Management Console* What is the problem? Regards, Márcio Bacci
2015 Jul 20
3
Doubt about Unix Attributes
I can configure UidNumer and gidNumber attributes by Microsoft RSAT tool and the value is stored. When I click again on the tab "Unix Attributes" appears a message saying "Not is possible the execution". I click OK button and the attribute is correct. Why appear this message? How can I verify if the NIS service is working correctly? Regards, Márcio
2016 Nov 03
2
Problems with GPO
On Thu, 3 Nov 2016 10:25:00 -0400 lingpanda101 via samba <samba at lists.samba.org> wrote: > On 11/3/2016 9:59 AM, Marcio Demetrio Bacci wrote: > > Thanks Lingpanda101 > > > > Following the result of command: > > > > # file: Policies/{0F1E5B10-3640-4FFE-AA6B-5DE4CFF73625} > > # owner: 10060 > > # group: 30028 > > user::rwx > >
2015 Jul 22
2
Secondary DC
I want to create another DC in my network. Today, my DC is Debian 7 with Samba 4.2.1 compiled (source package). Are ther problem if I install another DC with Debian 8 and Samba 4.1.17 (apt-get -t backports)? I will follow the tutorial below: https://wiki.samba.org/index.php/Join_a_domain_as_a_DC Regards, Márcio
2016 Nov 06
2
Differences between the Primary and Secondary DC
I have two DC (DC1 and DC2) Samba 4.2.1. In DC1 has 2 pastes in sysvol\ empresa.com.br: Policies and Scripts. But in DC2, the Policies paste there isn't. Is this normal? When I have executed gpresult /r command in Windows client, I verified that DC2 is used to apply GPO for the workstations too. Regards, Márcio