Re: [R] ggplot2

2022-04-04 Thread David Winsemius



On 4/4/22 04:39, Ebert,Timothy Aaron wrote:

install.packages("ggplot2")



Depending on your OS, there might be a better chance of success with


install.packages("ggplot2", dependencies=TRUE)

The Linux install process doesn't need this but the binary install on MacOS or 
Windows may need this to prevent the sort of error message that was offered.

--
David


library(ggplot2)

An alternative
install.packages("tidyverse")
library(tidyverse)

The first only installs ggplot2. The alternative installs a bunch of other 
stuff as well.

Tim

-Original Message-
From: R-help  On Behalf Of Richard Vickery
Sent: Sunday, April 3, 2022 12:49 PM
To: R-help@r-project.org
Subject: [R] ggplot2

[External Email]

Hi there,

I am finally getting to some material I had problems with in university, where I was 
introduced to R - one of those that because of time constraints, I had challenges 
figuring out, particularly because I decided long ago on using Fedora Linux. The book, 
"Understanding Statistics Using R" by Andy Field et. al., says to install 
ggplot2 into R and the version of R that the dnf command installs will neigher install 
this package nor 'scales'. The result I get is below, and I attempted installing the 
packages via the tar command, and that neither worked, and I attempted
library("ggplot2") and R said the package was unavailable. What can I do to 
move forward?

Thanks,

Richard

 [[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 
https://urldefense.proofpoint.com/v2/url?u=https-3A__stat.ethz.ch_mailman_listinfo_r-2Dhelp=DwICAg=sJ6xIWYx-zLMB3EPkvcnVg=9PEhQh2kVeAsRzsn7AkP-g=7xEzNpsPEMvdQLIcBNo-VFJErGQIZfwF2ueg-0lesWT4DSOwIMyZ5deX1XUeO2R2=QTw5eQQCMPK5qxhL7YKJYRMJWwmPSDI4bR9Px8VJrvA=
PLEASE do read the posting guide 
https://urldefense.proofpoint.com/v2/url?u=http-3A__www.R-2Dproject.org_posting-2Dguide.html=DwICAg=sJ6xIWYx-zLMB3EPkvcnVg=9PEhQh2kVeAsRzsn7AkP-g=7xEzNpsPEMvdQLIcBNo-VFJErGQIZfwF2ueg-0lesWT4DSOwIMyZ5deX1XUeO2R2=0kmwSZfq16L-GtPuQa5mSO8VGqauae08iBxm57dPnKI=
and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] complicated time series filtering issue

2022-04-04 Thread Cade, Brian S via R-help
Hello:  I have an issue with filtering in a time series of animal growth data 
that seems conceptually simple but I have not come up with effective code to 
implement this.  I have temporal sequences of lengths by individuals and I want 
to retain only those data that are >10 days apart sequentially within an 
individuals records.  I can readily compute intervals between successive dates 
by individual using data.table() and its by = INDIVIDUAL functionality.  See 
example data for one individual below.  But what currently eludes me in 
processing this is how to recognize for example that deleting the 2nd and 3rd 
rows is required because the totality of their time interval is 9 days, 
deleting 8th record with 4 days is required,  deleting 17th record with 1 day 
is required, deleting 22nd and 23rd records is required because their sum is 2 
days, but we do not delete 24th record of 10 days because the sum of previous 2 
records deleted and this one is now 12 days.  Each individual can have very
  different patterns of these sort of sequences.  These sequences are easy to 
look at and determine what needs to be done but writing effective code to 
accomplish this filtering seems to require some functionality that I am 
currently missing.

Any suggestions would be greatly appreciated.

 Date   INDIVIDUAL DATENUMBER LENGTH length.prev interval
228 12-May-04 57084544133 682.4   NA   NA
229 28-Sep-04 57084544272 724.8682.4  139
230 30-Sep-04 57084544274 740.8724.82
231  7-Oct-04 57084544281 745.4740.87
232 22-Nov-04 57084544327 780.2745.4   46
233 27-Jan-05 57084544393 817.2780.2   66
234  8-Mar-05 57084544433 834.1817.2   40
235  2-Jul-05 57084544549 876.3834.1  116
236  6-Jul-05 57084544553 871.5876.34
237  4-Aug-05 57084544582 887.5871.5   29
238 28-Dec-05 57084544728 921.8887.5  146
239 31-Jan-06 57084544762 936.8921.8   34
240 27-Feb-06 57084544789 962.4936.8   27
241 21-Nov-06 57084544   1056 972.3962.4  267
242 30-Mar-07 57084544   11851007.2972.3  129
243 23-Apr-07 57084544   12091009.1   1007.2   24
244 22-May-07 57084544   1238 991.6   1009.1   29
245 23-May-07 57084544   12391015.9991.61
246 16-Jul-07 57084544   12931006.5   1015.9   54
247  9-Aug-07 57084544   13171013.0   1006.5   24
248 27-Aug-07 57084544   13351013.0   1013.0   18
249 29-Jul-08 57084544   16721021.5   1013.0  337
250 30-Jul-08 57084544   1673 984.3   1021.51
251 31-Jul-08 57084544   16741008.5984.31
252 10-Aug-08 57084544   16841002.8   1008.5   10
253 22-Oct-08 57084544   1757 977.6   1002.8   73
254  2-Dec-08 57084544   17981000.6977.6   41



Brian



Brian S. Cade, PhD

U. S. Geological Survey
Fort Collins Science Center
2150 Centre Ave., Bldg. C
Fort Collins, CO  80526-8818

email:  ca...@usgs.gov
tel:  970 226-9326


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.