Re: [R] Difference between comma separated values in column

2014-04-29 Thread arun
Hi, It is better to show the example data using ?dput().  Here, it is not clear whether the columns are character columns or lists. ##If it is the latter case dat1 - data.frame(V1=I(list(1:3, c(1,2,4), c(2,3,4,5))), V2= I(list(c(3,6,5), c(7,10,9), 2:5)))  dat1$V3 - mapply(`c`,mapply(`-`,

Re: [R] lattice plot formatting: pch, abbreviation and labels

2014-04-29 Thread Duncan Mackay
Hi Luigi Only minor changes needed. When you go back to a normal xyplot the rules of ratio variables apply the x-axis default in your case something like pretty(range(x) So the x-axis limits range from 0-1 and the panel limits therefore are 0-1 +/- 4% With strip stripplot being categorical the

Re: [R] lattice plot formatting: pch, abbreviation and labels

2014-04-29 Thread Duncan Mackay
Hi Luigi Only minor changes needed. When you go back to a normal xyplot the rules of ratio variables apply the x-axis default in your case something like pretty(range(x) So the x-axis limits range from 0-1 and the panel limits therefore are 0-1 +/- 4% With strip stripplot being categorical the

Re: [R] Difference between comma separated values in column

2014-04-29 Thread arun
HI, I guess this should be a bit faster. #1st case dat1$V3 - lapply(seq_along(dat1$V2),function(i) c(dat1$V2[[i]][-1] - head(dat1$V1[[i]],-1), tail(dat1$V1[[i]],1))) #2nd case dat2$V3 - unlist(lapply(seq_along(lst1[,2]),function(i) paste(c(lst1[,2][[i]][-1] - head(lst1[,1][[i]], -1),

[R] Course: Data exploration, regression, GLM GAM with R intro. Plymouth, UK

2014-04-29 Thread Highland Statistics Ltd
We would like to announce the following statistics course: Course: Data Exploration, Regression, GLM GAM with introduction to R Where: Plymouth University, Plymouth, UK When: 7 - 11 July 2014 URL: http://www.highstat.com/statscourse.htm Kind regards, Alain Zuur -- Dr. Alain F.

[R] Simulative data production

2014-04-29 Thread Merve Şahin
Hello, My name is Merve from Abant Ä°zzt Baysal University. I want to produce simulative data using R, but I couldn't do. I want to produce n=200, 5 likert type, 20 items and normally distributed data. The normal distribution is provided by total scores of each of 200 person. I produce this kind

[R] Navigating history (arrow keys) and command completion (tab key) do not work

2014-04-29 Thread Josef Montag
Dear R experts: I have updated my R yesterday to version 3.1 and the usual command line navigation in R stopped working. Specifically, tab key moves the cursor and does not compete a command, up-arrow key produces ^[[A, instead of recalling the last command, similarly for other keys. I cannot

[R] Replacing NA's in the data set

2014-04-29 Thread dila radi
Hi all, I have this data set, dput(Ts) structure(list(V1 = c(3, 17, 29, 12, 4.5, 1, 0.5, 0, 0, 0, 1.2, 1.8, 1.5, 0.5, 0, 47.7, 0.3, 0, 2, 0, 5.5, 8, 27.5, 69, 29, 24.5, 57.5, 40, 1, 14.5, 0, 0, 0, 0, 0, 0, 1.5, 2, 0, 0, 0, 0, 7, 29.5, 77, 11.5, 33, 38, 36, 8, 28, 11, 11, 0, 17, 0, 51, 0.5, 5,

[R] sum of two POSIXct objects: date and hour

2014-04-29 Thread Massimo Bressan
I have this dataframe: df-structure(list(date = structure(c(1395874800, 1395874800, 1395874800, 1395874800, 1395874800), class = c(POSIXct, POSIXt), tzone = ), hour = structure(c(-2209121804, -2209121567, -2209121005, -2209118616, -2209116160), class = c(POSIXct, POSIXt), tzone = ),

Re: [R] Replacing NA's in the data set

2014-04-29 Thread arun
Hi Dila, Try: Ts1 - Ts Ts[,-11] - lapply(Ts[,-11], function(x) {x[is.na(x)] - Ts[is.na(x), 11]; x}) #or Ts1[,-11][is.na(Ts1[,-11])] -rep(Ts1[,11],10)[is.na(Ts1[,-11])]  identical(Ts,Ts1) #[1] TRUE A.K. On Tuesday, April 29, 2014 8:53 AM, dila radi dilarad...@gmail.com wrote: Hi all, I have

[R] foreach (package) .combine option

2014-04-29 Thread Luca Cerone
Dear all, I am having some difficulties understanding how the .combine option in the foreach function of the foreach package works. I think I understand the examples in the manual using rbind, cbind and c. However if I write my own function (no particular purpose in mind, just to figure out how

[R] dataframe

2014-04-29 Thread pascalbe...@libero.it
Hello, thank you for accepting me into the list. I have the following dataframe: row.names X Y Z 000_001 000_002 000_003 1sample samplesample sample 2sample2 Au5 Au32

Re: [R] Replacing NA's in the data set

2014-04-29 Thread Massimiliano Tripoli
Hi, Try this: for (i in 1:10) Ts[is.na(Ts[,i]),i] - Ts$V11[is.na(Ts[,i])] Massimiliano - Messaggio originale - Da: dila radi dilarad...@gmail.com A: r-help@r-project.org Inviato: Martedì, 29 aprile 2014 10:46:32 Oggetto: [R] Replacing NA's in the data set Hi all, I have this data set,

[R] Kindly help me

2014-04-29 Thread Ramesh Das
Dear all, I have a problem in installing the the package zelig. I have window 32 bit operating system and R- 3.0.1 version. zelig' package is not compatible with R-3.0.1 version. Please help me how to install the package zelig . If any other package is available in replace of zelig', kindly

[R] Kindly help me

2014-04-29 Thread Ramesh Das
Dear all, I have a problem in installing the the package zelig. I have window 32 bit operating system and R- 3.0.1 version. zelig' package is not compatible with R-3.0.1 version. Please help me how to install the package zelig . If any other package is available in replace of zelig', kindly

[R] R in Excel

2014-04-29 Thread Olga Albutova
Hello! I need some help. I'd like to make a button in Excel which performes functions wrote in R. Is there is any macros to do this? I don't want to use RExcel. Thank you very much! Sincerely yours, Olga [[alternative HTML version deleted]] __

Re: [R] sum of two POSIXct objects: date and hour

2014-04-29 Thread jim holtman
When I read in your data, I get the following since I am in the EDT time zone: df-structure(list(date = structure(c(1395874800, 1395874800, 1395874800, + 1395874800, 1395874800), class = c(POSIXct, POSIXt), tzone = ), + hour = structure(c(-2209121804, -2209121567, -2209121005, +

Re: [R] R in Excel

2014-04-29 Thread PIKAL Petr
Hi I can be mistaken but isn't it a question to Microsoft help? Did you try to ask them? Petr -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Olga Albutova Sent: Tuesday, April 29, 2014 5:05 PM To: r-help@r-project.org

Re: [R] subset of obersevation depending on multiple conditions

2014-04-29 Thread Christoph Schlächter
Dear, This is a very efficient way. I have checked some values and it is what is was looking for. I want to find the days called dry-weather days. It depends but in my case it is a dry day if on this day the precipitation N is equal or less than 0.3 mm and if on the day before the day with N =

Re: [R] R in Excel

2014-04-29 Thread Jeff Newmiller
Well, I suppose you might be able to use VBA to invoke a shell (command line) which could run an R script, but that would be quite restrictive. --- Jeff NewmillerThe . . Go Live...

Re: [R] dataframe

2014-04-29 Thread arun
Hi, It is better to show example data using ?dput(). dat - structure(list(row.names = 1:4, XYZ = c(sample, sample2, sample3, sample4), `000_001` = c(sample, Au5, C, C ), `000_002` = c(sample, Au32, C, Au4), `000_003` = c(sample, Au5, A, AC)), .Names = c(row.names, XYZ, 000_001, 000_002,

Re: [R] R Cairo Installation - Cannot find cairo.h!

2014-04-29 Thread Fong Chun Chan
Hi Peter, Unfortunately neither of the modifications to the LIB flag worked. I tried: export CAIRO_LIBS='-L${HOME}/usr/local/lib -lcairo' This actually gave me an error like this: . configure: CAIRO_CFLAGS=-I/home/fong/usr/local/include/cairo checking if R was compiled with the RConn

Re: [R] R in Excel

2014-04-29 Thread JLucke
Check out http://www.r-bloggers.com/a-million-ways-to-connect-r-and-excel/ for an overview. See section 4. Olga Albutova oda...@gmail.com Sent by: r-help-boun...@r-project.org 04/29/2014 11:05 AM To r-help@r-project.org, cc Subject [R] R in Excel Hello! I need some help. I'd

[R] set axis limit in lattice

2014-04-29 Thread Luigi Marongiu
Dear all, I would like to set the axis of a figure using the max() so to have more control on the limits of the axis -- this because in the actual case more independent figures are generated from the same dataframe and these must have the same axis scale. Since the figure is generated using

Re: [R] R Cairo Installation - Cannot find cairo.h!

2014-04-29 Thread Fong Chun Chan
For anyone who has these issues, I eventually recognized that the issue had to do with the fact the mine cairo was not being compiled with freetype support. I had to recompile cairo with --enable-ft=yes. Also removed the setting of the CAIRO_LIBS and CAIRO_CLAGS environment variables in my

Re: [R] Replacing NA's in the data set

2014-04-29 Thread jim holtman
try this: for (i in 1:10){ Ts[is.na(Ts[, i]), i] - Ts[is.na(Ts[, i]), 11] } 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, Apr 29, 2014 at 4:46 AM, dila radi dilarad...@gmail.com wrote: Hi

Re: [R] sum of two POSIXct objects: date and hour

2014-04-29 Thread mbressan
hi, thanks for your reply the first record for my date is 2014-03-27 and for my hour is 1899-12-30 12:03:16 I got to this point by importing some data via RODBC from an access database Now, I would like to get a single column with the date and the time that for the first record should be equal

Re: [R] Fwd: problem with kmeans

2014-04-29 Thread dcarlson
You really should read the instructions before complaining. The manual page for kmeans clearly states that it works on a numeric matrix of data. That is not what you provided. You gave it a distance matrix. The function pam() will work with a distance matrix if it is properly labeled as such, but

Re: [R] Fast way to populate a sparse matrix

2014-04-29 Thread Tom Wright
Thanks everyone, That's a 3000 fold speedup. Now if only I can get the same improvement on the stMincuts iGraph algorithm. On Fri, Apr 25, 2014 at 4:20 AM, Martin Maechler maech...@stat.math.ethz.ch wrote: Stefan Evert stefa...@collocations.de on Fri, 25 Apr 2014 09:09:31 +0200

Re: [R] Kindly help me

2014-04-29 Thread David Winsemius
On Apr 29, 2014, at 7:14 AM, Ramesh Das wrote: Dear all, I have a problem in installing the the package zelig. I have window 32 bit operating system and R- 3.0.1 version. There is quite of bit of missing information about your setup. Please read the Posting Guide for advice about the

Re: [R] sum of two POSIXct objects: date and hour

2014-04-29 Thread jim holtman
Here is how I would do the conversion. I start off by setting my timezone to GMT. # df-structure(list(date = structure(c(1395874800, 1395874800, + 1395874800, + 1395874800, 1395874800), class = c(POSIXct, POSIXt), tzone = ), + hour = structure(c(-2209121804,

[R] ICPSR R course in Berkeley in June 2014

2014-04-29 Thread John Fox
Announcing the ICPSR Summer Program Workshop The R Statistical Computing Environment: The Basics and Beyond View this announcement in your browser: http://eepurl.com/TEGH5 The R Statistical Computing Environment: The Basics and Beyond Dates: June 23-27, 2014 URL: http://bit.ly/1mXqVqU

Re: [R] set axis limit in lattice

2014-04-29 Thread Duncan Mackay
Hi Luigi This produces plenty of white space for the y axes Y-max(my.data$copy) stripplot( copy ~ factor(positivity)|factor(stimulation, levels = c(Unst., ESAT6,CFP10,Rv3615c, Rv2654,Rv3879, Rv3873,PHA)), my.data, group = positivity, hor=F, layout = c(8,1),

Re: [R] lattice plot formatting: pch, abbreviation and labels

2014-04-29 Thread Duncan Mackay
Forgot to cc to list Hi Luigi Our emails are apparently crossing What you are doing is referencing down ONLY to the stimulation level and not the stimulation level + productivity level required for each of the N and P groups notch-0.3 stripplot( copy ~

[R] plotGooglemaps - Problem with the legend.

2014-04-29 Thread James Holland
I cannot get the legend to display the cut points I want correctly. Instead of doing the colors at 1, 2, 3, 4, 5 - its doing the color breaks at odd points on the legends. The labels seem to get coded correctly however. # Code Below

[R] Kindly help me

2014-04-29 Thread Ramesh Das
Dear all, I have a problem in installing the the package zelig. I have window 32 bit operating system and R- 3.0.1 version. zelig' package is not compatible with R-3.0.1 version. Please help me how to install the package zelig . If any other package is available in replace of zelig', kindly

[R] Extracting information from ROC??

2014-04-29 Thread svannoy
Hi, I've used the ROC function from the Epi package to plot an ROC curve and generate descriptive statistics (i.e. sensitivity, specificity, PPV, NPV) for what ROC considers the best predictor score - this is done automatically by ROC on the graph. What I want to do, is get these same

[R-es] comando compress

2014-04-29 Thread Jose Ramirez Costa
Hola, estoy tratando de pasar un script de SAS a R y en SAS se usa el comando compress para eliminar los espacios en blanco de una cadena de caracteres, y no encuentro un comando equivalente en R. Saben si existe el comando equivalente en R o como podria crear una funcion que realice lo mismo?

Re: [R-es] comando compress

2014-04-29 Thread Jose Ramirez Costa
Anduvo! Gracias Emilio! El 29 de abril de 2014, 16:14, Emilio L. Cano emilopezc...@gmail.comescribió: Prueba con la función gsub: x - hello world que pasa mundo x[1] hello world que pasa mundo gsub( , , x)[1] helloworldquepasamundo Un saludo, Emilio