similar to: Loop or some other way to parse by data generated values when it is not linear

Displaying 20 results from an estimated 20000 matches similar to: "Loop or some other way to parse by data generated values when it is not linear"

2017 Jun 22
0
Question
Rows are horizontal, columns are vertical. You really need to spend some time with an R tutorial. dta <- read.table( "yourfile", header=TRUE, as.is=TRUE ) dta2 <- dta dta2$D <- c( "awe", "abcd", "asdf", "xyz" ) dta2 <- dta2[ , c( "A", "D" ) ] -- Sent from my phone. Please excuse my brevity. On June 22, 2017
2018 Jan 15
0
barplot that displays sums of values of 2 y colums grouped by different variables
It is not generally advisable to get too fancy with stat functions in ggplot... things can easily get more complicated than ggplot is ready to handle when it comes to calculations. It is better to create data that corresponds directly to the graphical representations you are mapping them to. Read [1] for more on this philosophy. [1] H. Wickham, Tidy Data, Journal of Statistical Software,
2012 Feb 28
1
Packages/functions for competing risk analysis
Hi Rs, I am analyzing a time to event dataset with several competing risks. 0 = Active by end of study 1 = Stopped treatment to start another treatment 2 = Lost 3 = Dead My event of interest in Lost to Followup but starting a different treatment and dying are competing risks. All 1,2,3 events are events of exiting the study, but it's only 2-LTFU that we are concerned with (I know I am
2018 Mar 06
4
Capturing warning within user-defined function
Hi, I am trying to automate the creation of tables for some simply analyses. There are lots and lots of tables, thus the creation of a user-defined function to make and output them to excel. My problem is that some of the analyses have convergence issues, which I want captured and included in the output so the folks looking at them know how to view those estimates. I am successfully able to do
2017 Jun 22
4
Question
Hi, I am using Spark and the Sparklyr library in R. I have a file with several lines. For example A B C awer.ttp.net Code 554 abcd.ttp.net Code 747 asdf.ttp.net Part 554 xyz.ttp.net Part 747 I want to split just column A of the table and I want a new row added to the table D, with values awe, abcd, asdf, and xyz. I am trying to use a command in
2017 Oct 26
0
Help needed with aggregate or other solution
On Thu, 26 Oct 2017, Thomas Adams wrote: > Hi Jeff, > > Thank you for the suggestions -- I appreciate your help. Unfortunately, the > result2 has two problems... > > (1) there are now 3 date columns (it looks like 2 cols are merged into 1 > col) No, there are two date columns. Result2 includes the grouping value as a row name (pulled from the names of the dta2list items
2018 Mar 06
0
Capturing warning within user-defined function
1. I did not attempt to sort through your voluminous code. But I suspect you are trying to reinvent wheels. 2. I don't understand this: "I've failed to find a solution after much searching of various R related forums." A web search on "error handling in R" **immediately** brought up ?tryCatch, which I think is what you want. If not, you should probably explain why it
2018 Mar 06
0
Capturing warning within user-defined function
You can capture warnings by using withCallingHandlers. Here is an example, its help file has more information. dataList <- list( A = data.frame(y=c(TRUE,TRUE,TRUE,FALSE,FALSE), x=1:5), B = data.frame(y=c(TRUE,TRUE,FALSE,TRUE,FALSE), x=1:5), C = data.frame(y=c(FALSE,FALSE,TRUE,TRUE,TRUE), x=1:5)) withWarnings <- function(expr) { .warnings <- NULL # warning handler will
2018 Mar 06
1
Capturing warning within user-defined function
tryCatch() is good for catching errors but not so good for warnings, as it does not let you resume evaluating the expression that emitted the warning. withCallingHandlers(), with its companion invokeRestart(), lets you collect the warnings while letting the evaluation run to completion. Bill Dunlap TIBCO Software wdunlap tibco.com On Tue, Mar 6, 2018 at 2:45 PM, Bert Gunter <bgunter.4567 at
2007 Jul 30
1
correlation and matrix
Dear everyone, I am new in R and I've got difficulties in realizing the following tasks: -I have variables (factors) with different numbers of levels, either 1, 2 or 3. -I have a matrix containing these 204 factors and I have to correlate them by groups of 4 variables. -I have to delete the factors just having one level ( because when correlating one-level factors, the output is NA) here
2007 Oct 10
1
Deleting for() loop in function
Dear UseRs, I wrote following function in order to solve Data Envelopment Analysis. Reason for posting is that the function is slow when nrow(dat) is large. I wonder if other functions could substitute the for() loop in the code, such as mapply(). Can anybody help to rewrite the dea() function as efficiently as possible? The code is as follows:
2007 May 21
1
can I get same results using lme and gls?
Hi All I was wondering how to get the same results with gls and lme. In my lme, the design matrix for the random effects is (should be) a identity matrix and therefore G should add up with R to produce the R matrix that gls would report (V=ZGZ'+R). Added complexity is that I have 3 levels, so I have R, G and say H (V=WHW'+ZGZ'+R). The lme is giving me the correct results, I am
2017 Oct 26
3
Help needed with aggregate or other solution
Hi Jeff, Thank you for the suggestions -- I appreciate your help. Unfortunately, the result2 has two problems... (1) there are now 3 date columns (it looks like 2 cols are merged into 1 col) (2) the output rows should not have any of the basistime dates repeated (maybe I misstated the problem); I need the max fcst value by basistime, but also list the date value for that row; for example:
2013 Feb 13
3
Correlation with p value
Dear all, I have a data (bellow) and I want to make a correlation test with p-value structure(list(Name = structure(c(3L, 3L, 3L, 3L, 3L, 3L, 3L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L), .Label = c("CTJ", "PKR", "TTK"), class = "factor"), score = c(86.4371428571428, 89.7028571428572, 87.728, 89.99, 89.42, 85.6914285714286, 82.256,
2018 May 30
2
Filtering using multiple rows in dplyr
Hi Folks, I have just started using dplyr and could use some help getting unstuck. It could well be that dplyr is not the package to be using, but let me just pose the question and seek your advice. Here is my basic data frame. head(h) subject ageGrp ear hearingGrp sex freq L2 Ldp Phidp NF SNR 1 HALAF032 A L A F 2 0 -23.54459 55.56005 -43.08282
2018 Jan 15
5
barplot that displays sums of values of 2 y colums grouped by different variables
I am trying to create a barplot displaying the sums of 2 columns of data grouped by a variable. the data is set up like this: "city" "n" "y" <br> mon 100 200 <br> tor 209 300 <br> edm 98 87 <br> mon 20 76 <br> tor 50 96 <br> edm 62 27 <br> the resulting plot should have city as the x-axis, 2 bars per city, 1 representing
2017 Oct 26
0
Help needed with aggregate or other solution
Thanks for the dput... #### reproducible example of split-apply-combine ### dta <- structure(list(date = structure(c(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 20L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L, 23L, 24L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 15L, 16L), .Label = c("2012-01-25 18:00:00",
2009 Oct 17
2
Recommendation on a probability textbook (conditional probability)
I need to refresh my memory on Probability Theory, especially on conditional probability. In particular, I want to solve the following two problems. Can somebody point me some good books on Probability Theory? Thank you! 1. Z=X+Y, where X and Y are independent random variables and their distributions are known. Now, I want to compute E(X | Z = z). 2.Suppose that I have $I \times J$ random number
2012 Apr 22
1
Transform dataframe
Ein eingebundener Text mit undefiniertem Zeichensatz wurde abgetrennt. Name: nicht verf?gbar URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20120422/bb638d28/attachment.pl>
2011 Nov 08
2
compare linear regressions
Hi, I'm trying to compare two linear regressions. I'm using the following approach: ################## xx<-1:100 df1 <- data.frame(x = xx, y = xx * 2 + 30 + rnorm(n=length(xx),sd=10), g = 1) df2 <- data.frame(x = xx, y = xx * 4 + 9 + rnorm(n=length(xx),sd=10), g = 2) dta <- rbind(df1, df2) dta$g <- factor(dta$g)