Re: [R] dplyr and function length()

2015-08-04 Thread Karl Schilling
Dear Jeff: No, the effect I described has nothing to do wit USING dplyr. It occurs with any (preexisting) data.frame once dplyr is LOADED (require(dplyr). It is this silent, sort of backward acting effect that disturbs me. Best, Karl Schilling On 04.08.2015 12:20, Jeff Newmiller wrote: I

Re: [R] dplyr and function length()

2015-08-04 Thread Hadley Wickham
No, the effect I described has nothing to do wit USING dplyr. It occurs with any (preexisting) data.frame once dplyr is LOADED (require(dplyr). It is this silent, sort of backward acting effect that disturbs me. You're going to need to provide some evidence for that charge: dplyr does not

Re: [R] dplyr and function length()

2015-08-04 Thread Hadley Wickham
length(df[,1]). Both commands will return n. However, once dplyr is loaded, length(df[,1]) will return a value of 1. length(df$m1) and also length(df[[1]]) will correctly return n. I know that using length() may not be the most elegant or efficient way to get the value of n. However,

[R] Course: Introduction to zero inflated models

2015-08-04 Thread Highland Statistics Ltd
Apologies for cross-posting We would like to announce the following statistics course: Course: Introduction to zero inflated models Where: Elche (close to Alicante), Spain When: 2-6 November 2015 Course website: http://www.highstat.com/statscourse.htm Flyer:

Re: [R] Course: Introduction to zero inflated models

2015-08-04 Thread John McKown
On Tue, Aug 4, 2015 at 7:05 AM, Highland Statistics Ltd highs...@highstat.com wrote: Apologies for cross-posting ​Apologies for UCE does not make it any less objectionable.​ But I would love a working vacation in the U.K. -- Schrodinger's backup: The condition of any backup is unknown

Re: [R] dplyr and function length() and some apologies

2015-08-04 Thread Karl Schilling
Dear Hadley: your request for evidence for my observation seems to have paved the way to solve this issue. As it turns out, the effect I described only occurs with data.frames read in with readxl. Clearly, I missed that these are tbl_df. And that explains the differential behavior depending

[R] dplyr and function length()

2015-08-04 Thread Karl Schilling
Dear All, I have an observation / question about how the function length() works once package dplyr is loaded. Say we have a data.frame df with n rows and m columns. Then a way to get the number of rows is to use length(df$m1) (m1 here stand is as the header of the first column) or,

[R] how to use nlme package to analysis mixed effect model

2015-08-04 Thread PO SU
Dear experts,    i want to use nlme or plm to analysis mixed effect model, my data has the format :   city  year  area    y   x       1    2010   A     1.2   2    1    2011   A     3    3     2   2010   A     5    4     2   2011   A    2.1   1.8    3  2010  B      1.7    2       I

Re: [R] dplyr and function length()

2015-08-04 Thread peter dalgaard
On 04 Aug 2015, at 10:50 , Karl Schilling karl.schill...@uni-bonn.de wrote: Dear All, I have an observation / question about how the function length() works once package dplyr is loaded. Say we have a data.frame df with n rows and m columns. Then a way to get the number of rows is to

Re: [R] write.csv file= question

2015-08-04 Thread John Kane
You probably need to ask this on a RStudio forum but my guess is it is just a little 'refinement' that the RStudio people added. Similar in concept o the the matching . John Kane Kingston ON Canada -Original Message- From: demmi...@gmail.com Sent: Tue, 4 Aug 2015 08:51:24 -0600

[R] write.csv file= question

2015-08-04 Thread Brittany Demmitt
Hello, I have a quick question about the “file=“ specification for the command write.csv.When I run this command in Rstudio I do not need the “file=“ specified. For example the below command works just fine. write.csv(data,”/home/data.csv”) However when I am running an Rscript from

[R] attributes in dplyr and haven

2015-08-04 Thread Conklin, Mike (GfK)
I read in spss files using haven's read_spss. Each column then gets attributes assigned named label - a long description of the variable class - labelled labels --- answer labels i.e. 1=Male, 2=Female example - attributes(KPTV[[3]]) $label [1] DERIVED: Survey language $class [1] labelled

Re: [R] dplyr and function length()

2015-08-04 Thread Jeff Newmiller
I can confirm that the drop default is different, but keep in mind that it is only changed for a tbl_df so just convert back to data.frame at the end of your dplr operations to get back to your familiar data.frame behavior.

Re: [R] write.csv file= question

2015-08-04 Thread Brittany Demmitt
Thanks! On Aug 4, 2015, at 9:04 AM, John Kane jrkrid...@inbox.com wrote: You probably need to ask this on a RStudio forum but my guess is it is just a little 'refinement' that the RStudio people added. Similar in concept o the the matching . John Kane Kingston ON Canada

Re: [R] write.csv file= question

2015-08-04 Thread Ista Zahn
On Tue, Aug 4, 2015 at 11:04 AM, John Kane jrkrid...@inbox.com wrote: You probably need to ask this on a RStudio forum but my guess is it is just a little 'refinement' that the RStudio people added. Similar in concept o the the matching . Really? write.csv(data,”/home/data.csv”) works for me

Re: [R] write.csv file= question

2015-08-04 Thread David L Carlson
I cannot reproduce your problem on a Windows 8 machine with R version 3.2.1. It is working fine for me without file= when I source() a script file from the console. Open a script file and add the following commands: test - data.frame(x=rnorm(15, 10, 2), y=rnorm(15, 15, 3)) write.csv(test,

Re: [R] write.csv file= question

2015-08-04 Thread Ista Zahn
On Tue, Aug 4, 2015 at 11:12 AM, Ista Zahn istaz...@gmail.com wrote: On Tue, Aug 4, 2015 at 11:04 AM, John Kane jrkrid...@inbox.com wrote: You probably need to ask this on a RStudio forum but my guess is it is just a little 'refinement' that the RStudio people added. Similar in concept o the

Re: [R] write.csv file= question

2015-08-04 Thread Sergio Fonda
Call getwd() in both terminal and your RStudio environments and compare results Il 04/ago/2015 16:53, Brittany Demmitt demmi...@gmail.com ha scritto: Hello, I have a quick question about the “file=“ specification for the command write.csv.When I run this command in Rstudio I do not need

Re: [R] Two conditions selection

2015-08-04 Thread James Hedges
cycle %% filter(col == blue, cycle == 1) On Tue, Aug 4, 2015 at 18:59 Rodrigo Díaz rodlupa...@hotmail.com wrote: Hi. I have a matrix like this:

Re: [R] Two conditions selection

2015-08-04 Thread Nordlund, Dan (DSHS/RDA)
You need to read up on indexing in R. What you want is logical indexing. You can use just the vectors you created (since you didn't save the data frame that you created) like this cycle=c(rep(1,3),rep(2,3),rep(3,3),rep(4,3))

[R] Two conditions selection

2015-08-04 Thread Rodrigo Díaz
Hi. I have a matrix like this: cycle=c(rep(1,3),rep(2,3),rep(3,3),rep(4,3))col=c(rep(blue,2),rep(green,2),rep(blue,2),rep(green,2),rep(blue,2),rep(green,2))values=c(1:12)data.frame(cycle,col,values) # cycle col values#1 1 blue 1#2 1 blue 2#3 1 green 3#4 2

[R] GARCH model estimation

2015-08-04 Thread Barbara Rogo
I have to estimate the volatility of FTSE/MIB index with a GARCH model from 2012-06-21 to 2015-04-30, in every day. I use garchFit function, but I don't understand the meaning of se.coef output. Does this function estimate the volatility in every day of the time series (in input)? So does it

Re: [R] Households per Census block

2015-08-04 Thread Keith S Weintraub
I had to download a bunch of stuff but I got it mostly working. Unfortunately using the alternative method I get the following: housing-CensusAPI2010(c(H0010001), state.fips=state.fips, level = c(block), key, summaryfile = c(sf1)) Error in file(con, r) : cannot open the connection In

Re: [R] attributes in dplyr and haven

2015-08-04 Thread Hadley Wickham
Install the latest version of dplyr? Should be fixed there. Hadley On Tue, Aug 4, 2015 at 9:40 AM, Conklin, Mike (GfK) mike.conk...@gfk.com wrote: I read in spss files using haven's read_spss. Each column then gets attributes assigned named label - a long description of the variable class -

[R] Help with Plot

2015-08-04 Thread April Smith
Let me just preface that everything I know about writing code for R is self taught so this may be really basic but I can't figure it out! I am using someone else code to create plots. I would like to change the automatically generated colors to the same colors for every plot. The current code

Re: [R] Help with Plot

2015-08-04 Thread Peter Langfelder
Try removing the line x - x[order(x[,1], decreasing=TRUE),] Peter On Tue, Aug 4, 2015 at 10:58 AM, April Smith aprilgracesm...@gmail.com wrote: Let me just preface that everything I know about writing code for R is self taught so this may be really basic but I can't figure it out! I am

Re: [R] Households per Census block

2015-08-04 Thread Zack Almquist
Hi Keith, On Tue, Aug 4, 2015 at 12:43 PM, Keith S Weintraub kw1...@gmail.com wrote: I had to download a bunch of stuff but I got it mostly working. Unfortunately using the alternative method I get the following: housing-CensusAPI2010(c(H0010001), state.fips=state.fips, level = c(block),

Re: [R] Households per Census block

2015-08-04 Thread Keith S Weintraub
Can you give me a for-instance of “populations”? Is there a table or chart or list or… Also I guess that I should leave my R session on for as long as possible as “install.blk” takes a really long time to re-upload if that is what it is doing. Does install.blk go to the source every time?

Re: [R] Households per Census block

2015-08-04 Thread Zack Almquist
Hi Keith, I would only use install.blk() once. Then just load the library(UScensus2010blk) like normal on your machine (this should be relatively fast), redownloading and re-installing each time will be very expensive (both on download and time). The SF1 file manual produced by the US Census

Re: [R] Households per Census block

2015-08-04 Thread Zack Almquist
P.S. The US census has different populations (or worlds) so make sure the housing variable you use is accessing the correct world. Best, -- Zack - Zack W. Almquist Assistant Professor Department of Sociology and School of Statistics

Re: [R] Households per Census block

2015-08-04 Thread David Winsemius
On Aug 4, 2015, at 12:31 PM, Keith S Weintraub wrote: Can you give me a for-instance of “populations”? Is there a table or chart or list or… Also I guess that I should leave my R session on for as long as possible as “install.blk” takes a really long time to re-upload if that is what it

Re: [R] Two conditions selection

2015-08-04 Thread James Hedges
Sorry. In dplyr: data %% filter(col == blue, cycle ==1) %% select(values) On Tue, Aug 4, 2015 at 19:54 James Hedges jhedg...@gmail.com wrote: cycle %% filter(col == blue, cycle == 1) On Tue, Aug 4, 2015 at 18:59 Rodrigo Díaz rodlupa...@hotmail.com wrote: Hi. I have a matrix like this:

Re: [R] Two conditions selection

2015-08-04 Thread Pete Brecknock
Rodrigo Díaz wrote Hi. I have a matrix like this: cycle=c(rep(1,3),rep(2,3),rep(3,3),rep(4,3))col=c(rep(blue,2),rep(green,2),rep(blue,2),rep(green,2),rep(blue,2),rep(green,2))values=c(1:12)data.frame(cycle,col,values) # cycle col values#1 1 blue 1#2 1 blue 2#3 1

Re: [R-es] Menor que 1000

2015-08-04 Thread Isidro Hidalgo
Buenos días: La función geom_smooth utiliza otra (stat_smooth) para hacer un suavizado. Por defecto, si tienes menos de 1000 valores usa regresión local (loess), si tienes más utiliza un modelo aditivo (gam). Si tienes la certeza de que no vas a pasar nunca de 1000 valores usa el siguiente

[R-es] Duda interpolación (package ' gstat ')

2015-08-04 Thread Marcos Bermejo
Hola, # Hacemos el KED. Ver funci�n krige(): KED.rad - krige( formula=pluvPcp~layer, # covariable - radar locations=lluvia.rad.pluv.spdf, newdata=radarGrid, # podr�a ser cualquier objeto Spatial model=v.fit,

[R-es] php-R

2015-08-04 Thread Jose Manuel Veiga del Baño
Estimados colegas: Estoy tratando de ejecutar varios scripts de R a través de php. Para ello estoy utilizando el siguiente código pero me sale: El URL solicitado no ha sido localizado en este servidor. El URL de la página que lo refirió[1] parece ser equivocado u obsoleto. Por favor comunique