[R] Simulation of strongly balanced panel data

2015-07-14 Thread deva d
Dear all, I have a strongly balanced panel dataset of 46 entities x11 years. Observed vars are not normally distributed How should I simulate the ov ? I do not know the distribution Can somebody pl help -- ** *Deva* [[alternative HTML version deleted]]

Re: [R] A Simple Question

2015-07-14 Thread Erich Subscriptions
Is m[[1]] what you need? On 14 Jul 2015, at 07:40, Alex Kim dumboisveryd...@gmail.com wrote: Hello, I am trying to create a matrix that looks like this, using the stri_locate_all function. x - ABCDJAKSLABCDAKJSABCD m - stri_locate_all_regex(x, 'ABCD') m [[1]] start end

Re: [R] remove 0 and NA values

2015-07-14 Thread Daniel Nordlund
On 7/13/2015 6:02 PM, Lida Zeighami wrote: Hi Dan, Thanks for reply, Sorry the format of matrix is ruiend! Yes, this matrix is 6×6 but my orginal matrix is so biger than this!! No, I don't think so your code do that for me! I want to remove the columns which the sum of their values are equal

[R] A simple question

2015-07-14 Thread Alex Kim via R-help
Hello, I am trying to create a matrix that looks like this, using the stri_locate_all function. x - ABCDJAKSLABCDAKJSABCD m - stri_locate_all_regex(x, 'ABCD') m [[1]] start end [1,] 1 4 [2,]10 13 [3,]18 21 I tried converting m into a

[R] A Simple Question

2015-07-14 Thread Alex Kim
Hello, I am trying to create a matrix that looks like this, using the stri_locate_all function. x - ABCDJAKSLABCDAKJSABCD m - stri_locate_all_regex(x, 'ABCD') m [[1]] start end [1,] 1 4 [2,]10 13 [3,]18 21 I tried converting m into a

Re: [R] : Ramanujan and the accuracy of floating point computations - using Rmpfr in R

2015-07-14 Thread Martin Maechler
P == ProfJCNash profjcn...@gmail.com on Sat, 4 Jul 2015 21:42:27 -0400 writes: P n163 - mpfr(163, 500) P is how I set up the number. Yes, and you have needed to specify the desired precision. As author and maintainer of Rmpfr, let me give my summary of this overly long thread

Re: [R-es] Conservar el nombre de la variable entre varias funciones

2015-07-14 Thread Griera-yandex
Hola: Gracias por interesar-te per el problema! Explico las líneas generales de lo que quiero hacer. La mayor parte de mi trabajo es analizar datos de estudios ajenos. Hasta ahora lo hacia con SAS y tengo una macro que le paso el nombre del fichero y las variables y la macro realiza, según

Re: [R] overlap between line segments

2015-07-14 Thread Jim Lemon
Hi Karla, This might help. I haven't tested it exhaustively. transect_overlap-function(x) { if(!is.matrix(x)) stop(x must be a 2x2 matrix) if(x[1,1] = x[2,1]) { if(x[2,2] x[1,2]) overlap-x[1,2]-x[2,1] else overlap-x[2,2]-x[2,1] } else { if(x[1,2] x[2,2]) overlap-x[2,2]-x[1,1] else

Re: [R] Function returning multiple objects but printing only one

2015-07-14 Thread Duncan Murdoch
On 13/07/2015 5:06 PM, Daniel Caro wrote: Hello, Sorry if this has already been addressed before but I could not find any helpful references. I would like to create a function that outputs a single element of a list but stores all elements, similar to 'lm' and many other functions. There

Re: [R] A simple question

2015-07-14 Thread Adams, Jean
R-help readers, For your information ... The package stringi is required to run Alex's code. Alex's message was cross posted to StackOverflow, and seems to have been answered there, http://stackoverflow.com/questions/31398466/r-stri-locate-all-creating-a-start-and-end-matrix Jean On Tue, Jul

Re: [R] Function returning multiple objects but printing only one

