Re: [R] Open netcdf file in linux

2018-09-17 Thread lily li
Thanks, you are right that the file path is not correct. I just typed: nc_open("file.nc"), and it gave the error above. On Tue, Sep 18, 2018 at 1:33 PM, Jeff Newmiller wrote: > I really don't know how you expect an answer when you don't show what you > did or pointed us to an example of a file t

Re: [R] Does R version 3.4.4 work on Ubuntu 18.04.1

2018-09-17 Thread Rui Barradas
Hello, I am not completely sure but I think I installed Ubuntu 18.04 LTS first and R 3.5 days later, so yes, if I'm right it is possible to run R 3.4 on 18.04. (You ask whether we can *install* R 3.4 on Ubuntu 18.04.1, I'm saying it can be *run* on Ubuntu 18.04.1.) Hope this helps, Rui Ba

[R] Does R version 3.4.4 work on Ubuntu 18.04.1

2018-09-17 Thread Ashim Kapoor
Dear All, I was reading this page ---> https://cran.r-project.org/bin/linux/ubuntu/README.html It says: R 3.4 packages for Ubuntu on i386 and amd64 are available for all stable Desktop releases of Ubuntu prior to Bionic Beaver (18.04) until their official end of life date. The page also shows ho

Re: [R] customizing the number of decimal places in xtable: RESOLVED

2018-09-17 Thread Ogbos Okike
Dear Jeff, Thank you please. I did search before but could not get it resolved. But with your query now, just typed ?xtable as key search word and the first document I opened gave an indication of digits. Without knowing what it was saying, I tried it in my data and it gave the result I have bee

Re: [R] Open netcdf file in linux

2018-09-17 Thread Jeff Newmiller
I really don't know how you expect an answer when you don't show what you did or pointed us to an example of a file that yields this error. My best blind guess is that you have not given the name of an ncdf file to the function. On September 17, 2018 9:44:45 PM PDT, lily li wrote: >Hi R users,

Re: [R] customizing the number of decimal places in xtable

2018-09-17 Thread Jeff Newmiller
Have you read ?xtable On September 17, 2018 7:24:37 PM PDT, Ogbos Okike wrote: >Dear Volunteers, > >I have a table involving many decimal places: >2005-01-04 -2.13339817688037 >2005-01-19 -6.86312349695117 >2005-01-22 -4.33662370554386 >2005-02-10 -1.40789214441639 >2005-02-13 -1.1334121785854

[R] Open netcdf file in linux

2018-09-17 Thread lily li
Hi R users, I have installed ncdf4 package in R from the linux terminal, but have met this problem when using nc_open to open a .nc file. What is the problem? Any help would be appreciated. Error in R_nc4_open: Is a directory [[alternative HTML version deleted]]

[R] customizing the number of decimal places in xtable

2018-09-17 Thread Ogbos Okike
Dear Volunteers, I have a table involving many decimal places: 2005-01-04 -2.13339817688037 2005-01-19 -6.86312349695117 2005-01-22 -4.33662370554386 2005-02-10 -1.40789214441639 2005-02-13 -1.1334121785854 2005-02-19 -1.28411233010119 2005-05-09 -1.6895978161324 2005-05-16 -3.07664523496947 2005-

[R] pdredge error

2018-09-17 Thread Art U
Hello, I'm trying to use parallel computing in MuMIn package. It worked a couple month ago, but now I'm getting the error. Here is a code: #Data x1 = rnorm(1000) x2 = rnorm(1000) x3 = rnorm(1000) z = 1 + 0.5*x1 - x2 pr = 1/(1+exp(-z)) y = rbinom(1000, 1, pr) dataD = cbind(y=y, x1=x1 ,x2=x2, x3=x3

Re: [R] makeCluster() hangs infinitely

2018-09-17 Thread Zhihao Huang
Hi Henrik, Thanks for the suggestions! I tried your approach, and obtained the following output, which is pretty similar to the previous ones. > cl <- future::makeClusterPSOCK(1, outfile = NULL, verbose = TRUE) *Workers: [n = 1] ‘localhost’* *Base port: 11214* *Creating node 1 of 1 ...* *- se

