similar to: an error about " return some vectors from some functions within a function"

Displaying 20 results from an estimated 100 matches similar to: "an error about " return some vectors from some functions within a function""

2013 Apr 23
1
assigning cluster id in cluster package-reg.
Well, you don't give much of an example.... I'm replying CC to the R mailing list. Please ask questions there, rather than adressing individuals for basic help. Here is one; does it answer your question ? data(agriculture) ag.ag <- agnes(agriculture) class(ag.ag) pltree(ag.ag) # the dendrogram, if you want to see it ## cut the dendrogram -> get cluster assignments: (ck3 <-
2008 Jul 14
3
Loop problem
Dear all, I want to write ck<-cbind(rep(pk[1,1],4),rep(pk[1,2],4),rep(pk[1,3],4)) state ment in a loop . How can I write it ? > pk [,1] [,2] [,3] [1,] -1.1354816 0.9808877 -0.9446314 [2,] 0.7787378 0.4536944 0.3204882 [3,] -1.7274907 1.5112011 1.4481839 [4,] 1.0629145 0.5976109 -0.5277638 > pk<-matrix(rnorm(12),nrow=4,ncol=3) > pk
2006 Dec 11
2
Switch and integer
I searched the help list and the manual, but I do not find my mistake. Switch is working with character , with integer, but not in the third example Regards Knut count1 <- 0 test
2012 Jul 11
3
Subset based on multiple values
I'm stuck on a seemingly simple problem. I'm trying to subset the data by several numbers and it cuts out half of the rows. Here is the sample code: test <- as.matrix(c(1,1,1,1,3,3,7,7,7,7)) Count <- tapply(test[,1], test[,1], length) # count for each value spp <- unique(test[,1]) Count1 <- as.data.frame(cbind(Count,spp)) Max <- max(Count) Count1$sppMax <-
2017 Aug 28
5
"Improvement with the R code"
Hello, I am trying to implement a formula aij= transition from state S_i to S_j/no of transition at state S_i Code I have written is working with three state {1,2,3 }, but if the number of states become={1,2,3,4,......n} then the code will not work, so can some help me with this. For and some rows of my data frame look like
2009 Feb 11
2
Loop on characters
Hi, suppose I have three vectors like : l1 = 1:4 l2 = 4:9 l3 = 16:67 now I want to construct a loop like : for (i in 1:3) { count1[i] = length(li) # i.e. it will take l1, l2, l3 according to value of i } Can anyone please tell me how to do that? Regards, -- View this message in context: http://www.nabble.com/Loop-on-characters-tp21949173p21949173.html Sent from the R help
2011 Feb 09
2
Generate multivariate normal data with a random correlation matrix
Hi All. I'd like to generate a sample of n observations from a k dimensional multivariate normal distribution with a random correlation matrix. My solution: The lower (or upper) triangle of the correlation matrix has n.tri=(d/2)(d+1)-d entries. Take a uniform sample of n.tri possible correlations (runi(n.tr,-.99,.99) Populate a triangle of the matrix with the sampled correlations Mirror the
2017 Aug 28
0
"Improvement with the R code"
Hi, I think you overthought this one a little bit, I don't know if this is the kind of code you are expecting but I came up with something like that: generate_transition_matrix <- function(data, n_states) { #To be sure I imagine you should check n_states is right at this point transitions <- matrix(0, n_states, n_states) #we could improve a little bit here because at
2004 Jul 07
1
Histograms, density, and relative frequencies
R-users, I have been using R for about 1 year, and I have run across a couple of graphics problem that I am not quite sure how to address. I have read up on the email threads regarding the differences between density and relative frequencies (count/sum(count) on the R list, and I am hoping that someone could provide me with some advice/comments concerning my approach. I will admit
2001 Mar 16
1
combine dataset
Hi, I have two data sets look like below: ========================== state count1 percent1 CA 19 0.34 TX 22 0.35 FL 11 0.24 OR 34 0.42 GA 52 0.62 MN 12 0.17 NC 19 0.34 state count2 percent2 FL 22 0.35 MN 22 0.35 CA 11 0.24 TX 52 0.62 ========================== How to combine these two data set and make it look like below?
2009 Oct 29
1
operation with if/else on a dataframe
Hi to all, I have this dataframe (I show the first six rows) >head(table) A R Fold.Change P.Value Count1 Count2 1 ENSRNOE00000000002_at 0 1.13 0.60 1 1 2 ENSRNOE00000000009_at 0 -1.04 0.73 3 3 3 ENSRNOE00000000020_at 0 -1.08
2002 Jun 18
3
FINDNEXT problem, w2k and linux smbfs
I have inconsistent directory listing on share mounted on linux from windows 2k. Some time not all files appear in the directory listing. If reading directory listing multiple times (60-200 times) files listed originally would have one or two files missing in one of consecutive lists. The same problem appear as well if you are making backup of Windows files from multiple directories, there are
2013 Feb 17
6
histogram
HI Elisa, You could use ?cut() vec1<-c(33,18,13,47,30,10,6,21,39,25,40,29,14,16,44,1,41,4,15,20,46,32,38,5,31,12,48,27,36,24,34,2,35,11,42,9,8,7,26,22,43,17,19,28,23,3,49,37,50,45) label1<-unlist(lapply(mapply(c,lapply(seq(0,45,5),function(x) x),lapply(seq(5,50,5),function(x) x),SIMPLIFY=FALSE),function(i) paste(i[1],"<x<=",i[2],sep="")))
2009 Jul 09
3
Looking for recommendations for blocking hacking attempts
Hello: I have been looking into projects that will automatically restrict hacking attempts on my servers running CentOS 5. I think the two top contenders are: DenyHosts - http://denyhosts.sourceforge.net Fail2ban - http://www.fail2ban.org >From what I see, DenyHosts only blocks based on failed SSH attempts whereas Fail2ban blocks failed attempts for other access as well. The main benefit
2006 May 21
3
Using ParseDate in for loop
Hi, I''m trying to use ParseDate within a for loop but I get this error: can''t dup NilClass Any suggestions for making this work? Thanks, -Jason
2012 Aug 14
2
igraph: Turn multiple edges into weights
Dear all, I have some network data - about 300 vertices and several thousand edges. I am looking for a way to turn multiple edges into weights of the edges. I looked around and - surprisingly? - haven't found anything. Is there an easy way to do this? Best, Jonas [[alternative HTML version deleted]]
2010 Jun 28
2
Stacked Histogram, multiple lines for dates of news stories?
Dear colleagues, I have extracted the dates of several news stories from a newspaper data base to chart coverage trends of an issue over time. They are in a data frame that looks just like one generated by the reproducible code below. I can already generate a histogram of the dates with various intervals (months, quarters, weeks years) using hist.Date. However, there are two other
2007 Feb 20
1
Reshape (pivot) question
Hi R-users, I have a data set like this (first ten rows): id patient_id date code class eala ID1564262 1562 6.4.2006 12:00 5555 1 NA ID1564262 1562 6.4.2006 12:00 5555 1 NA ID1564264 1365 14.2.2006 14:35 5555 1 50 ID1564265 1342 7.4.2006 14:30 2222 2 50 ID1564266 1648 7.4.200614:30 2222 2 50 ID1564267 1263 10.2.2006 15:45 2222 2 10 ID1564267 1263 10.2.200615:45 3333 3 10 ID1564269 5646
2006 Jul 25
1
can't authenticate after upgrade to 3.0.23a
after upgrading from 3.0.22 to 3.0.23a I can't get at any of my shares, except public. All worked before. here is my smb.conf file. everytime I try to browse or mount any of the other shares it errors out and tells me the shares dont exist, this is with konqueror, winxp, or smb4k. Any suggestions appreciated. [global] log file = /var/log/samba/log.%m restrict anonymous = no ldap ssl = No
2004 Jul 15
8
Directory
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I know there is probably a page in wiki that answers this but I could not find it. I was wondering if there is a way that a user can exit the directory buy pressing a button like * and be returned back to the auto attendant. What I have in my mind is the started getting in the directory but also having it say Press * to return to the main menu and