[R] Extending my code: SOLVED

2019-02-14 Thread Ogbos Okike
Dear Jeff, I am alright now Please accept my indebtedness!!! Warmest regards Ogbos On Fri, Feb 15, 2019 at 8:25 AM Ogbos Okike wrote: > > Dear Jeff, > > Please hold. > It is begging to work. There was an error somewhere. One ")" is > missing and as I went back to check the lines one by one w

Re: [R] Extending my code

2019-02-14 Thread Ogbos Okike
Dear Jeff, Please hold. It is begging to work. There was an error somewhere. One ")" is missing and as I went back to check the lines one by one with cursor, I stubbed on non matching bracket. I completed, run the code again and got some result. Will get back to you once I am through. Thanks in

Re: [R] Extending my code

2019-02-14 Thread Ogbos Okike
Dear Jeff, Thank you so much. I ran the code but got an error message. I then try to run them line by line. The problem is in: dta$datetime <- with( dta, as.POSIXct(ISOdatetime(year, month,day,hour,0,0))) Error in with(dta, as.POSIXct(ISOdatetime(year, month, day, hour, 0, 0))) : object 'dta'

Re: [R] Extending my code

2019-02-14 Thread Jeff Newmiller
The Date class is not designed to handle time... you need to use the ISOdatetime function and convert to POSIXct instead of Date. Just be sure to set your timezone to some appropriate value before you convert any times into datetime types. Sys.setenv( TZ="GMT" ) # avoid using `data` as that is

[R] Extending my code

2019-02-14 Thread Ogbos Okike
Dear List, I have a simple code with which I convert year, month, and day to a date format. My data looks like: 67 01 2618464 67 01 2618472 67 01 2618408 67 01 2618360 67 01 2618328 67 01 2618320 67 01 2618296 while my code is: data <- read.table("CALG.txt", col.names

Re: [R] R help

2019-02-14 Thread Sarah Goslee
There's a bibtex parser for R: you could adapt that for your use, rather than trying to reinvent the equivalent tool. https://cran.r-project.org/web/packages/bibtex/index.html Sarah On Thu, Feb 14, 2019 at 5:57 PM Gouresh Kamble via R-help wrote: > > Dear to whom it may concern on the R team, >

Re: [R] Finding the Mean of a Specific Set of Columns

2019-02-14 Thread Isaac Barnhart
Thanks for the help! Isaac From: Marc Schwartz Sent: Thursday, February 14, 2019 11:05:23 AM To: Isaac Barnhart Cc: R-help Subject: Re: [R] Finding the Mean of a Specific Set of Columns On Feb 14, 2019, at 9:31 AM, Isaac Barnhart wrote: > > I am having troub

[R] R help

2019-02-14 Thread Gouresh Kamble via R-help
Dear to whom it may concern on the R team, I am having an issue with creating a code in which i can hold information such as the author of a paper, the year of publication, and the title. Also would like to add into this data frame a logical variable which would show some keywords I used to

Re: [R] POSIXlt class and lapply

2019-02-14 Thread William Dunlap via R-help
Somewhere between R-3.3.3 and R-3.5.2 a POSIXlt method for as.list() was added, and lapply probably calls as.list(). > RCompare(methods("as.list")) R version 3.3.3 (2017-03-06)| R version 3.5.1 (2018-07-02) [1] as.list.data.frame as.list.Date| [1] as.list.d

Re: [R] Finding the Mean of a Specific Set of Columns

2019-02-14 Thread Frederick Thielen
Hi, try library("dplyr") plot <- c(104, 104 ,104 ,104 ,104 ,105 ,105 ,105 ,105 ,105,106, 106,106, 106, 106,108, 108,108,108,108) lai <- c(82, 167, 248, 343, 377, 64, 139, 211, 296, 348, 94, 167,243,281,332,83, 382,320,146,129) leaf <- c(1,2, 3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5) d

[R] POSIXlt class and lapply

2019-02-14 Thread Newell, Paul
Dear R-helpers, We have recently upgraded from R-3.3.1 to R-3.5.2. It seems there has been a change in behaviour of `lapply` and the `POSIXlt` class that I cannot find explicitly documented. In R-3.3.1: > lapply(as.POSIXlt(Sys.Date()), length) $sec [1] 1 $min [1] 1 $hour [1] 1 $mday [1] 1 $mo

Re: [R] Finding the Mean of a Specific Set of Columns

2019-02-14 Thread Marc Schwartz via R-help
On Feb 14, 2019, at 9:31 AM, Isaac Barnhart wrote: > > I am having trouble finding the mean of a specific part of my dataset. Here > is a sample of it: > > plot lai leaf > 1 104 82 1 > 2 104 167 2 > 3 104 248 3 > 4 104 343 4 > 5 104 377 5 > 6 105 64 1 > 7 105 139 2 > 8 105 211 3 > 9 105 296 4 >

Re: [R] Finding the Mean of a Specific Set of Columns

2019-02-14 Thread Ben Tupper
Hi, You might try your hand at the tidyverse collection of tools which are veddy nice for this kind of wrangling. https://www.tidyverse.org/ Does this do the trick? ## START library(readr) library(dplyr) txt <- "row plot lai leaf 1 104 82 1 2 104 167 2 3 104 248 3 4 104 343 4 5 104 377 5 6 105

Re: [R] Finding the Mean of a Specific Set of Columns

2019-02-14 Thread Eric Berger
Hi Isaac, I am sure you will get lots of answers to this. Here is one using the dplyr package. Assuming that your data frame is called 'a', then library(dplyr) b <- dplyr::group_by(a,plot) %>% dplyr::summarise( mean(lai) ) b # A tibble: 4 x 2 plot `mean(lai)` 1 104243. 2 10

[R] Finding the Mean of a Specific Set of Columns

2019-02-14 Thread Isaac Barnhart
I am having trouble finding the mean of a specific part of my dataset. Here is a sample of it: plot lai leaf 1 104 82 1 2 104 167 2 3 104 248 3 4 104 343 4 5 104 377 5 6 105 64 1 7 105 139 2 8 105 211 3 9 105 296 4 10 105 348 5 11 106 94 1 12 106 167 2 13 106 243 3 14 106 281 4 15 106 332 5 16 10

Re: [R] R Data

2019-02-14 Thread Fowler, Mark
I am not sure I would use the word ‘accounted’, more like discounted (tossed out). From: Spencer Brackett Sent: February 14, 2019 9:21 AM To: Fowler, Mark Cc: R-help ; Sarah Goslee ; Caitlin Gibbons ; Jeff Newmiller Subject: Re: R Data Mr. Fowler, Thank you! This information is most helpfu

Re: [R] R Data

2019-02-14 Thread Spencer Brackett
Mr. Fowler, Thank you! This information is most helpful. So from my understanding, I can use the regression coefficients shown (via the coding I originally sent, to generate a continuous distribution with what is essentially a line of best fit? The data added here had some 30,000 variables (it is

Re: [R] pattern evaluation in electron microscopy images

2019-02-14 Thread PIKAL Petr
Hallo Steve. Thank you for pointing to ImageJ, I will try to inspect it. I expected that somebody in R comunity automated such procedure within some R package, but it is probably too specialised. S pozdravem | Best Regards RNDr. Petr PIKAL Vedoucí Výzkumu a vývoje | Research Manager PRECHEZA a.

Re: [R] R Data

2019-02-14 Thread Fowler, Mark
Hi Spencer, The an1 syntax is adding regression coefficients (or NAs where a regression could not be done) to the downloaded and processed data, which ends up a matrix. The cbind function adds the regression coefficients to the last column of the matrix (i.e. bind the columns of the inputs in t