Re: [R] Unable to update R 3.4 to R 3.5 in Ubuntu 18.04 LTS

2018-09-17 Thread Michael Hannon
I didn't find an attached file, but I'm using Ubuntu 18.04 and have upgraded R to version 3.5. I don't recall exactly how I did the upgrade, but it must have been something like: https://www.digitalocean.com/community/tutorials/how-to-install-r-on-ubuntu-18-04-quickstart -- Mike $ cat /etc/os-r

Re: [R] Applying by() when groups have different lengths [RESOLVED]

2018-09-17 Thread Bert Gunter
" I did not pick up on by() doing the splitting for me when I read the help..." >From ?by: "A data frame is split by row into data frames subsetted by the values of one or more factors, and function FUN is applied to each subset in turn." I do not understand how it could be more clearly stated t

Re: [R] makeCluster() hangs infinitely

2018-09-17 Thread Henrik Bengtsson
On Mon, Sep 17, 2018 at 12:56 PM Zhihao Huang wrote: > > Hi Henrik, > > Thanks for the suggestions! I tried your approach, and obtained the following > output, which is pretty similar to the previous ones. > > > cl <- future::makeClusterPSOCK(1, outfile = NULL, verbose = TRUE) > Workers: [n = 1]

Re: [R] Applying by() when groups have different lengths

2018-09-17 Thread Rich Shepard
On Mon, 17 Sep 2018, Bert Gunter wrote: I cannot think of a way of proving a sample of data; if a sample for a Typo: s/proving/providing/ Rich __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/li

Re: [R] Applying by() when groups have different lengths

2018-09-17 Thread Bert Gunter
Inline. Bert On Mon, Sep 17, 2018 at 11:54 AM Rich Shepard wrote: >My dataframe has 113K rows split by a factor into 58 separate > data.frames, > with a different numbers of rows (see error output below). > >I cannot think of a way of proving a sample of data; if a sample for a > MWE

Re: [R] Applying by() when groups have different lengths [RESOLVED]

2018-09-17 Thread Rich Shepard
On Mon, 17 Sep 2018, MacQueen, Don wrote: I'm also going to guess that maybe your object rainfall_by_site has already been split into separate data frames (because of its name). But by() does the splitting internally, so you should be passing it the original unsplit data frame. Don, I did n

Re: [R] Applying by() when groups have different lengths

2018-09-17 Thread MacQueen, Don via R-help
I'm also going to guess that maybe your object rainfall_by_site has already been split into separate data frames (because of its name). But by() does the splitting internally, so you should be passing it the original unsplit data frame. You could supply example data by providing the first few

Re: [R] Applying by() when groups have different lengths

2018-09-17 Thread MacQueen, Don via R-help
Try changing it to by(rainfall_by_site, rainfall_by_site[, 'name'], function(x) {mean.rain <- mean(x[, 'prcp']) }) Inside the function, so to speak, the function sees an object named "x", because that's how the function is defined: function(x). So you have to operate on x inside

Re: [R] Applying by() when groups have different lengths

2018-09-17 Thread William Dunlap via R-help
> > by(rainfall_by_site, rainfall_by_site[, 'name'], function(x) { > + mean.rain <- mean(rainfall_by_site[, 'prcp']) + }) Note that you define a function of x which does not use x in it. Hence, even if the function gave a value, it would give the same value for each group. To see what the 'x' in

[R] Applying by() when groups have different lengths

2018-09-17 Thread Rich Shepard
My dataframe has 113K rows split by a factor into 58 separate data.frames, with a different numbers of rows (see error output below). I cannot think of a way of proving a sample of data; if a sample for a MWE is desired advice on produing one using dput() is needed. To summarize each group

Re: [R] Problem with lm.resid() when weights are provided