2015-07-14 Thread Adams, Jean
Daniel, I'm not sure if this is what you're after, but you could include a print() call in your function. For example: myfun - function(x) { m1 - min(x) m2 - mean(x) m3 - max(x) out - list(m1, m2, m3) print(out[[2]]) return(out) } result - myfun(1:10) ​Jean ​ On Mon, Jul 13, 2015

[R] Problem accessing xslx on CRAN mirrir

2015-07-14 Thread Knox, Tom
I am very new to the use of R and trying to install it in order to use a package called mh1823 for determining Probability of Detection stats for Non-Destructive Evaluation. I have hit an immediate problem installing the xlsx package and get the following messages: Warning: unable to access

Re: [R] overlap between line segments

2015-07-14 Thread Karla Shikev
Fantastic. Thanks! On Tue, Jul 14, 2015 at 7:03 AM, Jim Lemon drjimle...@gmail.com wrote: Hi Karla, This might help. I haven't tested it exhaustively. transect_overlap-function(x) { if(!is.matrix(x)) stop(x must be a 2x2 matrix) if(x[1,1] = x[2,1]) { if(x[2,2] x[1,2])

Re: [R] Problem accessing xslx on CRAN mirrir

2015-07-14 Thread Duncan Murdoch
On 14/07/2015 6:09 AM, Knox, Tom wrote: I am very new to the use of R and trying to install it in order to use a package called mh1823 for determining Probability of Detection stats for Non-Destructive Evaluation. I have hit an immediate problem installing the xlsx package and get the

[R] Plot in Rcmdr

2015-07-14 Thread INGRAM Joanne
Hello, I wondered if anyone could help me with a small issue in Rcmdr. I have used the 'Graphs' function in the drop-down menu to create a scatterplot for groups (gender). But when I do this the legend (telling me the symbols which represent male etc.) keeps obscuring the title of the plot.

[R] advice on making HTML tables

2015-07-14 Thread Bos, Roger
This might be a little off topic, but I am starting to produce some HTML reports that contain mostly tables and they look great in Chrome but really bad in IE, so I wanted to see if anyone knows of a better way or an easy fix. One option I have used is to convert to PDF, but sometimes it is

Re: [R-es] Crear datos aleatorios con restriciones

2015-07-14 Thread Ignacio Martinez
Genial Carlos! Tu codigo produce lo que quiero! Estoy tratando de entender cada paso y hacer algunos cambios. Mi problema es con como usar `str_plit_fixed`. Con tu codigo tengo eso: separoPairs - as.data.frame(str_split_fixed(AllpairsTmp, , 6)) head(separoPairs) V1 V2 V3 V4 V5 V6 1 e1 g1

[R] open connection to system

2015-07-14 Thread Adrian Dușa
Dear list, Probably not the best subject line, but hopefully I can explain. I would like to use R and open a connection to a (system) command line base chess engine (for example, there is an open source one at stockfishchess.org) In the Terminal window (using MacOS), I can type two commands: $

Re: [R] advice on making HTML tables

2015-07-14 Thread Bos, Roger
Answering my own question, I was able to make the tables look better in IE using some simple CSS: td { padding: 6px; } -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Bos, Roger Sent: Tuesday, July 14, 2015 11:36 AM To: r-help@r-project.org

Re: [R] Plot in Rcmdr

