Re: [R] install ggplot2

2014-01-22 Thread Jeff Newmiller
Hard to say. Read the Posting Guide for useful suggestions on getting help, including providing the output of sessionInfo() and avoiding HTML formatted emails because what you see is not what we see. I suggest you delete the ggplot2 subdirectory in your win-library directory and try the instal

Re: [R] unable to carry through object in a nested function

2014-01-22 Thread arun
Hi, Try this: GetPropPlot<- function (PrePropData, direction, SSThreshold, cell, stim) {    if (direction== ">") {     PropData<-ddply(PrePropData,.(SUBJECT, STIM, CELL, SIGNAL, DAY), here(summarise),     PROP=FindGreaterThanProportion(SIMSCORE, SSThreshold))     }     PlotSubs

Re: [R] unable to carry through object in a nested function

2014-01-22 Thread Chen, George
Hi, This is a resend of a previous message reproduced below but with sample data to run. Thanks. George Chen Hi There, I am having trouble carrying through an object listed in the outer function into the inner function of a nested pair. sample data below - library(plyr) SUBJE

[R] unable to carry through object in a nested function

2014-01-22 Thread Chen, George
Hi There, I am having trouble carrying through an object listed in the outer function into the inner function of a nested pair. This is my code: FindGreaterThanProportion<- function (y, SSThreshold) { DenomCells<-length(y) NumerCells<-subset(y,y>SSThreshold) PropCells<-length(NumerCel

Re: [R] subset and na.rm not really suppressing values

2014-01-22 Thread Jeff Newmiller
I don't think na.rm is a valid at parameter for the subset function. I would normally use the is.na function to logically test for NA values. I also don't know where your VALID_EMAIL variable is coming from. a <- subset(mydf, !is.na(EMAIL_ADDRESS)) The na.strings argument to read.csv and friend

[R] subset and na.rm not really suppressing values

2014-01-22 Thread Jeff Johnson
I have a dataset "mydf" with a field EMAIL_ADDRESS. When importing, I specified: mydf <- read.csv(file = extract, header = TRUE, stringsAsFactors = FALSE, na.strings=c("NA","")) I've also tried setting na.strings= c("NA","","") but I don't know if it's appropriate to put there. I'm running a <-

Re: [R] ETAS-Help

2014-01-22 Thread Jim Lemon
On 01/22/2014 10:03 PM, katerina stavrianaki wrote: Hello, My name is Katerina, i am new to R and i am working with the ETAS package. My goal is to fit the spatiotemporal etas model to an aftershock sequence ( atach file example.csv).I have installed the packages: spatstat, SAPP and ETAS. By re

Re: [R] xyplots in lattice - strange behaviour, possible bug?

2014-01-22 Thread Bert Gunter
... and I should have added (more complexity!) that the formula method of xyplot parses the formula and passes down what's on the left hand side of "~" to the "y" argument of the panel function. And if all else fails, read the docs! -- in this case for ?xyplot -- where it explicitly says: "... A

Re: [R] xyplots in lattice - strange behaviour, possible bug?

2014-01-22 Thread Don McKenzie
On Jan 22, 2014, at 3:02 PM, Bert Gunter wrote: > Well, if the professor wrote that, it wouldn't have run for him > either! Fortune? Or just a great line? Don McKenzie Research Ecologist Pacific Wildland Fire Science Lab US Forest Service Affiliate Professor School of Environmental and For

Re: [R] xyplots in lattice - strange behaviour, possible bug?

2014-01-22 Thread Bert Gunter
Well, if the professor wrote that, it wouldn't have run for him either! You need to take better notes. What's going on: You need to distinguish between formal and actual arguments. ?panel.xyplot tells you that the formal arguments for this function are x,**y** ,... (emphasis added) and NOT x,**z*

[R] xyplots in lattice - strange behaviour, possible bug?

2014-01-22 Thread Manlio Calvi
Hello everyone, I'm very green on R, I'm following a Coursera course about it when I hit a problem when I rewrote the same code the professor use in the lecture. I'm running Win 7 x64, R 3.0.2 x64 and the last version of Rstudio IDE I put up this script: library(lattice) x <- rnorm (100) z <-

Re: [R] Multiple corrgrams or joining jpg/png

2014-01-22 Thread Kevin Wright
1. When using a package from CRAN, you usually want to copy the package author on the question. (In this case, me.) 2. The corrgram function is basically a wrapper around the pairs() function. What you want to do doesn't seem to be possible based on this discussion: https://stat.ethz.ch/piperma

[R] geo_bar x= and y= warnings and error help

2014-01-22 Thread Matthew Henn
Any insight on issues leading to the following error modes would be appreciated. #Version_1 CALL alphaDivOTU <- ggplot(data=alphaDivOTU_pt1to5, aes(y = Num.OTUs,x = Patient,fill = Timepoint)) + geom_bar(position = position_dodge) + theme(text = element_text(family = 'Helvetica-Narrow',

[R] Multiple corrgrams or joining jpg/png

2014-01-22 Thread Georg Hörmann
Hello world, I have a database with time series of concentration of nutrients for several lakes. I wanted *one* corrgram for each nutrient in all lakes (correlation of a single nutrient content of all lakes in different years). The single corrgram works pretty well, but I cannot create a page

[R] install ggplot2

2014-01-22 Thread Dai, Jie
Hi Dear helper, I installed Rx643.0.2 on my windows 7 Enterprise computer, and I installed all the packages as well. However, when I tried to use ggplot2 package with the commend library("ggplot2", lib.loc="C:/Users/JXD043/Documents/R/win-library/3.0"), I got the following error message:" Err

[R] reduce space between factors groups in a graph

2014-01-22 Thread Luigi Marongiu
Dear all, I am preparing a graph in which values derived from 2 variable are displayed using the stripchart function. I have applied the factor function to separate the 2 variables in two groups, although I noticed that the graph works anyway even without the factorisation of the variables. However

[R] Problems with a R-packages

2014-01-22 Thread Andreas Rybicki
Hallo, Trust, that my request is one that can be posted under this mailing list Would like to install lossDev, Version in the Repository 3.0.0-4 and I did it under CRAN(sources). get as response "versuche URL 'http://cran.at.r-project.org/src/contrib/lossDev_3.0.0-4.tar.gz' "Content type 'ap

[R] Variance analysis

2014-01-22 Thread Grenier, Cecile (CIAT)
Dear R-helpers... I've be trying to run a variance analysis to compare means between various lines in various treatments. I have 10 genotypes (GEN), tested in 2 environments (ENV) and in each environment there are 3 repetitions (REP). Several traits were recoded (yield, flowering, plant height.

Re: [R] how to get the numbers of factors in a matrix

2014-01-22 Thread peter dalgaard
On 22 Jan 2014, at 15:51 , William Dunlap wrote: >> sapply(X, function(m){nlevels(factor(m$latitudes))}) > > I think that length(unique(x)) is a more direct and easier to remember > way of determining the number of unique values in the vector x, > rather than nlevels(factor(x)). However, it ma

[R] New version of document on R programming - with videos [French]

2014-01-22 Thread Vincent Goulet
I hereby announce the availability of the Fourth edition of my document «Introduction à la programmation en R» (in French) in the contributed documentation section of CRAN. The document is now accompanied by a set of short videos on more challenging topics like creation and indexing of arrays,

Re: [R] a problem with table() and duplicates

2014-01-22 Thread Simone Gabbriellini
that is awesome, thank you Jim! 2014/1/22 jim holtman : > try: > > table(dataframe$religion[!duplicated(dataframe$name)]) > > > 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 Wed, Jan 22, 2014

Re: [R] a problem with table() and duplicates

2014-01-22 Thread jim holtman
try: table(dataframe$religion[!duplicated(dataframe$name)]) 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 Wed, Jan 22, 2014 at 11:04 AM, Simone Gabbriellini wrote: > Dear List, > > I have a data.frame

[R] a problem with table() and duplicates

2014-01-22 Thread Simone Gabbriellini
Dear List, I have a data.frame like this: name religion neighbor religion.neighbor pippo a minnie a pluto a mickey a paperino b donald a paperino b minnie b when I table(dataframe$religion) my data.frame, I get a b 2 2 of course, "paperino" is cited twice but should be counted once. Is there an

Re: [R] how to get the numbers of factors in a matrix

2014-01-22 Thread William Dunlap
> sapply(X, function(m){nlevels(factor(m$latitudes))}) I think that length(unique(x)) is a more direct and easier to remember way of determining the number of unique values in the vector x, rather than nlevels(factor(x)). Bill Dunlap TIBCO Software wdunlap tibco.com > -Original Message-

[R] ETAS-Help

2014-01-22 Thread katerina stavrianaki
Hello, My name is Katerina, i am new to R and i am working with the ETAS package. My goal is to fit the spatiotemporal etas model to an aftershock sequence ( atach file example.csv).I have installed the packages: spatstat, SAPP and ETAS. By reading the ETAS package manual i saw the data must be i

Re: [R] complicated IF

2014-01-22 Thread jim holtman
Here is the change to create a Sunday in a week if it does not exist. I took out the Sunday (2009-11-01) for testing and you will notice that week 201129 did not have a Sunday, so it has NaN as the result. > x <- read.table(text = " Date nrec + + 1 2011-07-17 667 + + 2 2011-07-18 266 + + 3

Re: [R] complicated IF

2014-01-22 Thread Bill
Hello Jim, Thanks for this. I will study it. One thing, you wrote "# process each week, substituting the mean if Sunday exists". Even if Sunday's data does not exist, I need an entry for Sunday if Friday or Saturday (or both) exist. I don't yet understand what you wrote so I am not sure if that is

Re: [R] complicated IF

2014-01-22 Thread jim holtman
Here's one way of doing it. Does not use "complicated" IFs; just splits the data and works on it. > x <- read.table(text = " Date nrec + + 1 2011-07-17 667 + + 2 2011-07-18 266 + + 3 2009-10-29 29 + + 4 2009-10-30 211 + + 5 2009-10-31 237 + + 6 2009-11-01 898", header = TRUE, as.is =

[R] R in remote mode

2014-01-22 Thread Michael Haenlein
Dear all, I have written a simulation in R that has a significant running time (probably 60-80 hours). While I can run the code on my laptop, it tends to slow things down to a significant extent and it leads to a very high CPU temperature overall. Is there an easy and convenient way to run R remo

Re: [R] Setting up an R server.

2014-01-22 Thread aldi
Hi John, A server it means a computer that has an operating system, where you can run R. For example, a Linux OS can be run in a computer connected to your Local Area Network at home. There you can install R and you can communicate with it via batch mode or interactive. The simplest is you be

[R] complicated IF

2014-01-22 Thread Bill
Hello. I am trying to work out some complicated if() logic. I thought of using which() and if() but cannot get it. I have a dataframe that looks like this: head(deleteFridayTest) Date nrec 1 2011-07-17 667 2 2011-07-18 266 3 2009-10-29 29 4 2009-10-30 211 5 2009-10-31 237 6 2

Re: [R] Density or Boxplot with median and mean

2014-01-22 Thread Alaios
Thanks Jim.. once again your rock On Wednesday, January 22, 2014 9:51 AM, Jim Lemon wrote: On 01/22/2014 07:37 PM, Alaios wrote: > Hi there, > I would like to be able to draw a density plot or a box plot where the median > and the median and the mean would be visible. > > If I decide a de

Re: [R] My problem with R

2014-01-22 Thread PIKAL Petr
Hi First of all without posting some of your data it is really difficult to understand what you really want. Just select only a small part for 2 your data frames and post an output from dput. e.g. dput(data3[1:10, 1:7]) dput(data4[1:10, 1:7]) Most probably resulting timestamp is in POSIXlt mo

Re: [R] collapsing records

2014-01-22 Thread Bill
Hi That is great! Thanks On Mon, Jan 20, 2014 at 12:10 PM, Jim Lemon wrote: > On 01/20/2014 11:44 AM, Bill wrote: > >> I am trying to read a csv file with a date-time field. There are many rows >> with the same date but different times. I first want to clear the times so >> that rows from the s

Re: [R] Density or Boxplot with median and mean

2014-01-22 Thread Jim Lemon
On 01/22/2014 07:37 PM, Alaios wrote: Hi there, I would like to be able to draw a density plot or a box plot where the median and the median and the mean would be visible. If I decide a density plot I need to put two big marks one for the median and one for the mean, which I do not know how I

[R] Density or Boxplot with median and mean

2014-01-22 Thread Alaios
Hi there, I would like to be able to draw a density plot or a box plot where the median and the median and the mean would be visible. If I decide a density plot I need to put two big marks one for the median and one for the mean, which I do not know how I can achieve to put marks in a density p