2018-09-17 Thread Fox, John
Dear Hamed, > -Original Message- > From: Hamed Ha [mailto:hamedhas...@gmail.com] > Sent: Monday, September 17, 2018 3:56 AM > To: Fox, John > Cc: r-help@r-project.org > Subject: Re: [R] Problem with lm.resid() when weights are provided > > H i John, > > > Thank you for your reply. > >

[R] Unable to update R 3.4 to R 3.5 in Ubuntu 18.04 LTS

2018-09-17 Thread RUPJYOTI DAS
Dear All, I am using R to carry out RNA-Seq workflow in my standalone machine which needs the latest R version >=3.5. I was trying to update firstly removing the R 3.4 and reinstalling from scratch again the latest version. Can anybody just guide me how to carry out the process as I am getting only

Re: [R] bootstrap sample for clustered data

2018-09-17 Thread Liu, Lei
Thanks for the help. My friend helped me and here is the solution: boot.cluster <- function(x, id){ boot.id <- sample(unique(id), replace=T) out <- lapply(1:length(boot.id), function(newid){cbind(x[id%in%boot.id[newid],],newid)}) return( do.call("rbind",out) ) } Lei -Original Message-

Re: [R] [FORGED] Re: Change the position of label when using R package eulerr

2018-09-17 Thread Aimin Yan
Yes, it does. Thank you. Aimin On Sun, Sep 16, 2018 at 11:00 PM Paul Murrell wrote: > Hi > > The 'x' component of the 't' grob that you get back from grid.get() is a > unit object, which you can subset and assign to a subset, for example > this code nudges the fourth label up and to the right 1

[R] constraints are inconsistent, no solution!

2018-09-17 Thread Maija Sirkjärvi
Hi! I'm solving a quadratic programming problem with some constraints. The problem is the second set of Amat conditions, which seem to be inconsistent, but I cannot see why. Do you have any idea, what could be the problem? Thanks in advance for your help! Maija for(j in 1:J){ hs[j] <-(-(gEst$

Re: [R] Help with setting locale

2018-09-17 Thread Ivan Krylov
On Sun, 16 Sep 2018 21:18:45 +0200 Kim Titcombe wrote: > I have Windows 10. English version. Do you have any other problems, besides the warning message at startup? According to MSDN[1], the combination of English language and Swiss cultural rules should be supported in Windows 10 >= v1607 with

Re: [R] Data.frame of Different Length

2018-09-17 Thread Ogbos Okike
Dear Jeff, Yours is like reciting A, B,C or 1, 2, 3 ... I am greatly relieved. Many thanks. Ogbos On Mon, Sep 17, 2018 at 9:07 AM Jeff Newmiller wrote: > There are many ways to combine data frames, but the method you have chosen > is extremely rare because you do not appear to be creating sen

Re: [R] Data.frame of Different Length

2018-09-17 Thread Jeff Newmiller
There are many ways to combine data frames, but the method you have chosen is extremely rare because you do not appear to be creating sensible relationships in the rows of the data frame, so your final result seems unlikely to be understandable by normal interpretation of tabular data. See ?merg

Re: [R] Problem with lm.resid() when weights are provided

2018-09-17 Thread Hamed Ha
H i John, Thank you for your reply. I see your point, thanks. I checked lm.wfit() and realised that there is a tol parameter that is already set to 10^-7. This is not even the half decimal to the machine precision. Furthermore, plying with tol parameter does not solve the problem, as far as I che

Re: [R] bootstrap sample for clustered data

2018-09-17 Thread Jeff Newmiller
You are telling us that the ID values in your data set indicate clusters. However you went about making that determination in the first place might be an obvious(?) way to do it again with your bootstrapped sample, ignoring the cluster assignments you have in place. This is the wrong place to ha

[R] Data.frame of Different Length

2018-09-17 Thread Ogbos Okike
Dear Contributors, I have two data frame of different column lengths. I am trying to have them in one data frame. Using A<-d1$date B<-d2$date a<-data.table(A )[ , I := .I][data.table(B )[ , I := .I], on = "I"] I got 1: 2005-01-04 1 2005-01-04 2: 2005-01-19 2 2005-01-19 3: 2005-01-22 3 2005-01