2015-07-14 Thread David L Carlson
It can be changed by slightly modifying the scatterplot() command in the R Script window and re-submitting it. From the top menu select Data | Data in packages | Read data set from an attached package. Then type Pottery in the space next to Enter name of data set (notice that Pottery is

[R] Spline curve

2015-07-14 Thread DzR
I wish to fit spline curves to longitudinal data Which package should I use and how should data be structured to facilitate the analysis - Deva __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see

Re: [R-es] Crear datos aleatorios con restriciones

2015-07-14 Thread Ignacio Martinez
Este codigo resuelve mi problema. Estoy usando `str_split` y como separador '- '. Tambien tengo que usar 'trimws'. Supongo que se podria limpiar el codigo para hacerlo mas eficiente, pero todavia no se me ocurrio como. *Muchas gracias Carlos!* library(dplyr) library(randomNames)

[R-es] Manejo de valores perdidos usando predict con CHAID

2015-07-14 Thread Oscar Benitez
Hola Estoy tratando de aplicar probabilidades mediante predict a una base de prueba y no consigo manejar los valores perdidos. No tengo problemas en la generación de las probabilidades, el comando es: #genera las probabilidades en prueba prob.P.T1 - predict(chaid2.T1, pruebaT1, type=prob) El

Re: [R] Altering Forest plot in Metafor package

2015-07-14 Thread Viechtbauer Wolfgang (STAT)
Use the 'alim' argument (or the 'at' argument) to restrict the axis limits, so that CI bounds below/above are indicated with an arrow. And play around with the 'xlim' argument to make better use of the space in the plotting region. And the 'ilab' argument allows you to add columns with

Re: [R-es] Conservar el nombre de la variable entre varias funciones: ejemplos de resultados

2015-07-14 Thread Carlos Ortega
Hola, Gracias por el código. Lo he ejecutado y he visto los resultados. Salvo la parte de los test como te dije, todo lo demás creo que se puede hacer más automático. Probaré a hacer alguna prueba de lo que te comento utilizando el conjunto de MASS. Sobre la duda de los nombres, si le pasas el

[R-es] una inquietud de forma

2015-07-14 Thread heber sarmiento via R-help-es
Cordial saludo. Aunque he buscado no he logrado establecer como se hace para lograr salidas en R con el formato de esta página,  http://www.um.es/ae/FEIR/10/#stat.desc-del-paquete-pastecs agradezco si alguien me puede orientar, agradezco su amabilidad. Heber [[alternative HTML version

Re: [R-es] Conservar el nombre de la variable entre varias funciones: ejemplos de resultados

2015-07-14 Thread Griera
Hola Carlos: Te adjunto un ejemplo de aplicación: las funciones (he borrado los path de las funciones y las ordenes source() que las carga ) y un ejemplo para ejecutarlas para las opciones que tengo implementadas con la tabla de datos birthwt del paqueteMASS: - Descriptiva de todas las

Re: [R] sum some columns for each row

2015-07-14 Thread Jeff Newmiller
Well it is pretty obvious that all of your columns have non-numeric data in them, but you are the only one who can tell which ones should have been numeric, and you are also the one who can peruse your data file in a text editor.

[R] Parsing large amounts of csv data with limited RAM

2015-07-14 Thread Dupuis, Robert
I'm relatively new to using R, and I am trying to find a decent solution for my current dilemma. Right now, I am currently trying to parse second data from a 7 months of CSV data. This is over 10GB of data, and I've run into some memory issues loading them all into a single dataset to be

Re: [R] Troubleshooting DCchoice for dichotomous choice CV data

2015-07-14 Thread David Winsemius
On Jul 14, 2015, at 6:02 PM, Rogério Araújo wrote: I'm trying to run dichotomous choice CV data using DCchoice package. But I didn't succeed. I keep receiving those messages for 'sbchoice' and 'dbchoice' functions: Warning in install.packages : package ‘DCchoice’ is not available (for R

Re: [R] sum some columns for each row

2015-07-14 Thread David Winsemius
On Jul 14, 2015, at 4:49 PM, Dawn wrote: I attached the file Well, you may have attached it, but you evidently did not read the posting guide about which filetypes are accepted by the mailserver. including the first two rows and please help to make it the numeric data frame. Hopefully

Re: [R] sum some columns for each row

2015-07-14 Thread Dawn
Hi, I used a small set of data (several columns and rows) and it works fine using the following command: abc - rowSums(test[,grep(ABC,names(test),fixed=T)],na.rm=T) But when I used the real big data table, Error in rowSums(dat[, grep(ABC, names(dat), fixed = T)], na.rm = T) : 'x' must be

[R] Troubleshooting DCchoice for dichotomous choice CV data

2015-07-14 Thread Rogério Araújo
I'm trying to run dichotomous choice CV data using DCchoice package. But I didn't succeed. I keep receiving those messages for 'sbchoice' and 'dbchoice' functions: Warning in install.packages : package ‘DCchoice’ is not available (for R version 3.2.1) Error: could not find function sbchoice

Re: [R] Parsing large amounts of csv data with limited RAM

2015-07-14 Thread jim holtman
take a look at the sqldf package because it has the ability to load a csv file to a database from which you can then process the data in pieces Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Tue, Jul 14,

Re: [R] sum some columns for each row

2015-07-14 Thread Jeff Newmiller
I suspect your data frame dat has non-numeric data in some of the columns that have ABC in their names. Any column of a data frame can be numeric or not, but the data frame as a unit cannot be numeric. If your data file has odd characters in done of the otherwise-numeric columns, the whole

Re: [R] sum some columns for each row

2015-07-14 Thread Bert Gunter
It seems that Dawn could really benefit from spending some time with an online R tutorial or two, as she appears not to have much of a clue about R's basic data structures. Cheers, Bert Bert Gunter Data is not information. Information is not knowledge. And knowledge is certainly not wisdom.

Re: [R] sum some columns for each row

2015-07-14 Thread Dawn
I used two rows to test the data frame, as follows. dat - read.table(TOV_43_Protein_Clusters_abundance1.tab, header=TRUE,sep = \t) dat1 - dat[1:2,] str(dat1) 'data.frame':2 obs. of 44 variables: $ X : Factor w/ 1075762 levels ,POV_Cluster_101,..: 305266 625028 $ X109DCM: Factor

[R-es] Subiendo a CRAN un paquete que incluye ejemplos con paralelización

2015-07-14 Thread Antonio José Saez Castillo
Hola: Estoy mejorando un paquete que incluía varios procedimientos bootstrap mediante paralelización (con foreach, en Windows). El problema es que al hacer el R CMD check (uso RStudio) me da error, ya que CRAN no permite paralelización con más de dos núcleos (If running a package uses multiple

Re: [R] sum some columns for each row

2015-07-14 Thread Dawn
I attached the file including the first two rows and please help to make it the numeric data frame. Hopefully the following command works: dcm - rowSums(dat1[,grep(DCM,names(dat1),fixed=T)],na.rm=T) Thank you very much! Dawn On Tue, Jul 14, 2015 at 4:36 PM, Jeff Newmiller

Re: [R] Parsing large amounts of csv data with limited RAM

2015-07-14 Thread Jeff Newmiller
You seem to want your cake and eat it too. Not unexpected, but you may have your work cut out to learn about the price of having it all. Plotting: pretty silly to stick with gigabytes of data in your plots. Some kind of aggregation seems required here, with the raw data being a stepping stone

[R] Altering Forest plot in Metafor package

2015-07-14 Thread Fosulli
Dear All, I'm having trouble tweaking a forest plot made using the R meta-analysis package metafor. My main problem is that I have two studies which have very large Confidence intervals and as such my forest plot is very wide, and not neat. As I would like to add more descriptive columns into

Re: [R] Plot in Rcmdr

2015-07-14 Thread John Fox
Dear David and Joanne, David, thank you for answering Joanne's question before I saw it. The help page for car::scatterplot() is also accessible via the Help button in the Rcmdr scatterplot dialog. I'll think about whether to add a control for legend position to the scatterplot dialog. There

Re: [R] open connection to system

2015-07-14 Thread John McKown
On Tue, Jul 14, 2015 at 11:45 AM, Adrian Dușa dusa.adr...@unibuc.ro wrote: Dear list, Probably not the best subject line, but hopefully I can explain. I would like to use R and open a connection to a (system) command line base chess engine (for example, there is an open source one at

Re: [R] Spline curve

2015-07-14 Thread Bert Gunter
Yikes! That almost requires a book. Why don't you start by doing some of your own homework instead. Search on: fit spline curves to longitudinal data in R and then go through the tutorials/presentations that pop up. There will also be books that you will find, I'm sure if you're serious about