Re: [R] Exponential population model

2016-08-29 Thread lesnoff
Dear Josephine I think you may easily build such a model with the mmage package available at http://livtools.cirad.fr/mmage Best Regards Matthieu On 29/08/2016 16:06, Msindai, Nadejda wrote: Dear David I think you misunderstood me, I need to find the name for an r package that models the po

Re: [R] package.skeleton fails

2016-08-29 Thread Strunk, Jacob (DNR)
Ok, I apologize - we seem to have a component in our environment that interacts with this function. Thank you for your help. You wouldn't happen to know if there is there a way to modify the way the environment is loaded in package.skeleton? - I don't see any way to pass it a configuration opti

Re: [R] How to split a data.frame into its columns?

2016-08-29 Thread aditya pant
^^ठश्रएइ),,, -Original Message- From: "David Winsemius" Sent: ‎29-‎08-‎2016 11:59 To: "Marius Hofert" Cc: "R-help" Subject: Re: [R] How to split a data.frame into its columns? > On Aug 28, 2016, at 11:14 PM, Marius Hofert > wrote: > > Hi, > > I need a fast way to split a data.fra

Re: [R] Exponential population model

2016-08-29 Thread Jim Lemon
Hi Josephine, Given the parameters you describe, you will probably have to write a function to update the database of animals at regular intervals. You can then run a number of repeats to get a better estimate of the final populations. I tried this and it appears to work. I don't know of any existi

Re: [R] possible error in stem() function?

2016-08-29 Thread Zibeli Aton via R-help
And thanks, Sarah, using scale=2 got me the sort of plot I was looking for. I agree the help is a bit thin on that function. On Mon, 8/29/16, Sarah Goslee wrote: Subject: Re: [R] possible error in stem() function? Cc: "r-help" Date: Monday, Aug

Re: [R] possible error in stem() function?

2016-08-29 Thread Zibeli Aton via R-help
Thanks, Duncan. I hadn't even noticed that there were no odd stems - makes perfect sense now. On Mon, 8/29/16, Duncan Murdoch wrote: Subject: Re: [R] possible error in stem() function? Date: Monday, August 29, 2016, 4:09 PM On 29/08/2016 1:42 P

Re: [R] How to test existence of an environment and how to remove it (from within functions)?

2016-08-29 Thread Duncan Murdoch
On 29/08/2016 4:52 PM, Marius Hofert wrote: Dear Duncan, Thanks a lot for your help. I tried to adapt your example to my MWE, but the subsequent calls of main() are 'too fast' now: new calls of main() should also 'reset' the environment (as a different x is generated then), that's why I tried t

Re: [R] How to test existence of an environment and how to remove it (from within functions)?

2016-08-29 Thread Marius Hofert
Dear Duncan, Thanks a lot for your help. I tried to adapt your example to my MWE, but the subsequent calls of main() are 'too fast' now: new calls of main() should also 'reset' the environment (as a different x is generated then), that's why I tried to remove the environment .my_environ from with

Re: [R] possible error in stem() function?

