Re: [R] dput( list(,..) ) could be improved

2016-01-05 Thread Martin Maechler
> > On Jan 4, 2016, at 11:17 PM, Lietz, Haiko wrote: > > > > hi all, > > > > when dputting a list of sparse matrices (Matrix package), the output does > > not contain the data but the information that the list contains sparse > > matrices. > > > > M <- sparseMatrix(i

Re: [R] R package built using newer version of R

2016-01-05 Thread Harrie Robins
If that fails (sometimes R gives a version error, package not available for R version X.X.X), you could try downloading the source package (package.tar.gz) and compile it with running from console (or prompt): R CMD INSTALL packagename.tar.gz library-location Regards, Harrie -Original

[R] Merging two data files based on common dates

2016-01-05 Thread Santosh.Aryal
Hello there Pardon my ignorance but, I have two data files with different series of dates and x and y values. There are common dates in both files. For example >datafile1 date1 xval 31/12/1982 20 1/01/198330 2/01/198340 3/01/198350

Re: [R] Merging two data files based on common dates

2016-01-05 Thread William Dunlap via R-help
You did not show the structure of your datasets (with, e.g., dump(c("datafile1","datafile2"),file=stdout())) nor what your call to merge() was. However, it may be that you did not use the by.x and by.y arguments to merge() to specify which columns to match. txt1 <- "date1

[R] store results from loop into a dataframe

2016-01-05 Thread DIGHE, NILESH [AG/2362]
Dear R users: I am trying to create a function that will loop over three dependent variables in my aov model, and then get the HSD.test for each variable. I like to store the results from each loop in a data frame. When I run my function (funx) on my data (dat), results from only yield gets

Re: [R] store results from loop into a dataframe

2016-01-05 Thread DIGHE, NILESH [AG/2362]
Sarah: Thanks for pointing out the errors in my function. Below are the errors I am getting after I run the corrected quote: Error in if (s) { : missing value where TRUE/FALSE needed In addition: Warning message: In qtukey(1 - alpha, ntr, DFerror) : NaNs produced You are right, I have no idea to

Re: [R] Equality of factor levels problem

2016-01-05 Thread Martín Cañón
Thank you, Sarah. This works just fine. So simple. I didn't know I had to change the factor to character before making the comparison. Regards, Mart�n [[alternative HTML version deleted]] __

Re: [R] Equality of factor levels problem

2016-01-05 Thread Sarah Goslee
You want to compare the values of the levels, I think? What about: > as.character(dat$var1) == as.character(dat$var2) [1] TRUE FALSE TRUE FALSE FALSE Sarah On Tue, Jan 5, 2016 at 10:58 AM, Martín Cañón wrote: > Hi to all useRs on the list. > > I want to know if there

Re: [R] store results from loop into a dataframe

2016-01-05 Thread Sarah Goslee
Leaving aside the question of whether this is the best way to approach your problem (unlikely), there's a couple of errors in your code involving indexing. Once fixed, the code demonstrates some errors in your use of HSD.test that will be harder for you to deal with. Thanks for the complete

[R] Equality of factor levels problem

2016-01-05 Thread Martín Cañón
Hi to all useRs on the list. I want to know if there is a function in R which evaluates if observations of two factors (similar but with unequal levels) in a data frame are equal at row level. Example of dataset: var1 <- c(1, 2, 3, 2, 1) var2 <- c(1, 3, 3, 4, 2) dat <- data.frame(var1, var2)

Re: [R] Subsetting a square marix

2016-01-05 Thread Sarah Goslee
It really isn't clear what you want, and posting in HTML has mangled what you did provide. Please use dput() to provide sample data, and give us a clear idea of what you want, ideally an example of what the output should look like. Adding the R code you've tried to use is also a good idea. Sarah

[R] Subsetting a square marix

2016-01-05 Thread Tawanda Tarakini
I have a global matrix (e.g. table below) of species feeding. I am trying to create specific matrix for specific sites. If for example a subset is to have sp1, sp3 and spp only these 3 species should be appearing in the subset (both column and rows). I have been checking online help but I seem

Re: [R] Merging two data files based on common dates

2016-01-05 Thread Sarah Goslee
Since the date columns have different names, you need to specify the by.x and by.y arguments to merge(). Other than that, it should work. If you need more help, please use dput() to provide some of your data, and include both the code you used and the error message or incorrect result you got

Re: [R] R package built using newer version of R

2016-01-05 Thread Marc Schwartz
Hi, You appear to have downloaded and attempted to install the '.zip' version of the package, which is the pre-built Windows **binary** version of the package. As Harrie noted below, you want to download the '.tar.gz' version of the package, which is the "source" version. Regards, Marc

Re: [R] Subsetting a square marix

2016-01-05 Thread David L Carlson
Assuming I've reconstructed your data correctly: > dta Sp1 Sp2 Sp3 Sp4 Sp5 Sp6 Sp1 0 1 0 0 0 0 Sp2 0 0 0 1 0 0 Sp3 1 0 0 0 1 0 Sp4 0 0 1 1 0 1 Sp5 0 1 0 0 0 1 Sp6 0 0 0 0 0 0 > dput(dta) structure(list(Sp1 = c(0L, 0L, 1L,

Re: [R] store results from loop into a dataframe

2016-01-05 Thread Sarah Goslee
If you run each variable individually, you'll discover that the NAs in your data are causing problems. It's up to you to figure out what the best way to handle those missing values for your research is. Sarah On Tue, Jan 5, 2016 at 12:39 PM, DIGHE, NILESH [AG/2362]

Re: [R] R package built using newer version of R

2016-01-05 Thread Tyler Auerbeck
When I run the install.packages("rj",type="source") I get the following: > install.packages("rj",type="source") Warning message: package ‘rj’ is not available (for R version 2.15.1) I believe this is because this is a package available directly from the creators of StatET. I tried pulling the

Re: [R] store results from loop into a dataframe

2016-01-05 Thread DIGHE, NILESH [AG/2362]
Sarah: Thanks a lot for taking time to guide me to the right direction. I now see how the missing data is causing the problem. Thanks again! Nilesh -Original Message- From: Sarah Goslee [mailto:sarah.gos...@gmail.com] Sent: Tuesday, January 05, 2016 12:13 PM To: DIGHE, NILESH

Re: [R] R package built using newer version of R

2016-01-05 Thread David Winsemius
> On Jan 5, 2016, at 11:15 AM, Tyler Auerbeck wrote: > > When I run the install.packages("rj",type="source") I get the following: > >> install.packages("rj",type="source") > Warning message: > package ‘rj’ is not available (for R version 2.15.1) > > I believe this is

[R] Bezier to line segments

2016-01-05 Thread Adrian Dușa
Dear All, I am interested into transforming Bezier curves (or general splines) to a series of line segments. For simplicity, the Bezier curves are either cubic (arches, no inflection points) or they have at most one inflection point. The entry parameters are exactly four points (with x and y

Re: [R] R package built using newer version of R

2016-01-05 Thread Tyler Auerbeck
Alright, I believe I'm making some progress. I'm now running into the following error. As I mentioned, I'm new to this whole process, so this may be something simple. When I run the following: R.exe CMD INSTALL rj_2.0.3-1.tar.gz I get the following error: C:\users\admin\> R.exe CMD INSTALL

Re: [R] R package built using newer version of R

2016-01-05 Thread Tyler Auerbeck
We can go ahead and ignore that last email. It looks like I had just configured Rtools incorrectly. Once I resolved that issue I was able to get this compiled appropriately. Thanks to everyone for the help! On Wed, Jan 6, 2016 at 1:34 AM, Tyler Auerbeck wrote: > Alright, I

Re: [R] (no subject)

2016-01-05 Thread Dimitri Liakhovitski
Jean and Dennis, thank you so much for your solutions! They are super-fast, thanks a lot! Happy new year! Dimitri On Thu, Dec 24, 2015 at 2:50 PM, Adams, Jean wrote: > Excellent job providing example data and a desired result. > > This code works on the example you provided.

Re: [R] SNG uz malo regresije

2016-01-05 Thread Petar Milin
> On Jan 5, 2016, at 12:01 PM, Bojana Dinic wrote: > > najpre, srecna Nova godina i sve najbolje tbi i tvojoj porodici. Nadam se da > ces se za praznike lepo odmoriti. > Mene su vec zadesile neke obaveze, pa sam htela da te pitam da li znas neki > paket, makro,

[R] R Course in Dublin (February 3rd-5th)

2016-01-05 Thread Antony Unwin
The course will be given by Louis Aslett (Oxford University, author of the packages PhaseType and ReliabilityTheory) and Antony Unwin (author of the book “Graphical Data Analysis with R” CRC Press 2015). Details at http://insightsc.ie/training/r-statistical-software/