Re: [R] Legend position in ggplot

2021-06-17 Thread Felipe Carrillo via R-help
Like this? theme(legend.position= 'top' On Thursday, June 17, 2021, 10:52:04 AM PDT, peri He wrote: Dear Friends, I would like to see my legend outside of a ggplot (at the top). This code is showing the legend inside of a plot: theme(legend.position=c(0.15,0.97)) But when I changed

Re: [R] Arranging ggplot2 objects with ggplotGrob()

2020-07-24 Thread Felipe Carrillo via R-help
What about cowplot? https://cran.r-project.org/web/packages/cowplot/vignettes/introduction.html On Friday, July 24, 2020, 11:51:17 AM PDT, H wrote: On 07/24/2020 02:03 PM, Jeff Newmiller wrote: > The set of people interested in helping when you supply a minimal > reproducible example i

Re: [R] [External Email] Re: [External] Re: access for free more than 500 essential Springer Nature textbooks

2020-05-22 Thread Felipe Carrillo via R-help
They can be downladed. I saved two of them to my desktop as pdf earlier. Sent from Yahoo Mail on Android On Fri, May 22, 2020 at 10:35 PM, Mark Leeds wrote: Hi: I'm not sure about the other link that was sent because I didn't try it  but, in the case of the link that I sent, you can obtain

Re: [R] Tinn-R project: new version (6.01.01.03) released

2019-12-23 Thread Felipe Carrillo via R-help
Josè Sent from Yahoo Mail on Android On Mon, Dec 23, 2019 at 12:15 PM, Abby Spurdle wrote: Hi Jose,Same here, I use tinn-R on a daily basis..thanks for the update and have a merry christmas That's awesome. I used Tinn-R, back in 2006, when I starting learning nontrivial R programming

Re: [R] Preserving numeric columns

2019-10-19 Thread Felipe Carrillo via R-help
is for you to indicate what that solution was so people searching the archives can learn from your question. Was it to set the kable option? options(knitr.kable.NA = '-')  On October 19, 2019 12:50:20 PM PDT, Felipe Carrillo wrote: >You are correct. I didnt explain well and fail

Re: [R] Preserving numeric columns

2019-10-19 Thread Felipe Carrillo via R-help
nvert everything to character format intentionally then. On October 19, 2019 12:44:26 AM PDT, Felipe Carrillo via R-help wrote: >Consider the following dataset:  I need to replace NAs with "-" but I >lose my numeric formatting  fall.estimate <- structure(list(`Salmon` = >c("

[R] Preserving numeric columns

2019-10-19 Thread Felipe Carrillo via R-help
Consider the following dataset:  I need to replace NAs with "-" but I lose my numeric formatting  fall.estimate <- structure(list(`Salmon` = c("salmon River", "Ant Creek", "big Creek", "oso River", "linda Creek"), `baseline` = c(80874.384012, 361.1997, 5012.8311, 638.6912, 402.1044), `ta

[R] time series x axis labels

2017-06-07 Thread Felipe Carrillo via R-help
I hope this is the appropriate list for this type of question Consider the dataset below:I have a column DOC with values from 3 to 101and those are the values that I want to show on my x axis, howeverI only get 3, 3.1, 3.2 and so on. I tried to change those values with xlim(3, 101) but I getthe

[R] Time series axis breaks

2017-06-07 Thread Felipe Carrillo via R-help
I hope this is the appropriate list for this type of question Consider the dataset below:I have a column DOC with values from 3 to 101and those are the values that I want to show on my x axis, howeverI only get 3, 3.1, 3.2 and so on. I tried to change those values with xlim(3, 101) but I getthe

Re: [R] gridExtra-arrangeGrob

2017-01-09 Thread Felipe Carrillo via R-help
gt;    On Monday, January 9, 2017 1:08 AM, Felipe Carrillo via R-help > wrote: > > >  Hi;The code below used to work on my older version of gridExtra but doesn't >work with the new version. Could someonegive me a hint on how to translate >this code to the new version

[R] gridExtra-arrangeGrob

2017-01-08 Thread Felipe Carrillo via R-help
 Hi;The code below used to work on my older version of gridExtra but doesn't work with the new version. Could someonegive me a hint on how to translate this code to the new version of gridExtra code? Thank you beforehand. p1 <- ggplot(iris,aes(Sepal.Length,  Petal.Length, colour=Species)) + geom_

[R] ddply question

2014-08-30 Thread Felipe Carrillo
I apologize about cross posting but my question keeps bouncing back from the list How come pct doesn't work in this ddply call? I am trying to get a percent of 'TotalCount' by SampleDate and Age library(plyr) b <- structure(list(SampleDate = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), .La

[R] t.test of matching columns from two datasets using plyr

2014-08-12 Thread Felipe Carrillo
Hi, I Have two datasets df1 and df2 with 3 matching columns. I need to do a t.test of sp1, sp2 and sp3� and var1, var2 and var3 where the year, month and location match. I can do it with sapply or mapply but I want the end result to be a data.frame. I prefer to do it with plyr or dplyr as I have

Re: [R] predicted values

2014-02-03 Thread Felipe Carrillo
ght forward 'force' the >model to be positive only. > >Best, > >Joshua > > > >On Sat, Feb 1, 2014 at 5:05 PM, Felipe Carrillo > wrote: >> Consider this dummy dataset. >> My real dataset with over 1000 records has >> scatter large and small value

[R] predicted values

2014-02-01 Thread Felipe Carrillo
Consider this dummy dataset. My real dataset with over 1000 records has scatter large and small values. I want to predict for values with NA but I get negative predictions. Is this a normal behaviour or I am missing a gam argument to force the model to predict positive values. library(mgcv) test <-

Re: [R] print multiple plots to jpeg, one lattice and one ggplot2

2013-05-03 Thread Felipe Carrillo
Something like this? library(gridExtra) grid.arrange(one,two) Felipe D. Carrillo Supervisory Fishery Biologist Department of the Interior US Fish & Wildlife Service California, USA http://www.fws.gov/redbluff/rbdd_jsmp.aspx > >From: Christophe Bouffioux >To: "r-

Re: [R] Summary of data for each year

2013-02-01 Thread Felipe Carrillo
 Here is another option using plyr:   library(plyr) creek <- read.csv("creek.csv")  library(ggplot2)  creek[1:10,]  colnames(creek) <- c("date","flow")  creek$date <- as.Date(creek$date, "%m/%d/%Y")   ddply(creek,"year",summarise,MED=median(flow),MEAN=mean(flow),SD=sd(flow),MIN=min(flow)) Felipe D

Re: [R] readJPEG function cannot open jpeg files

2013-01-14 Thread Felipe Carrillo
I have used the biOps package to read pictures and it works fine. For example you can plot a pic just by: library(biOps) x <- readJpeg("mypic.jpg")  ##mypic should be in you working directory plot(x) Notice that is only one uppercase letter on "readJpeg" and mypic is "jpg" not "jpeg" Felipe D.

Re: [R] save to file

2012-12-17 Thread Felipe Carrillo
.gov/redbluff/rbdd_jsmp.aspx > >From: Vivek Singh >To: David Winsemius >Cc: Felipe Carrillo ; r-help help > >Sent: Sunday, December 16, 2012 11:35 PM >Subject: Re: [R] save to file > > >try the following. it works for linux: > >

Re: [R] save to file

2012-12-16 Thread Felipe Carrillo
  Would it work?  >The reason I am saying is that with 1000s of lines of code, this will be still >easier. >A.K. > > > > > > > >From: Felipe Carrillo >To: arun ; "r-h...@stat.math.ethz.ch" > >Sent: Sunday, Decembe

Re: [R] save to file

2012-12-16 Thread Felipe Carrillo
I did check that link but it doesn't do what I want..thanks for trying though. Felipe D. Carrillo Supervisory Fishery Biologist Department of the Interior US Fish & Wildlife Service California, USA http://www.fws.gov/redbluff/rbdd_jsmp.aspx From: arun >To: Felipe Carrillo &

[R] save to file

2012-12-16 Thread Felipe Carrillo
 Hi, What's the equivalent of "Save to File" from the R console File menu on an R routine? Just trying to capture the whole R console into a text file when my code fails. Felipe D. Carrillo Supervisory Fishery Biologist Department of the Interior US Fish & Wildlife Service California, USA http

Re: [R] Count cell Count by her frequency

2012-12-10 Thread Felipe Carrillo
And another way: library(plyr) ddply(dta,"A",summarise,B=length(B)) Felipe D. Carrillo Supervisory Fishery Biologist Department of the Interior US Fish & Wildlife Service California, USA http://www.fws.gov/redbluff/rbdd_jsmp.aspx From: David L Carlson >To: 'Mat' ; r-help@r-project.org >Sent: M

Re: [R] simple subset question

2012-12-02 Thread Felipe Carrillo
or US Fish & Wildlife Service California, USA http://www.fws.gov/redbluff/rbdd_jsmp.aspx > >From: David L Carlson >To: 'Felipe Carrillo' ; 'arun' > >Cc: 'R help' >Sent: Sunday, December 2, 2012 2:54 PM >Su

Re: [R] simple subset question

2012-12-02 Thread Felipe Carrillo
oming in to the weeks of interest (weeks 45 to 52) and put a point on the 2012 max catch which is week 37     windows()   test + coord_cartesian(xlim=c(45,52)) + scale_x_continuous(breaks=c(45,47,49,51)) +   scale_y_continuous(limits=c(0,35)) + opts(title="Zooming in to weeks 45 to 52&q

Re: [R] simple subset question

2012-12-02 Thread Felipe Carrillo
alifornia, USA http://www.fws.gov/redbluff/rbdd_jsmp.aspx From: David Winsemius >To: Felipe Carrillo >Cc: William Dunlap ; arun ; R help > >Sent: Sunday, December 2, 2012 11:54 AM >Subject: Re: [R] simple subset question > >The reason I suggested the alternative that I did was bec

Re: [R] simple subset question

2012-12-02 Thread Felipe Carrillo
ks for your help and will try to figure out why subset returns an empty row Felipe D. Carrillo Supervisory Fishery Biologist Department of the Interior US Fish & Wildlife Service California, USA http://www.fws.gov/redbluff/rbdd_jsmp.aspx From: William Dunlap >To: Felipe Carrillo ; arun &

Re: [R] simple subset question

2012-12-02 Thread Felipe Carrillo
USA http://www.fws.gov/redbluff/rbdd_jsmp.aspx From: arun >To: Felipe Carrillo >Cc: R help ; R. Michael Weylandt > >Sent: Sunday, December 2, 2012 10:29 AM >Subject: Re: [R] simple subset question > >Hi, >I am getting this: >x<-subset(fish,Year==2012 & Tota

Re: [R] simple subset question

2012-12-02 Thread Felipe Carrillo
http://www.fws.gov/redbluff/rbdd_jsmp.aspx From: R. Michael Weylandt >To: Felipe Carrillo >Cc: "r-help@r-project.org" >Sent: Sunday, December 2, 2012 9:42 AM >Subject: Re: [R] simple subset question > >On Sun, Dec 2, 2012 at 5:21 PM, Felipe Carrillo > wrote: >> 

[R] simple subset question

2012-12-02 Thread Felipe Carrillo
 Hi, Consider the small dataset below, I want to subset by two variables in one line but it wont work...it works though if I subset separately. I have to be missing something obvious that I did not realize before while using subset.. fish <- structure(list(IDWeek = c(27L, 28L, 29L, 30L, 31L, 32L,

Re: [R] arrange data

2012-11-12 Thread Felipe Carrillo
om: Roslina Zakaria >To: Felipe Carrillo >Sent: Sunday, November 11, 2012 10:56 PM >Subject: Re: [R] arrange data > > >Thank you so much Felipe, I'll try your suggestion. > > >From: Felipe Carrillo >To: Roslina Zakaria ; "r-help@r-project.org"

Re: [R] arrange data

2012-11-11 Thread Felipe Carrillo
Something like this...untested I think cbind recicles the last value(31) since nov and dec are of different length nov <- kuantan.dt[(kuantan.dt$Bulan >=11);nov dec <- kuantan.dt[(kuantan.dt$Bulan >=12);dec both <- cbind(nov,dec) # get the first 30 records both <- head(both,30);both Felipe D. Ca

Re: [R] mean of a value of the last 2 hours

2012-10-25 Thread Felipe Carrillo
Or using ddply from plyr,   library(plyr) myframe <- data.frame (ID=c("Ernie", "Ernie", "Ernie", "Bert", "Bert", "Bert"), Timestamp=c("24.09.2012 09:00", "24.09.2012 10:00", "24.09.2012 11:00"), Hunger=c(1,1,1,2,2,1) ) myframe myframestime <- as.POSIXct (strptime(as.character(myframe$Timestamp), "%

Re: [R] nls question

2012-07-12 Thread Felipe Carrillo
Thank you all for your help. Felipe D. Carrillo Supervisory Fishery Biologist Department of the Interior US Fish & Wildlife Service California, USA http://www.fws.gov/redbluff/rbdd_jsmp.aspx > >From: Gabor Grothendieck >To: Felipe Carrillo &

Re: [R] nls question

2012-07-12 Thread Felipe Carrillo
px >____ >From: Gabor Grothendieck >To: Felipe Carrillo >Cc: Bert Gunter ; "r-help@r-project.org" > >Sent: Thursday, July 12, 2012 12:14 PM >Subject: Re: [R] nls question > >On Thu, Jul 12, 2012 at 3:02 PM, Felipe Carrillo > wr

Re: [R] nls question

2012-07-12 Thread Felipe Carrillo
e California, USA http://www.fws.gov/redbluff/rbdd_jsmp.aspx > >From: Bert Gunter >To: Felipe Carrillo >Cc: "r-help@r-project.org" >Sent: Thursday, July 12, 2012 10:56 AM >Subject: Re: [R] nls question > > >Read the Help file

[R] nls question

2012-07-12 Thread Felipe Carrillo
 Hi:  Using nls how can I increase the numbers of iterations to go beyond 50.  I just want to be able to predict for the last two weeks of the year.  This is what I have:  weight_random <- runif(50,1,24)  weight <- sort(weight_random);weight weightData <- data.frame(weight,week=1:50)  

Re: [R] ggplot- using geom_point and geom_line at the same time

2012-01-16 Thread Felipe Carrillo
Mary: Here's one way. ## change the variable name to whatever title you want on your legend data = melt(data, id="inputs",variable_name="customName") data g <- ggplot(data,aes(x=inputs, value, colour= customName, fill = customName, shape=customName)) g <- g + geom_line(lwd=0.8) g <- g + geom_point(

Re: [R] Group several variables and apply a function to the group

2011-12-04 Thread Felipe Carrillo
 Like this? library(plyr) ddply(df,.(comn,mi),summarise,stDEV=sd(x)) Felipe D. Carrillo Supervisory Fishery Biologist Department of the Interior US Fish & Wildlife Service California, USA http://www.fws.gov/redbluff/rbdd_jsmp.aspx From: Aurélien PHILIPPOT >To: R-help@r-project.org >Sent: Sunda

Re: [R] factor level issue after subsetting

2011-11-01 Thread Felipe Carrillo
Stefan: Use the droplevels function... dat <- read.table(textConnection("   treat yield 1  cont  98.7 2  cont  97.2 3  cont  96.1 4  cont  98.1 5    10 103.0 6    10 101.3 7    10 102.1 8    10 101.9 9    30 121.1 10    30 123.1 11    30 119.7 12    30 118.9 13    60 109.9 14    60 110.1 15    60 1

Re: [R] ggplot geom_boxplot vertical margins

2011-05-18 Thread Felipe Carrillo
Is this what you want? You can control how much space you want to see on the sides of the plot: df<-data.frame(x=factor(1:100),y=rnorm(1000)) ggplot(df,aes(x=x,y=y))+geom_boxplot() + scale_x_discrete(expand=c(0,0))   Felipe D. Carrillo Supervisory Fishery Biologist Department of the Interior US

Re: [R] Summarize by two or more attributes

2011-05-17 Thread Felipe Carrillo
Like This? x<-rep(c(1,15),10) y<-rnorm(20) z<-c(rep("auto",10),rep("bus",10)) a<-rep(c(1,1,2,2,3,3,4,4,5,5),2) #Create Data frame Df<-data.frame(Source=x,Rate=y,Bin=a,Type=z) Df ddply(Df,c('Type','Bin'),summarise,Summed=sum(Rate))  # Adding a column to Df ddply(Df,c('Type','Bin'),mutate,Summed=s

Re: [R] another question on shapefiles and geom_point in ggplot2

2011-04-03 Thread Felipe Carrillo
(manuel,region="id")   manuel_merged <- join(manuel_fort,manuel@data, by ="id") Felipe D. Carrillo Supervisory Fishery Biologist Department of the Interior US Fish & Wildlife Service California, USA http://www.fws.gov/redbluff/rbdd_jsmp.aspx > >F

Re: [R] another question on shapefiles and geom_point in ggplot2

2011-04-03 Thread Felipe Carrillo
 colours = rainbow(6), breaks = c(2, 4, 6, 8, 10, 12, 14, 16, 18, 20))+  xlab("Longitud") + ylab("Latitud") + opts(axis.text.x = theme_text(size = 8, vjust = 1)) +  opts(axis.text.y = theme_text(size = 8, hjust = 1))        Felipe D. Carrillo Supervisory Fishery Biologist

Re: [R] Rexcel path problem

2011-04-01 Thread Felipe Carrillo
Jorge: You can run save your scripts in the same folder where your wokbook is and run it like this: Sub Scatter() Call rinterface.StartRServer 'Put the dataframe into R Call rinterface.PutDataframe("scatter", DownRightFrom(Range("RData!A1")), WithRowNames:=False) Call rin

Re: [R] Tinn-R looses connection to R (Windows Vista)

2011-03-26 Thread Felipe Carrillo
Nutter, Benjamin ccf.org> writes: I've noticed it, but I haven't looked into it much since I rarely work on Vista. I have found that opening R before I open Tinn-R tends to work better than using Tinn-R to open the preferred GUI. Benjamin -Original Message- From: r-help-boun

Re: [R] Changes titles in ggplot2 plot

2011-02-12 Thread Felipe Carrillo
you can just probably add + labs(x="Time Elapsed,y="Predicted Probability")   Felipe D. Carrillo Supervisory Fishery Biologist Department of the Interior US Fish & Wildlife Service California, USA http://www.fws.gov/redbluff/rbdd_jsmp.aspx - Original Message > From: Shige Song > To:

Re: [R] ggplot - controlling point size

2011-01-25 Thread Felipe Carrillo
try this: qplot(x, y, data=df, colour=factor(type), size=I(1)) + geom_smooth()   Felipe D. Carrillo Supervisory Fishery Biologist Department of the Interior US Fish & Wildlife Service California, USA http://www.fws.gov/redbluff/rbdd_jsmp.aspx - Original Message > From: Gene Leynes > T

Re: [R] Sum by column

2011-01-12 Thread Felipe Carrillo
Or with ddply : library(plyr) dat <- structure(list(ED = c(21.809467, 36.229566, 51.861284, 11.36232, 27.264634, 12.261986, 46.519313, 7.815376, 2.810428, 13.478372, 35.670182, 27.128715, 19.010294, 15.475368, 18.597983, 29.292615, 6.749846, 14.981488, 14.93511, 14.93511, 21.040785, 8.271615, 12.94

[R] RODBC sqlSave question

2010-12-09 Thread Felipe Carrillo
Hi: I am getting the following error message when using the sqlSave function: "Error in sqlSave(myDB,myset)" table "myset" already exists" I want this table to be populated with new data everytime I execute sqlSave. The documentation says that: "If the table exists and has the appropriate structur

[R] how to display a dataset on a dialog window

2010-12-08 Thread Felipe Carrillo
HI: Is there a way to display a dataset on a dialog window? I am creating an application with Visual Basic and R, and I want the user to be able to see the dataset used print out on a dialog window. Not sure if there is a better way to do this, but basically when the user click a button on a VB

Re: [R] subset

2010-11-29 Thread Felipe Carrillo
om: Joshua Wiley > To: Felipe Carrillo > Cc: r-h...@stat.math.ethz.ch > Sent: Mon, November 29, 2010 1:11:23 PM > Subject: Re: [R] subset > > Hi Felipe, > > On Mon, Nov 29, 2010 at 1:02 PM, Felipe Carrillo > wrote: > >  Hi: > > I always use subset the same way bu

[R] subset

2010-11-29 Thread Felipe Carrillo
 Hi: I always use subset the same way but now is returning 0 rows. What's wrong with the way I am subsetting? library(ggplot2) structure(list(first = c(38.2086, 43.1768, 43.146, 41.8044, 42.4232, 46.3646, 38.0813, 40.0745, 40.4889, 38.6246, 40.2826, 41.6056, 34.5353, 40.0768), second = c(43.329

Re: [R] drop levels problem

2010-11-29 Thread Felipe Carrillo
Thanks Joshua, I get it now, levels sometimes drive me loco   Felipe D. Carrillo Supervisory Fishery Biologist Department of the Interior US Fish & Wildlife Service California, USA - Original Message > From: Joshua Wiley > To: Felipe Carrillo > Cc: r-h...@stat.math.e

Re: [R] Filling in missing time samples with na.approx

2010-11-29 Thread Felipe Carrillo
strange,,I don't see any change either, could it be that we have an older version of zoo?   Felipe D. Carrillo Supervisory Fishery Biologist Department of the Interior US Fish & Wildlife Service California, USA - Original Message > From: Gabor Grothendieck > To: Jason Edgecombe > Cc:

[R] drop levels problem

2010-11-29 Thread Felipe Carrillo
Hi all: I am having trouble dropping levels, got a few hints online without success. Please consider the dataset below:  I was under the inpression that subset(..drop=TRUE) would work but it doesn't library(ggplot2)     library(hmisc) x <- structure(list(first = c(38.2086, 43.1768, 43.146, 4

[R] Systat NRM function

2010-11-10 Thread Felipe Carrillo
Hi: I have some old scripts from when I used to use Systat and have the NRM(value1,value2) that I need to use with R. Does anyone know the R equivalency to this function? Thanks   Felipe D. Carrillo Supervisory Fishery Biologist Department of the Interior US Fish & Wildlife Service California, U

Re: [R] how to view the top 20 lines in a long dataset

2010-11-01 Thread Felipe Carrillo
is this what you want? head(yourdataset,20)   Felipe D. Carrillo Supervisory Fishery Biologist Department of the Interior US Fish & Wildlife Service California, USA - Original Message > From: Louis Plough > To: r-help@r-project.org > Sent: Mon, November 1, 2010 12:40:19 PM > Subject:

[R] (no subject)

2010-10-23 Thread Felipe Carrillo
http://www.sangermanomobili.it/mfoto.php [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html

Re: [R] Count values in a dataframe with respect to groups

2010-10-08 Thread Felipe Carrillo
Here is an option: grp = c(1,1,1, 1,2, 2,2)  val = c(2,1,5,NA,3,NA,1)  dta = data.frame(grp=grp, val=val) ddply(dta,"grp",summarise,count=length(na.omit(val)))   Felipe D. Carrillo Supervisory Fishery Biologist Department of the Interior US Fish & Wildlife Service California, USA - Original

Re: [R] gridExtra question

2010-10-01 Thread Felipe Carrillo
y from there, saved it to my desktop and then "installed packages from local zip files"   Felipe D. Carrillo Supervisory Fishery Biologist Department of the Interior US Fish & Wildlife Service California, USA - Original Message > From: Erik Iverson > To: Felipe Carr

Re: [R] gridExtra question

2010-10-01 Thread Felipe Carrillo
I must be blind, CRAN was  my first try and didn't see it there. It is Friday and time to take a break I guess :-)   Felipe D. Carrillo Supervisory Fishery Biologist Department of the Interior US Fish & Wildlife Service California, USA > >From: Ista Zahn >To: Felipe

[R] gridExtra question

2010-10-01 Thread Felipe Carrillo
  Hi: I get a couple of warnings  when trying to download gridExtra: install.packages("gridExtra",repos=http://R-Forge.R-project.org)  Warning: unable to access index for repository http://R-Forge.R-project.org/bin/windows/contrib/2.10 Warning message: In getDependencies(pkgs, dependencies, avail

[R] Controling R from MS Access

2010-09-29 Thread Felipe Carrillo
HI: I've seen a few threads about this topic but still can't find a straightforward way on this.   Is there a package that can control R within an access form. For example, I want to send a query to R, perform some statistics in R and send the output or summary back to Access and display it on a f

Re: [R] reordering levels error

2010-08-30 Thread Felipe Carrillo
 Thanks Dennis: I always seem to have a hard time defining levels. That's exactly what I needed.    > >From: Dennis Murphy >To: Felipe Carrillo >Cc: r-h...@stat.math.ethz.ch >Sent: Mon, August 30, 2010 5:41:02 PM >Subject: Re: [R] reordering levels error > >H

Re: [R] reordering levels error

2010-08-30 Thread Felipe Carrillo
umulative",axis.text.x = theme_text(angle=45,hjust=1)) +  labs(y="Number of individuals X 1,000",x="week") dev.off() Felipe D. Carrillo Supervisory Fishery Biologist Department of the Interior US Fish & Wildlife Service California, USA - Original Message >

[R] reordering levels error

2010-08-30 Thread Felipe Carrillo
Please consider the following dataset: I want to reorder the levels by year but get the following error: Error in tapply(v, x, FUN, ...) : arguments must have same length   I suspect that I need to add the levels before I melt the dataset  but either way I have only use 'reorder' once before and c

Re: [R] How to generate a sequence of dates without hardcoding the year

2010-07-26 Thread Felipe Carrillo
om: jim holtman > To: Felipe Carrillo > Cc: r-h...@stat.math.ethz.ch > Sent: Sat, July 24, 2010 4:02:57 PM > Subject: Re: [R] How to generate a sequence of dates without hardcoding the >year > > Is this what you want if you want to assume that the date without a > year is t

Re: [R] Trouble using grid.layout in Sweave

2010-07-26 Thread Felipe Carrillo
I just run the code below with sweave and works fine It looks like you might be missing the sequence of vplay <>= library(ggplot2) vplay<- function(x, y) viewport(layout.pos.row=x, layout.pos.col=y) grid.newpage() p <- ggplot(diamonds, aes(x=carat, y=..density..)) + geom_histogram(binwidth=0.

[R] How to generate a sequence of dates without hardcoding the year

2010-07-24 Thread Felipe Carrillo
Hi: I have a dataframe named 'spring' and I am trying to add a new variable named 'IdDate' This line of code works fine: spring$idDate <- seq(as.Date("2008-07-01"),as.Date("2009-06-30"),by="week") But I don't want to hardcode the year because it will be used again the following year Is it possib

Re: [R] Figures in Latex

2010-07-23 Thread Felipe Carrillo
Hannah: I am not sure if this is what you need but you can use an array to do that. Copy and paste the below code to your latex code. \newpage \begin{landscape} \begin{figure}[h] \begin{center}$ \begin{array}{cc} \includegraphics[width=2in]{yourgraphicname} & \includegraphics[width=2in]{yourgraphi

Re: [R] latex table question

2010-07-18 Thread Felipe Carrillo
I' ve seen latex questions being solved here that's why I sent my question to this list but someone already told me about the latex forum so the same question has already been solved there, Sorry about that.   - Original Message > From: Uwe Ligges > To: Felipe Car

Re: [R] export tables to excel files on multiple sheets with titles for each table

2010-07-13 Thread Felipe Carrillo
Check the WriteXLS package, I think it does that and also saves each R object on a different excel sheet.   Felipe D. Carrillo Supervisory Fishery Biologist Department of the Interior US Fish & Wildlife Service California, USA - Original Message > From: eugen pircalabelu > To: R-help

[R] latex table question

2010-07-13 Thread Felipe Carrillo
Hi: My head is spinning with this latex doc so hopefully after I align my tables to the left of the page my headache are going to be over. I always use: \hspace*{-0.1in} to move my figures horizontally to the left margin of the page but the table below doesn't move at all, but instead it gets sid

[R] Wrap column headers caption

2010-07-13 Thread Felipe Carrillo
Hi: Using this dataframe with quite long column headers, how can I wrap the text so that the columns are narrower. I was trying to use strwrap without success. Thanks reportDF <- structure(list(IDDate = c("3/12/2010", "3/13/2010", "3/14/2010", "3/15/2010"), FirstRunoftheYear = c("33 (119 ? 119)"

Re: [R] How to select the column header with \Sexpr{}

2010-07-13 Thread Felipe Carrillo
(34 ? 66)"  $ Run4   : chr  "0 ( ? )" "n (0 ? 0)" "0 ( ? )" "0 ( ? )"  $ Run5   : chr  "0 ( ? )" "n (0 ? 0)" "0 ( ? )" "0 ( ? )"  names(report)[1]  # I can extract the column name here [1] "Date" But after

Re: [R] How to select the column header with \Sexpr{}

2010-07-12 Thread Felipe Carrillo
p;890 (32 ? 47)&0 ( ? )&0 ( ? )\tabularnewline 2&3/13/2010&n (0 ? 0)&n (0 ? 0)&n (0 ? 0)&n (0 ? 0)&n (0 ? 0)\tabularnewline 3&3/14/2010&893 (110 ? 146)&337 (67 ? 74)&10,602 (32 ? 52)&0 ( ? )&0 ( ? )\tabularnewline 4&3/15/2010&140 (111 ? 150)&

Re: [R] How to select the column header with \Sexpr{}

2010-07-12 Thread Felipe Carrillo
and so on, but I can't access my column headers with \Sexpr{} because I can't find the way to reference run1,run2,run3 and run4. Sorry if I am not explain myself really well.   - Original Message ---- > From: Duncan Murdoch > To: Felipe Carrillo > Cc: r-h...@stat.math.eth

[R] How to select the column header with \Sexpr{}

2010-07-12 Thread Felipe Carrillo
Hi: Since I work with a few different fish runs my column headers change everytime I start a new Year. I have been using \Sexpr{} for my row and columns and now I am trying to use with my report column headers. \Sexpr{1,1} is row 1 column 1, what can I use for headers? I tried \Sexpr{0,1} but swea

Re: [R] R2wd- how to open an existing document

2010-07-06 Thread Felipe Carrillo
he Interior US Fish & Wildlife Service California, USA - Original Message > From: Erik Iverson > To: Felipe Carrillo > Cc: r-h...@stat.math.ethz.ch > Sent: Tue, July 6, 2010 3:03:31 PM > Subject: Re: [R] R2wd- how to open an existing document > > Having no cl

[R] R2wd- how to open an existing document

2010-07-06 Thread Felipe Carrillo
Hi: How can one open an existing word document with wdGet() I am getting an error message when trying to open it like this: wdGet(filename="myDoc.doc",path="c/mydata") Looking at Tal Galili's website example it appears that double backslashes are used but i tried it and didn't work either. Thanks

Re: [R] predict newdata question

2010-06-26 Thread Felipe Carrillo
ilto:> href="mailto:> ymailto="mailto:r-help-boun...@r-project.org"; > href="mailto:r-help-boun...@r-project.org";>r-help-boun...@r-project.org">> > ymailto="mailto:r-help-boun...@r-project.org"; > href="mailto:r-hel

Re: [R] predict newdata question

2010-06-25 Thread Felipe Carrillo
will > see two extra columns. -Original Message- From: > ymailto="mailto:r-help-boun...@r-project.org"; > href="mailto:r-help-boun...@r-project.org";>r-help-boun...@r-project.org > [mailto:> > href="mailto:r-help-boun...@r-project

[R] predict newdata question

2010-06-25 Thread Felipe Carrillo
Hi: I am using a subset of the below dataset to predict PRED_SUIT for the whole dataset but I am having trouble with 'newdata'. The model was created with 153 records and want to predict for 208 records. wolf2 <- structure(list(gridcell = c(367L, 444L, 533L, 587L, 598L, 609L, 620L, 629L, 641L, 6

[R] rgdal-maptools

2010-06-23 Thread Felipe Carrillo
The shapefile data can be downloaded from the link below: download all the six files and save them on your working directory and make sure the dsn path is set to where the files are saved. My shapefiles are saved on C:/Data. https://secure.filesanywhere.com/fs/v.aspx?v=897263875a6472a99baa Hi: I

Re: [R] Plotting Data on a Map

2010-06-23 Thread Felipe Carrillo
For some reason the shapefile can't get attached. The shapefile is too large to put it in dput..Is there another way to do this? - Original Message > From: Felipe Carrillo > To: Tom Hopper > Cc: r-h...@stat.math.ethz.ch; ggpl...@googlegroups.com > Sent: Wed, June 23

Re: [R] Plotting Data on a Map

2010-06-23 Thread Felipe Carrillo
er fortify area_mod #Not sure how to proceed from here to fit the 'mod1' model to all #the 5 states.   > >From: Tom Hopper >To: Felipe Carrillo >Sent: Tue, June 22, 2010 9:40:19 PM >Subject: Re: Plotting Data on a Map > >Felipe, > > >I am just learning the

Re: [R] Date conversion

2010-06-11 Thread Felipe Carrillo
a Wiley > To: Felipe Carrillo > Cc: r-h...@stat.math.ethz.ch > Sent: Thu, June 10, 2010 1:18:27 PM > Subject: Re: [R] Date conversion > > Hello Felipe, Is this what you want? format(as.Date("3/10/10", > format="%m/%d/%y"), "%B %d, %Y") Josh O

Re: [R] Latex: Date Format conversion

2010-06-10 Thread Felipe Carrillo
life Service California, USA - Original Message > From: Marc Schwartz > To: Felipe Carrillo > Cc: r-h...@stat.math.ethz.ch > Sent: Thu, June 10, 2010 10:19:40 AM > Subject: Re: [R] Latex: Date Format conversion > > Felipe, I would not do the processing in TeX, but do

Re: [R] Latex: Date Format conversion

2010-06-10 Thread Felipe Carrillo
e dates, something like this pseudo-code: Report from \longdate\Sexpr{report[1,1]} & - & \longdate\Sexpr{report[1,15]} Where long date will be the format that converts 6/1/10 to June 01, 2010 Thanks for helping. - Original Message > From: Marc Schwartz >

[R] Date conversion

2010-06-10 Thread Felipe Carrillo
Hi: Can't find a way to convert from shortDate to LongDate format. I got: 3/10/10 that I want to convert to March 10, 2010. I am using: \documentclass[11pt]{article} \usepackage{longtable,verbatim} \usepackage{ctable} \usepackage{datetime} \title{my title} \begin{document}   % Convert date \dd

[R] Latex: Date Format conversion

2010-06-10 Thread Felipe Carrillo
Hi: Can't find a way to convert from shortDate to LongDate format. I got: 3/10/10 that I want to convert to March 10, 2010. I am using: \documentclass[11pt]{article} \usepackage{longtable,verbatim} \usepackage{ctable} \usepackage{datetime} \title{my title} \begin{document}   % Convert date \dd

Re: [R] Patch for legend.position={left,top,bottom} in ggplot2

2010-06-10 Thread Felipe Carrillo
Hi: I downloaded the patch, how do I incorporate it to my current version of ggplot2?   Felipe D. Carrillo Supervisory Fishery Biologist Department of the Interior US Fish & Wildlife Service California, USA - Original Message > From: Hadley Wickham > To: Karsten Loesing > Cc: "r-help

Re: [R] cumsum function with data frame

2010-06-03 Thread Felipe Carrillo
le),transform,CUMSUM=cumsum(value))   - Original Message > From: Felipe Carrillo > To: Joris Meys ; "n.via...@libero.it" > > Cc: r-help@r-project.org > Sent: Thu, June 3, 2010 11:28:58 AM > Subject: Re: [R] cumsum function with data frame > > You can

Re: [R] cumsum function with data frame

2010-06-03 Thread Felipe Carrillo
You can also use ddply from the plyr package: library(plyr) Data <- read.table(textConnection("variable    Year  value EC01    2005    5 EC01    2006    10 AAO1    2005  2 AAO1  2006  4"),header=T) Data ddply(Data,.(variable),summaris

[R] Can not save plot to png file correctly

2010-05-31 Thread Felipe Carrillo
With ggsave the graph windows pops up but using: png("mypng.png") qplot(X, data=data, geom='histogram') + facet_wrap( ~ Y) dev.off() The graph is saved in the background Is there a way to hide the graph window when using ggsave? You can save as png like this too: library(ggplot2) data=data.frame(

Re: [R] Can not save plot to png file correctly

2010-05-31 Thread Felipe Carrillo
You can save as png like this too: library(ggplot2) data=data.frame(   X=sample(10,1000,replace=T)   , Y=letters[1:10]) png("mypng.png") qplot(X, data=data, geom='histogram') + facet_wrap( ~ Y) dev.off()   Felipe D. Carrillo Supervisory Fishery Biologist Department of the Interior US Fish & Wildli

Re: [R] Put two plots side by side

2010-05-31 Thread Felipe Carrillo
Two different ways: library(ggplot2) x=5 size=50 A=data.frame(X=sample(x, size, replace=T), Y=sample(x, size, replace=T),a=rep(1:2,each=25));A # Facetting qplot(X,Y,data=A) + geom_jitter(position=position_jitter(width=.03)) + facet_grid(.~a) # Or with vp p=qplot(X, Y, data=A) + geom_jitter(positi

Re: [R] Problem with Sweave not recognising \Sexpr{}

2010-05-25 Thread Felipe Carrillo
 I had the same problem before and I think it has something to do with the R2HTML package. To take care of that problem simply sweave your rnw file like this: Sweave("yourfile.Rnw",syntax="SweaveSyntaxNoweb") and try Sexpr{} again.   Felipe D. Carrillo Supervisory Fishery Biologist Department of

[R] Dataframe to word, using R2wd

2010-05-15 Thread Felipe Carrillo
Hi: Just adding on to this question...Is it a way to add footnotes to tables with R2wd? I started using this nice package about a month ago and is one of the things that I can't figure out yet..   Felipe D. Carrillo Supervisory Fishery Biologist Department of the Interior US Fish & Wildlife Servic

  1   2   3   >