similar to: Create a numeric series in an efficient way

Displaying 20 results from an estimated 2000 matches similar to: "Create a numeric series in an efficient way"

2024 Jun 13
1
Create a numeric series in an efficient way
I apologize, I solved the problem, sorry for that. f. Il giorno gio 13 giu 2024 alle ore 16:42 Francesca PANCOTTO < francesca.pancotto at unimore.it> ha scritto: > Dear Contributors > I am trying to create a numeric series with repeated numbers, not > difficult task, but I do not seem to find an efficient way. > > This is my solution > > blocB <- c(rep(x = 1,
2024 Jun 13
1
Create a numeric series in an efficient way
Maybe this was your solution? blocC <- c(rep(x=c(1:13), times=84)) blocC <- arrange(.data = data.frame(blocC), blocC) The second line sorts, but that may not be needed depending on application. The object class is also different in the sorted solution. Tim -----Original Message----- From: R-help <r-help-bounces at r-project.org> On Behalf Of Francesca PANCOTTO via R-help Sent:
2017 Oct 19
2
Select part of character row name in a data frame
Thanks a lot, so simple so efficient! I will study more the grep command I did not know. Thanks! Francesca Pancotto > Il giorno 19 ott 2017, alle ore 12:12, Enrico Schumann <es at enricoschumann.net> ha scritto: > > df[grep("strat", row.names(df)), ] [[alternative HTML version deleted]]
2017 Oct 19
0
Select part of character row name in a data frame
(Re-)read the discussion of indexing (both `[` and `[[`) and be sure to get clear on the difference between matrices and data frames in the Introduction to R document that comes with R. There are many ways to create numeric vectors, character vectors, and logical vectors that can then be used as indexes, including the straightforward way: df[ c( "Unique to strat ", "Unique
2017 Oct 19
2
Select part of character row name in a data frame
Dear R contributors, I have a problem in selecting in an efficient way, rows of a data frame according to a condition, which is a part of a row name of the table. The data frame is made of 64 rows and 2 columns, but the row names are very long but I need to select them according to a small part of it and perform calculations on the subsets. This is the example: X Y "Unique to
2012 May 25
2
Collecting results of a test with array
Dear contributors I have tried this experiment: x<-c() for (i in 1:12){ x[i]<-list(cbind(x1[i],x2[i])) #this is a list of 12 couples of time series I am using to perform a test } # that compares them 2 by 2 # ################# #trace statistic test<-data.frame() cval<-array( , dim=c(2,3,12)) for (i in 2:12){ for (k in 1:2){ for (j in 1:3){ result[k,j,i]<-
2012 May 18
3
How to fix indeces in a loop
Dear Contributors, I have an easy question for you which is puzzling me instead. I am running loops similar to the following: for (i in c(100,1000,10000)){ print((mean(i))) #var<-var(rnorm(i,0,1)) } This is what I obtain: [1] 100 [1] 1000 [1] 10000 In this case I ask the software to print out the result, but I would like to store it in an object. I have tried a second loop, because if I
2011 Jul 27
3
Reorganize(stack data) a dataframe inducing names
Dear Contributors, thanks for collaboration. I am trying to reorganize data frame, that looks like this: n1.Index Date PX_LAST n2.Index Date.1 PX_LAST.1 n3.Index Date.2 PX_LAST.2 1 NA 04/02/07 1.34 NA 04/02/07 1.36 NA 04/02/07 1.33 2 NA 04/09/07 1.34 NA 04/09/07
2013 Jan 27
2
Loops
Dear Contributors, I am asking help on the way how to solve a problem related to loops for that I always get confused with. I would like to perform the following procedure in a compact way. Consider that p is a matrix composed of 100 rows and three columns. I need to calculate the sum over some rows of each column separately, as follows: fa1<-(colSums(p[1:25,])) fa2<-(colSums(p[26:50,]))
2017 Oct 19
0
Select part of character row name in a data frame
Quoting Francesca PANCOTTO <f.pancotto at unimore.it>: > Dear R contributors, > > I have a problem in selecting in an efficient way, rows of a data > frame according to a condition, > which is a part of a row name of the table. > > The data frame is made of 64 rows and 2 columns, but the row names > are very long but I need to select them according to a small
2011 Nov 12
1
Simulation over data repeatedly for four loops
Dear Contributors, I am trying to perform a simulation over sample data, but I need to reproduce the same simulation over 4 groups of data. My ability with for loop is null, in particular related to dimensions as I always get, no matter what I try, "number of items to replace is not a multiple of replacement length" This is what I intend to do: replicate this operation for four
2024 Sep 16
2
(no subject)
Dear Contributors, I hope someone has found a similar issue. I have this data set, cp1 cp2 role groupid 1 10 13 4 5 2 5 10 3 1 3 7 7 4 6 4 10 4 2 7 5 5 8 3 2 6 8 7 4 4 7 8 8 4 7 8 10 15 3 3 9 15 10 2 2 10 5 5 2 4 11 20 20 2 5 12 9 11 3 6 13 10 13 4 3 14 12 6 4 2 15 7 4 4 1 16 10 0 3 7 17 20 15 3 8 18 10 7 3 4 19 8 13 3 5 20 10 9 2 6 I need to to average of groups, using the values of column
2011 Sep 28
1
Wilcox test and data collection
Dear Contributors I have a problem with the collection of data from the results of a test. I need to perform a comparative test over groups of data , recall the value of the pvalue and create a table. My problem is in the way to replicate the analysis over and over again over subsets of data according to a condition. I have this database, called y: gg t1 t2 d 40 1 1
2011 Nov 11
8
Help
Dear Contributors I would like to perform this operation using a loop, instead of repeating the same operation many times. The numbers from 1 to 4 related to different groups that are in the database and for which I have the same data. x<-c(1,3,7) datiP1 <- datiP[datiP$city ==1,x]; datiP2 <- datiP[datiP$city ==2,x]; datiP3 <- datiP[datiP$city ==3,x] datiP4 <-
2012 Jan 20
3
Istalling Ruby 1.9.2
I just installed 1.9.2 on my 2nd machine, but after I installed I checked the version with ruby -v and it sent me 1.8.7 Here''s the terminal output...anyone know what''s wrong (I have RVM installed): Francescas-MacBook-Air:~ fkrihely$ rvm install 1.9.2 Fetching yaml-0.1.4.tar.gz to /Users/fkrihely/.rvm/archives Extracting yaml-0.1.4.tar.gz to /Users/fkrihely/.rvm/src Configuring
2017 Jun 21
5
Classic upgrade and forced password change...
I'm doing some test moving from a NT domain to ad AD domain, using debian jessie samba (4.2) and obviously the 'classicupgrade' procedure. In my setup i use(d) extensively some script to reset password to users. I was (ab)used to have 'smbpasswd' behave differently if executed by root, eg change the password without taking in consideration password policy and check password
2011 Oct 03
2
Merge two data frames and find common values and non-matching values
Hi, I am trying to find a function to match two data frames of different lengths for one field only. So, for example, df1 is: Name Position location francesca A 75 cristina B 36 And df2 is: location Country 75 UK 56 Austria And I would like to match on "Location" and the output to be something like: Name Position Location Match francesca A 75 1 cristina B 36 0 I have tried with
2004 Sep 20
3
montecarlo simulation
Hy! I would like to know how run a montecarlo simulation with R. Thank you!!!! Francesca Matalucci __________________________________________________________________ Accesso Internet Gratis per utenti Excite! Attivalo subito! http://www.excite.it/hitech/accesso Il Mio Excite. Personalizza la tua Home page Excite come vuoi tu! http://www.excite.it AAA/Relazioni. Sfoglia gli annunci e trova la
2010 Jan 18
2
Rotating pca scores
Dear Folks I need to rotate PCA loadings and scores using R. I have run a pca using princomp and I have rotated PCA results with varimax. Using varimax R gives me back just rotated PC loadings without rotated PC scores. Does anybody know how I can obtain/calculate rotated PC scores with R? Your kindly help is appreciated in advance Francesca [[alternative HTML version deleted]]
2004 Mar 14
2
Shorewall 2.0.0
http://shorewall.net/pub/shorewall/shorewall-2.0.0 ftp://shorewall.net/pub/shorewall/shorewall-2.0.0 -Tom -- Tom Eastep \ Nothing is foolproof to a sufficiently talented fool Shoreline, \ http://shorewall.net Washington USA \ teastep@shorewall.net