2016-08-29 Thread Sarah Goslee
The help isn't particularly helpful, but you need to play with the scale argument. The range of your first dataset is long enough that you're getting only even-numbered stems by default. Try these: x1 <- c(479,482,487,493,494,494,495,496,497,498,498,499,503,504,507,507,508, 510,511,512,514,516,

Re: [R] possible error in stem() function?

2016-08-29 Thread Duncan Murdoch
On 29/08/2016 1:42 PM, Zibeli Aton via R-help wrote: Using R-3.3.1 on Linux I seem to sometimes get inaccurate stem-and-leaf plots using stem. For example: x <- c(479,482,487,493,494,494,495,496,497,498,498,499,503,504,507,507,508, + 510,511,512,514,516,520,524,525,525,527,5

[R] Plm function, error in uniqval[as.character(effect), , drop = F]

2016-08-29 Thread lijuan huang
Hi, there, I am trying to run a panel regression with a huge dataset, which has lots of missing values. Here is some description of all variables. > str(com3) Classes ‘plm.dim’ and 'data.frame': 172153 obs. of 30 variables: $ tic : Factor w/ 3435 levels "A","AA","AAC",..: 1 1 1

Re: [R] Storing business hours

2016-08-29 Thread alexander.som...@tu-dortmund.de
Cheers Jim! The 0/1 way seems to work for me. It looks like: n <- 5 # number of “shops” i <- 12 # number of time intervals per hour # creating a data.frame (the example got random values) business_hours <- data.frame(1:n, matrix(data = sample(x = c(TRUE, FALSE), size = n * (24 * i), replac

Re: [R] Storing business hours

2016-08-29 Thread alexander.som...@tu-dortmund.de
Dear Bill, thank you for your help. I think, I finally understood your advice. At least, this one worked: library(package = lubridate) # for a more convenient display of times i <- 12 # number of time intervals per hour # creating a data.frame (original example) business_hours <- data.fram

Re: [R] Exponential population model

2016-08-29 Thread Msindai, Nadejda
Dear David I think you misunderstood me, I need to find the name for an r package that models the population size from time 0 for a group of animals. I provided details to make it clearer the type of model I want to run. The only population model I have come across thus far is Popbio, which

[R] possible error in stem() function?

2016-08-29 Thread Zibeli Aton via R-help
Using R-3.3.1 on Linux I seem to sometimes get inaccurate stem-and-leaf plots using stem. For example: > x <- c(479,482,487,493,494,494,495,496,497,498,498,499,503,504,507,507,508, + 510,511,512,514,516,520,524,525,525,527,534,536,542,545,546,547,549, + 557,559,5

Re: [R] How to connect Microsoft Sql server from R studio using freeTDS instead of RODBC package

2016-08-29 Thread Mark Sharp
Manu, I believe you are mistaken regarding using freeTDS instead of RODBC. shinyapps.io apparently has freeTDS drivers already installed. I am guessing that either you have not configured your connections string (odbcDriverConnect("driver = FreeTDS; ...")) correctly or your database server has

Re: [R] how to prepare my data to be used in the "survey" package

2016-08-29 Thread David Winsemius
> On Aug 29, 2016, at 9:48 AM, David Remotti wrote: > > Looking for some help in using the "survey" package > I have gone through the documentation but still find problems in > understanding how to prepare my data to be analyzed wih this package. > > In particular I dont understand how to prep

Re: [R] read.xlsx function crashing R Studio

2016-08-29 Thread Rainer Hurling
Hi Kevin, Am 21.08.2016 um 19:30 schrieb Kevin Kowitski: > Hey everyone, > >I have used read.xlsx in the past rather than XLConnect for importing > Excel data to R. However, I have been finding now that the read.xlsx > function has been causing my R studio to Time out. I thought it might >

Re: [R] How to test existence of an environment and how to remove it (from within functions)?

2016-08-29 Thread Duncan Murdoch
On 29/08/2016 1:36 PM, Marius Hofert wrote: Hi, I have a function main() which calls another function aux() many times. aux() mostly does the same operations based on an object and thus I would like it to compute and store this object for each call from main() only once. Below are two versions

[R] How to test existence of an environment and how to remove it (from within functions)?

2016-08-29 Thread Marius Hofert
Hi, I have a function main() which calls another function aux() many times. aux() mostly does the same operations based on an object and thus I would like it to compute and store this object for each call from main() only once. Below are two versions of a MWE. The first one computes the right res

Re: [R] How to connect Microsoft Sql server from R studio using freeTDS instead of RODBC package

2016-08-29 Thread Manohar Reddy
Hi Mark, Thank you so much for reply, using exiting ODBC drivers I will make a connection to sql server and it’s working fine in my local, but as per shinyapps.io I need to use freeTDS drivers instead RODBC ,so that I may not encounter the any issue .For me here challenging work is how to ins

[R] how to prepare my data to be used in the "survey" package

2016-08-29 Thread David Remotti
Looking for some help in using the "survey" package I have gone through the documentation but still find problems in understanding how to prepare my data to be analyzed wih this package. In particular I dont understand how to prepare the fpc data. The documentation provides a "small survey exam

Re: [R] Storing business hours

2016-08-29 Thread William Dunlap via R-help
The cummax(+-1) trick, along with findInterval(), is most useful for expanding a list of opening and closing times into a table which can be used to find the number of open shops at any given time. E.g., suppose your raw data comes from business hours posted on web sites: shopHours <- list(Butche

Re: [R] How to connect Microsoft Sql server from R studio using freeTDS instead of RODBC package

2016-08-29 Thread Mark Sharp
Manu, Read the first paragraph under section "1 ODBC Concepts" of https://cran.r-project.org/web/packages/RODBC/vignettes/RODBC.pdf. This describes the relationship among the various parts of the technical stack that allows connectivity to the database system via ODBC. One of the points made is

Re: [R] How to split a data.frame into its columns?

2016-08-29 Thread Marius Hofert
Hi David and Jeff, Thanks for your quick help, unclass() was precisely what I was looking for. Cheers, M On Mon, Aug 29, 2016 at 10:39 AM, aditya pant wrote: > > ^^ठश्रएइ),,, > > From: David Winsemius > Sent: ‎29-‎08-‎2016 11:59 > To: Marius Hofert > Cc: R-help

Re: [R] Hickman models with two binary dependent variables in R

2016-08-29 Thread Arne Henningsen
Dear Faradj On 27 August 2016 at 16:11, Faradj Koliev wrote: > It actually worked with heckit() command as well, do I need to use > selection()? I suggest that you use the selection() command/function only. heckit() is just a wrapper to selection() with the only difference that heckit() estimate

[R] How to connect Microsoft Sql server from R studio using freeTDS instead of RODBC package

2016-08-29 Thread Manohar Reddy
Hi, Can anyone guide me how to connect the Microsoft Sql server 2012/14 from R studio using freeTDS package instead of RODBC ,I can able to connect the MS Sql server from R studio using RODBC. Actually my requirement is I have developed webpage/report using Shiny package then I was deploye