similar to: merge list entries

Displaying 20 results from an estimated 5000 matches similar to: "merge list entries"

2010 Jan 08
2
how to get perfect fit of lm if response is constant
Hello. Consider the response-variable of data.frame df is constant, so analytically perfect fit of a linear model is expected. Fitting a regression line using lm result in residuals, slope and std.errors not exactly zero, which is acceptable in some way, but errorneous. But if you use summary.lm it shows inacceptable error propagation in the calculation of the t value and the corresponding
2018 May 25
0
how to make the code more efficient using lapply
Hi Stephen, I am not sure that the "for loop" is the source of slowness. You seem to be doing a lot of unnecessary work each time through the loop. e.g. no need to check if it's the last file, just move that section outside of the loop. It will be executed when the loop finishes. As it is you are calling list.files() each time through the loop which could be slow. In any case
2018 May 25
1
how to make the code more efficient using lapply
Eric's approach seems reasonable to me, and I agree that it's probably not the use of a "for" loop that makes the original version slow. As Eric mentioned, there are lots of unnecessary things happening in the loop. For example, list.files() was called twice inside the loop, which is unnecessary, and will definitely slow the loop down (though probably not by much). Call it
2012 Dec 28
2
multiple sheet in r
Dear useRs, i want to open an excel file having 59 sheets in r and GOD knows the number of command i tried. unfortunately none worked, obviously error will be on my part. All the sheets contain 1 kind of data and the data starts from A12:M12 (which contains the header of the data), the line immediately under the header is blank. The number of columns of data in each sheet are same while the
2010 Apr 30
1
read.csv and blank character in object name of my data.frame
Dear group, Here is my data frame: position100415 <- structure(list(DESCRIPTION = structure(1:9, .Label = c(" SUGAR NO.11 Jul/10 ", " SUGAR NO.11 May/10 ", "CORN May/10 ", "COTTON NO.2 Jul/10 ", "CRUDE OIL miNY May/10 ", "ROBUSTA COFFEE (10) Jul/10 ", "SILVER May/10 ", "SOYBEANS Jul/10 ", "WHEAT May/10
2006 May 15
1
Trying to get values to display on horizontal barchart
Hello, R 2.3.0 Windows XP I have spent quite a bit of time trying to resolve my problem below, which included a R site search. The "vertical bars" syntax below produces a vertical bar chart with the values displayed above each bar. I want to cast this graphic horizontally, but I have not been able to arrive at a suitable outcome. The best I have been able to do, using the second block
2006 Apr 14
2
spot the error (I can''t, I''m new)
I have a form that I want to use to update multiple objects. In the controller, @grades = Grade.find(params[:grade].keys) @grades.each_with_index do |grade, i| grade.update_attribute(params[:grade][i]) end all_valid = @grades.inject(true) {|memo, c| c.valid? && memo } this doesn''t update the attributes as I would expect. (I would just use
2011 Mar 05
1
displaying label meeting condition (i.e. significant, i..e p value less than 005) in plot function
Dear R users, Here is my problem: # example data name <- c(paste ("M", 1:1000, sep = "")) xvar <- seq(1, 10000, 10) set.seed(134) p <- rnorm(1000, 0.15,0.05) dataf <- data.frame(name,xvar, p) plot (dataf$xvar,p) abline(h=0.05) # I can know which observation number is less than 0.05 which (dataf$p < 0.05) [1] 12 20 80 269 272 338 366 368 397 403 432 453
2004 Aug 01
3
Creating dummy codes
Is there an efficient way to create a series of dummy codes from a single variable? For example, I have a variable, “grade” = {2, …, 12}. I want to create k-1 dummy codes for grade such that grade 2 is the base (i.e, grade 2 =0). I am hoping that the new variables can be labeled as grade.3, grade.4 etc. I'll then use grade <- paste("grade.", 3:12, sep="") in
2010 May 19
8
Generating all possible models from full model
Is there a function that will allow me to run all model iterations if I specify a full model? I am using information criteria to choose between possible candidate models. I have been writing out all possible model combinations by hand, and I am always worried that I am missing models or have made a mistake somewhere. It is also difficult to alter models if I want to change a term. For example,
2004 Nov 28
1
paste command
In a previous post, I mentioned a loop being used to generate graphs. I have some sample code partially put together but have found one offending line of code that I cannot figure out what to do with. I have one data frame called grade4. If I do something like hist(grade4$math) I get the appropriate chart. Within the loop, however, I am doing this for multiple files and grades, so I use
2003 Jul 09
3
`acting' on variables
Dear list, How can one "from within a function" act on these variables ("outside" a function) that were given as arguments. If I have e.g. this beginning of a function: foo <- function(tiro){ app.tiro <- 3 * tiro [...] } How can I from within the curly brackets e.g. concatenate the app.tiro to the particular variable I passed as the argument `tiro' ? What is
2011 Jan 20
1
syntax for a list of components from a list
I'm attempting to generalise a function that reads individual list components, in this case they are matrices, and converts them into 3 dimensional array. I can input each matrix individually, but want to do it for about 1,000 of them ... This works array2 <- abind(list1[[1]],list1[[2]],list1[[3]],along=3) This doesn't array2 <- abind(list1[[1:3]],along=3) This doesn't either
2005 Aug 24
2
Remove NAs from Barplot
Dear List: I'm creating a series of barplots using Sweave that must assume a standard format. This is student achievement data and the x-axis must include all grades 3 to 8. In some cases, the data for a grade (or more than one grade) are missing in the vector math.bar, but are never missing for the vector apmxpmeet. The following sample code illustrates the issue. Using the code below to
2003 Jul 07
0
One-way talk paths (without INVITE?) and other issues
I'm experiencing one-way voice paths, followed by a hangup on one softphoine and not the other. Also, caller ID has odd outputs -- and I wonder if the problems are related. My configuration has Asterisk and a Linphone softphone running on the same box. I have a PC, and on that PC I use X-Lite or SJPhone to connect to the Linphone instance. When I call from the PC to Linphone: * I call
2010 Feb 28
3
Change the scale on a barplot's y axis
I have grades data. I read them from a csv in letter-grade format. I then converted them to levels levels(grades$grade)=c('A+','A','A-','B+','B','B-','C+','C','C-','D+','D','D-') And then to numbers grades$gp=grades$grade levels(grades$gp)=c(4.3,4.0,3.7, 3.3,3.0,2.7, 2.3,2.0,1.7, 1.3,1.0,0.7)
2010 Apr 15
1
sum rows in a data.frame...solution
Found this solution. It is maybe not the most elegant way, but it does the job. > a=as.data.frame(substr(lme$DESCRIPTION,1,14)) > colnames(a)=c("DESCRIPTION") > lme=as.data.frame(c(a,lme[,2:3])) > lme DESCRIPTION CLOSING.PRICE POSITION 1 PRIMARY NICKEL 25,755.7100 0 2 PRIMARY NICKEL 25,760.8600 0 3 PRM HGH GD ALU 2,415.9000 0
2009 Apr 11
1
Error in R CMD check 2.8.1
Env: R 2.8.1, Win Xp, Eclipse/StatET In a .Rd file, I have an example containing the lines: # calculate Y M, using polynomial contrasts trends <- as.matrix(VocabGrowth) %*% poly(8:11, degree=3) colnames(trends)<- c("Linear", "Quad", "Cubic") [At the risk of a long message, I'll append the complete .Rd file at the end of this message, in case this was
2011 Aug 16
1
Repeated measures cummulative logit mixed model
Dear R help gurus, I have the following problem and I would be delighted if you could help me. >From a large (1500) cohort of patients we have been taking some measurements (ECG measurements, but its not important). The measurements are ordinal in 4 grades (Grade I-IV, grade IV being the most severe form). Every patients has been measured several times (usually once per year). The
2004 Aug 06
1
Comparing rows in a dataframe
Hello I have a longitudinal dataframe organized in the long format and would like to make comparison between successive rows if certain conditions apply. Specifically, I have four variables of interest: grade, score, year, and schid, associated with each school with 3 measurements per school per grade, therefore the rows are temporally ordered and each school occupies multiple rows. For example,