Re: [R] setBreakpoint No source refs found

2014-12-18 Thread Duncan Murdoch
On 17/12/2014, 9:35 PM, Andre Mikulec wrote: Hi, when I am trying to deug a package, I am getting the error. library(quantstrat) setBreakpoint(strategy.R#3,envir=environment(strategy)) No source refs found. In R studio, I get a strange message, Breakpoints will be activated when an

Re: [R] Make 2nd col of 2-col df into header row of same df then adjust col1 data display

2014-12-18 Thread Boris Steipe
What you are describing sounds like a very spreadsheet-y thing. - The information is already IN your dataframe, and easy to get out by subsetting. Depending on your usecase, that may actually be the best. - If the number of CaseIDs is large, I would use a hash of lists (if the data is

Re: [R] pairing columns based on a value

2014-12-18 Thread Michael Dewey
Not sure how much help it will be but there is a package on CRAN called icd9. Although clearly the codes are different in ICD 10 it may give you some hints. I suppose you could even email the maintainer to see whether there is an icd10 in the pipeline. On 17/12/2014 20:14, Robert Strother

Re: [R] Maximum likelihood with analytical Hessian and

2014-12-18 Thread Prof J C Nash (U30A)
Of the tools I know (and things change every day!), only package trust uses the Hessian explicitly. It would not be too difficult to include explicit Hessian by modifying Rvmmin which is all in R -- I'm currently doing some cleanup on that, so ask offline if you choose that route. Given that

[R] combinations between two vectors

2014-12-18 Thread Alaios via R-help
Hi all,I am looking for a function that would give me all the combinations between two vectors.Lets take as example the  test-seq(1,3,by=5000) Browse[2] test [1] 1  5001 10001 15001 20001 25001 I want all the combinations between two times the test... I think this is  called permutation

Re: [R] Make 2nd col of 2-col df into header row of same df then adjust col1 data display

2014-12-18 Thread John Kane
Of course, but why? As Brian S says you have not given us enough information to know exactly what you are after. Have a look at https://github.com/hadley/devtools/wiki/Reproducibility or http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example for some information

Re: [R] combinations between two vectors

2014-12-18 Thread Sarah Goslee
I can't quite tell what you want: your example output is either unclear to me or mangled by posting in HTML (please don't). Is expand.grid(test, test) what you want, or partway to what you want? Sarah On Thu, Dec 18, 2014 at 9:56 AM, Alaios via R-help r-help@r-project.org wrote: Hi all,I am

Re: [R] combinations between two vectors

2014-12-18 Thread David L Carlson
Depending on what you want, you probably want to start with expand.grid(): # All combinations of test with test pairs1 - expand.grid(test, test) nrow(pairs1) [1] 36 # Exclude cases that differ only in the order of the values # E.g. (1, 5001), but not (5001, 1), also (1, 1), etc are included

[R] number of fuctions in a R-package

2014-12-18 Thread Diogo André Alagador
I would like to know if it is allowable to build an R-package made of one function only, to launch a GUI to take input data and users to select the models they intend to use, and to start running the processes? Thanks a lot, Diogo Alagador

Re: [R] combinations between two vectors

2014-12-18 Thread Michael Dewey
On 18/12/2014 14:56, Alaios via R-help wrote: Hi all,I am looking for a function that would give me all the combinations between two vectors.Lets take as example the test-seq(1,3,by=5000) Browse[2] test [1] 1 5001 10001 15001 20001 25001 I want all the combinations between two times

Re: [R] Make 2nd col of 2-col df into header row of same df then adjust col1 data display

2014-12-18 Thread Boris Steipe
Make a table that looks like... sounds like a use case that would benefit from some reflection. Anyway, at least don't put your IDs *in* the table. # Your data CaseID - c('1015285', '1005317', '1012281', '1015285', '1015285', '1007183', '1008833', '1015315', '1015322', '1015285')

Re: [R] Make 2nd col of 2-col df into header row of same df then adjust col1 data display

2014-12-18 Thread Jeff Newmiller
No guarantees on best... but one way using base R could be: # Note that CaseID is actually not a valid PViol.Type as you had it PViol.Type - c( BW.BackWages , LD.Liquid_Damages , MW.Minimum_Wage , OT.Overtime , RK.Records_FLSA

Re: [R] number of fuctions in a R-package

2014-12-18 Thread Jeff Newmiller
IANAL and this is not a legal advice forum, but to the best of my knowledge... Yes it is allowable. Read the license. Your responsibilities and limitations have more to do with what to do if you decide to distribute your code. Also, there is no guarantee that CRAN will accept your

Re: [R] combinations between two vectors

2014-12-18 Thread Chel Hee Lee
I like the example provided by David L. Carlson using the function 'expand.grid()' as shown in the previous email. You may try 'outer()' and 'upper.tri()' instead 'expand.grid()'. Please see the below: x - outer(test, test, paste, sep=,) x [,1] [,2] [,3] [,4]

Re: [R] Add encoded special characters (greek characters) as text to plot

2014-12-18 Thread heyi xiao via R-help
anybody has any hint on this? Subject: Add encoded special characters (greek characters) as text to plot To: r-help@r-project.org Date: Wednesday, December 17, 2014, 9:25 PM Dear all, I read my a character matrix from a text file. Some of them

Re: [R] Add encoded special characters (greek characters) as text to plot

2014-12-18 Thread Prof Brian Ripley
On 18/12/2014 16:59, heyi xiao via R-help wrote: anybody has any hint on this? Yes, ?plotmath does. But you will need to know what encoding this is (and hence what Unicode points are meant by \246 and \302). If this really were Greek, common encodings are UTF-8, CP1253 and ISO 8859-7;

Re: [R] Add encoded special characters (greek characters) as text to plot

2014-12-18 Thread Jeff Newmiller
Read the posting guide. The solution is likely to depend on your operating system and graphics devices. --- Jeff NewmillerThe . . Go Live... DCN:jdnew...@dcn.davis.ca.us

[R] Your pardon: An article possibly of interest to statisticians

2014-12-18 Thread John McKown
I do hope this doesn't upset anyone. But it appears rather interesting to me, despite the fact that I'm not a statistician. So I thought that it might be of interest to some others here.

Re: [R] exclude missing co-variable data in cox model

2014-12-18 Thread aoife doherty
Hi all, I have a data set like this: Test.cox file: V1V2 V3Survival Event ann 13 WTHomo 41 ben 20 *51 tom 40 Variant 61

[R] Problems with spatial data for Masterthesis

2014-12-18 Thread Christian Brodbeck
Hi I write my masterthesis and don't know how I can count points in a spatial net. In practical I have a data set for carsharing usage in Berlin. It includes the Idletime of the cars with Long/lat coordinates for the certain places. So if I plot those points I have something like a cloud of

Re: [R] Make 2nd col of 2-col df into header row of same df then adjust col1 data display

2014-12-18 Thread Crombie, Burnette N
I want to achieve a table that looks like a grid of 1's for all cases in a survey. I'm an R beginner and don't have a clue how to do all the things you just suggested. I really appreciate the time you took to explain all of those options, though. -- BNC -Original Message- From:

[R] Fitting Structural Equation Model with sem package and Summary issues

2014-12-18 Thread Guillaume Souchay
Hi all, I am trying to analyse bird data to investigate carry-over effect using structural equation model. I failed to run properly a big model with several latent variables with both L - M block and M - L block. Rather than trying again and again with the huge model, I am now looking to a subset

[R] R - Aggregate 3-Hourly Block Data into Weekly (Melt)

2014-12-18 Thread Shouro Dasgupta
I am trying to compute max, min, and mean from Global Circulation Models (GCM) for the US. The data is in 3-hour blocks for 2026-2045 and 2081-2100. Sample Data: tmp1 - structure(list(FIPS = c(1001L, 1003L, 1005L), X2026.01.01.1 = c(285.5533142, 285.5533142, 286.2481079), X2026.01.01.2 =

Re: [R] Problems with spatial data for Masterthesis

2014-12-18 Thread Jeff Newmiller
Depending how your data are stored, this could be solved with a very basic use of R, such as the ifelse and aggregate functions. Try reading [1] for suggestions on clarifying your problem statement and follow up. [1]

Re: [R] Make 2nd col of 2-col df into header row of same df then adjust col1 data display

2014-12-18 Thread Chel Hee Lee
I like the approach presented by Jeff Newmiller as shown in the previous post (I really like his way). As he suggested, it would be good to start with 'factor' since you have all values of 'Primary.Viol.Type'. You may try to use 'split()' function for creating table that you wish to build.

Re: [R] Add encoded special characters (greek characters) as text to plot

2014-12-18 Thread Chel Hee Lee
Why don't you try this approach if you cannot use 'expression()'? x - c(alpha, beta, gamma, delta) plot(0, type=n) for(i in 1:length(x)) text(x=1, y=i/10, labels=parse(text=x[i])) Please see the output in R. Is this what you are looking for? I hope this helps. I would also appreciate it

Re: [R] Maximum likelihood with analytical Hessian and

2014-12-18 Thread Xavier Robin
Dear John, Thank you for your suggestions. I'll have a look at the trust package - the trust zone may be doing what I need. The tanh transformation could be a good alternative too. Best wishes Xavier On 18. 12. 14 15:10, Prof J C Nash (U30A) wrote: Of the tools I know (and things change every

Re: [R] Make 2nd col of 2-col df into header row of same df then adjust col1 data display

2014-12-18 Thread Jeff Newmiller
Please keep the list in the loop. Take a look at my code again... the factor function can accept a vector of all levels you want it to include. --- Jeff NewmillerThe . . Go Live...

Re: [R] Make 2nd col of 2-col df into header row of same df then adjust col1 data display

2014-12-18 Thread Chel Hee Lee
Please take a look at my code again. The error message says that object 'Primary.Viol.Type' not found. Have you ever created the object 'Primary.Viol.Type'? It will be working if you replace 'Primary.Viol.Type' by 'PViol.Type.Per.Case.Original$Primary.Viol.Type' where 'factor()' is used.

Re: [R] Calculating mean, median, minimum, and maximum

2014-12-18 Thread mtrang
Can you show what the first few rows of your table look like so that we understand the structure? -- View this message in context: http://r.789695.n4.nabble.com/Calculating-mean-median-minimum-and-maximum-tp4700862p4700919.html Sent from the R help mailing list archive at Nabble.com.

[R] How to pass variable column name into R function

2014-12-18 Thread Jeff Johnson
I know this has been explained a few times here in different scenarios, but I am having a hard time digesting this. The following code works fine as long as it's not inside a function (see below). df$season - as.character(df$season) temp - model.matrix( ~ season - 1, data=df) df -

[R] Hash, variable names restriction

2014-12-18 Thread email
Hi: I have one million names of city and their population and want to make a hash so that by giving key = city, the hash function will return its population. I use the hash package in R as follows: h - hash(c(as.vector(df$city)), c(as.vector(df$population))) But getting the following error:

Re: [R] pairing columns based on a value

2014-12-18 Thread Chel Hee Lee
I do not think that you need regular expressions for your problem. Please see the below: d0 - dat_unmatched tmp - apply(d0, 1, function(x){ + first - substr(x,1,1) + idx - which(c(T, Y) == first) + comb - paste(x[idx[1]-1], x[idx], collapse= ) + unlist(strsplit(comb, )) + }) names(tmp) -

Re: [R-es] Problema con el subset

2014-12-18 Thread Igor Sosa Mayor
Jose Manuel Veiga del Baño chem...@um.es writes: Hola a todos, Agradeceros de antemano vuestro tiempo y paciencia ya que soy un poco novato y tal vez esto sea un poco trivial. Lo que quiero hacer es que me represente en eje de las x las fechas (columna fecha) y los valores de z (columna