Re: [R] [R studio] Plotting of line chart for each columns at 1 page

2018-12-13 Thread Subhamitra Patra
Dear Sir,

The method you suggested for arranging multiple plots in 1 pdf page has
finally worked.

Thank you very much.

But, I have 3 more queries as follows.

1. Is there any way that I can merge the respective plots from the
different excel files into 1? For instance, I have 3 excel files (i.e. EMs
1, EMs 2 and EMs 3) having 4 plots each. I want to merge 1st plots from 3
excel files into 1, 2nd plots from 3 excel files into 1, similarly 3rd and
4th plots from each respective files into 1?
2. Is there any way to range the scale of Y-axis for all plots because I
think if the range of the Y-axis for each plot is same, it can be easy to
interpret and compare the results. I used Ylim function. But, after using
the Ylim function, the plot is looking unclear than before. For your
convenience, I am providing my code.

pdf("EMs.pdf",width=20,height=20)
par(mfrow=c(5,4))
# import your first sheet here (38 columns)
ncolumns<-ncol(EMs1)
for(i in 1:ncolumns)
  plot(EMs1[,i],type="l",col = "Red", xlab="Time",
   ylab="APEn", ylim=c(0.1,2), main=names(EMs1)[i])
library(zoo)
*APEn=zoo(EMs1, seq(from = as.Date("1994-01-01"), to =
as.Date("2017-08-03"), by = 1))*
#import your second sheet here, (10 columns)
ncolumns<-ncol(EMs2)
for(i in 1:ncolumns)
  plot(EMs2[,i],type="l",col = "Red", xlab="Time",
   ylab="APEn",ylim=c(0.1,2), main=names(EMs2)[i])
*APEn=zoo(EMs2, seq(from = as.Date("1994-01-01"), to =
as.Date("2017-08-03"), by = 1))*
# import your Third sheet here, (2 columns)
ncolumns<-ncol(EMs3)
for(i in 1:ncolumns)
  plot(EMs3[,i],type="l",col = "Red", xlab="Time",
   ylab="APEn", ylim=c(0.1,2), main=names(EMs3)[i])
*APEn=zoo(EMs3, seq(from = as.Date("1996-01-01"), to =
as.Date("2017-08-03"), by = 1))  *
# finish plotting
dev.off()

3. I want the corresponding date column (which is the daily date) on X-axis
of each plot. Thus, I added 1 line after the plot in the above (i.e. the
bold line). Please suggest me Is it the correct way that I am doing?


Sir, I am new in R and doing by learning.

Kindly suggest me regarding my previous queries for which I shall be always
grateful to you.

Thank you very much for educating a new R learner.




On Wed, Nov 21, 2018 at 3:20 PM Subhamitra Patra 
wrote:

> Thank you very much for your suggestions and help.
>
> [image: Mailtrack]
> 
>  Sender
> notified by
> Mailtrack
> 
>  11/21/18,
> 3:19:55 PM
>
> On Wed, Nov 21, 2018 at 3:09 PM Subhamitra Patra <
> subhamitra.pa...@gmail.com> wrote:
>
>> OK, Sir.  I will try as per your suggestions.
>>
>> Thank you very much for your kind help.
>>
>> [image: Mailtrack]
>> 
>>  Sender
>> notified by
>> Mailtrack
>> 
>>  11/21/18,
>> 3:07:47 PM
>>
>> On Wed, Nov 21, 2018 at 2:41 PM Jim Lemon  wrote:
>>
>>> 1. xaxt="n" means "Don't display the X axis". See the help for "par" in
>>> the graphics package
>>>
>>> 2. axis(1,at=1:nrows,labels=names(MPG3))
>>> This means, "Display the bottom axis (1) with ticks at 1 to the number
>>> of rows in the data frame"
>>> "Use the values of MPG$Year as labels for the ticks". see the help for
>>> "axis" in the graphics package
>>> Note that this should be in the same loop as "plot"
>>>
>>> Now I can see that my guess at the structure of the data was wrong. What
>>> you could do is to collapse the daily records into the means for the years.
>>> As I don't know what your spreadsheet looks like, I could only guess a
>>> method for this.
>>>
>>> You seem to be saying that you plot all 5655 values, but you want the
>>> axis to show just the years.Rather than tell you to convert your data to a
>>> time series, I'll suggest a quick hack.
>>>
>>> axis(1,at=seq(1,5655,by=365),labels=1994:2014)
>>>
>>> This _may_ work for you. I offer it because I can see that you do not
>>> have a lot of experience in R and you want to get the job done. If you
>>> can't get it to work, I apologize and you can blamelessly move to something
>>> else.
>>>
>>> Jim
>>>
>>> PS - If you don't know how to start HTML help - help.start()
>>>
>>> On Wed, Nov 21, 2018 at 7:26 PM Subhamitra Patra <
>>> subhamitra.pa...@gmail.com> wrote:
>>>
  Sir, in the bold portion of the below code, I have some confusion
 which I am mentioning below that

 "ylab="MPG",main=names(MPG3)[i],*xaxt="n"*)
  axis(*1*,at=1:nrows,*labels=MPG3$Year*)"

 1. Here, what *xaxt="n"* indicates? I think it indicates the no. of
 rows, right?
 2. 1 in the 2nd line represents the no. of graphs. Let suppose, 38
 plots are having the same row, I need to mention them as *axis(38,
 at=1:nrows)*, right?
 3. *labels=**MPG3$Year *will give the name of all years in the X-axis,
 right?


[R] [R studio] How to define date column and plot that date column as x axis in R studio

2018-12-13 Thread Subhamitra Patra
 Dear R users,

I have half-hourly time series data; 48 data points in a day. The total
time period starts from 4/6/2018 (i.e day/month/year) to 2/12/2018. I want
to create a time series object. I am using ts function.

However, I am unable to define the frequency. As I know, frequency=1 for
yearly data, but unable to define in my half-hourly data.

After creating a time series object (i.e. date column), I want to plot it
with the corresponding data series.

How to plot my result (in R object) on Y-axis and time period on the
X-axis? For your convenience, I am providing my code as follows.

R <- function(x){
return(FDWhittle(x, method="discrete", sdf.method="multitaper"))
}
plot(R[,i],type="l",col = "Black", xlab="Time",
   ylab="Return",main=names(R)[,i])

When I am plotting by using the above code, the results in the object "R"
is coming on the Y-axis, and some values like (100, 200, 300) are
coming on the X-axis. I want to get the time period on my X axis, but
unable to define the intra-day date column having 48 data points in a day.

Further, kindly suggest me what can be the frequency level for defining the
date column of the daily data?

A kind help is highly appreciated.

Thanks in advance.


-- 
*Best Regards,*
*Subhamitra Patra*
*Phd. Research Scholar*
*Department of Humanities and Social Sciences*
*Indian Institute of Technology, Kharagpur*
*INDIA*

[[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.


[R] Quoting smooth random terms mccv::gam

2018-12-13 Thread Smith, Desmond
Dear All,

I have a mgcv::gam model of the form:

m1 <- gam(Y ~ A + s(B, bs = "re"), data = dataframe, family = gaussian, method 
= "REML")

The random term is quoted in summary(m1) as, for example,

Approximate significance of smooth terms:
   # edf Ref.df  F p-value
s(B)  4.486  5 97.195 6.7e-08 ***

My question is, how would I quote this result (statistic and P value) in a 
formal document?

For example, one possibility is F[4.486,5] = 97.195, P = 6.7e-08. However, 
arguing against this, “reverse engineering” of the result using

pf(q= 97.195, df1= 4.486, df2= 5, lower.tail=FALSE)

gives an incorrect p value:

[1] 0.1435508

I would be very grateful for your advice. Many thanks for your help!



UCLA HEALTH SCIENCES IMPORTANT WARNING: This email (and any attachments) is 
only intended for the use of the person or entity to which it is addressed, and 
may contain information that is privileged and confidential. You, the 
recipient, are obligated to maintain it in a safe, secure and confidential 
manner. Unauthorized redisclosure or failure to maintain confidentiality may 
subject you to federal and state penalties. If you are not the intended 
recipient, please immediately notify us by return email, and delete this 
message from your computer.

[[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.


[R] fortune nomination WAS:Re: help

2018-12-13 Thread Berry, Charles


"You need Santa Claus not r-help."

in response to an unrealistic and poorly posed request for help.

Best,

Chuck

> On Dec 13, 2018, at 11:12 AM, David L Carlson  wrote:
> 
> You need Santa Claus not r-help. You haven't given us a fraction of the 
> information we would need to help. You don't show us your code. You don't 
> tell us where the information is coming from except "today's date." You don't 
> tell us what data you want. You don't seem to know the difference between R 
> and R-Studio.
> 
> 
> David L Carlson
> Department of Anthropology
> Texas A University
> College Station, TX 77843-4352
> 
> 
> -Original Message-
> From: R-help  On Behalf Of Miller, Shawn
> Sent: Thursday, December 13, 2018 11:29 AM
> To: R-help@r-project.org
> Subject: [R] help
> 
> Need help with R studio. Code is to pull data from todays date plus 5 years 4 
> months from now. I am missing the last 3 months of data. Can you please help?
> 
> Shawn Miller | Aquatic Biologist II | Assessment Section
> Environmental Protection | Clean Water
> Rachel Carson State Office Building
> 400 Market Street | Harrisburg, PA 17101
> Phone: 717.772.2185 | Fax: 717.772.3249
> www.depweb.state.pa.us
> 
> 
>   [[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.
> 

__
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.


Re: [R] [External] RE: help

2018-12-13 Thread Miller, Shawn
Yes I confirmed all the dates I need are in the test.xlsx table. The 
final.2.xlsx table does not have the dates  for July, August, September.

-Original Message-
From: David L Carlson [mailto:dcarl...@tamu.edu] 
Sent: Thursday, December 13, 2018 2:33 PM
To: Miller, Shawn 
Cc: R-help@r-project.org
Subject: RE: [External] RE: help

Use Reply-All to keep the thread on the list.

If the most recent WQN SIS Data Download table is 14June2018_WQN_Data_Download, 
does it contain any data for the months July, August, September, October, 
November, December? After extracting the data you create the file 
"Anti-deg_requests/test.xlsx". Have you confirmed that all of the dates you 
need are present in that file?


David L Carlson
Department of Anthropology
Texas A University
College Station, TX 77843-4352

-Original Message-
From: Miller, Shawn 
Sent: Thursday, December 13, 2018 1:15 PM
To: David L Carlson 
Subject: RE: [External] RE: help

setwd("c:/users/shawnmille/Desktop/Anti-deg_requests/")

library(plyr)
library(reshape2)
library(RODBC)
library(dplyr)



## MAKE SURE YOU ARE USING THE 32-bit VERSION OF R (See Tools>Global 
Options>General in RStudio to set this) ## READING DATA FROM EXISTING DATABASES 
(EXAMPLE: ACCESS 2010) chan <- odbcConnectAccess("WQN Datadumps.mdb")

# Show list of tables in database
sqlTables(chan,tableType='TABLE')
# Fetch the most recent WQN SIS Data Download table, this takes a couple 
minutes allwqn <- 
sqlFetch(chan,'14June2018_WQN_Data_Download',stringsAsFactors=FALSE)
names(allwqn)
## subset to the desired fields and values, choose your WQN by modifying command

wqn.specific <- subset(allwqn,MONITORING_POINT_ALIAS_ID 
=='WQN0735',select=c('DATE_COLLECTED','MONITORING_POINT_ALIAS_ID','QUALITY_ASSURANCE_TYPE_DESC',

  
'TEST_CODE','TEST_SHORT_DESC','READING_INDICATOR_CODE','FINAL_AMOUNT','ABBREVIATION'))
  

###VIEW ENTIRE DATASET, this coding can be used to view any created datasets in 
excel#
library(xlsx)
write.xlsx(wqn.specific,"c:/users/shawnmille/Desktop/Anti-deg_requests/test.xlsx")
 

###VIEW ENTIRE DATASET#

# FOR ACTIVE WQN STATION GET TODAY'S DATE and date of 5 years ago + 4 months or 
put in last date in command# today <- Sys.Date()
TODAY.5<-today-1949
## Select data where DATA_COLLECTED >= TODAY.5## wqn.specific$DATE_COLLECTED <- 
as.Date(wqn.specific$DATE_COLLECTED ,"%m/%d/%y") wqn.last5yrs <- 
subset(wqn.specific,DATE_COLLECTED >= TODAY.5, 
select=c('DATE_COLLECTED','MONITORING_POINT_ALIAS_ID','QUALITY_ASSURANCE_TYPE_DESC','TEST_CODE','TEST_SHORT_DESC','READING_INDICATOR_CODE','FINAL_AMOUNT','ABBREVIATION'))


#OR FOR INACTIVE WQN STATION ENTER THE LAST DATE OF RECORD BELOW AND GET PAST 5 
YEARS OF DATA IN SUBSET# lastdate <- as.Date("11/01/2010", format = "%m/%d/%Y") 
firstdate <- lastdate-1949 wqn.specific$DATE_COLLECTED <- 
as.Date(wqn.specific$DATE_COLLECTED ,"%m/%d/%y") wqn.last5yrs <- 
subset(wqn.specific,DATE_COLLECTED >= firstdate & DATE_COLLECTED <= lastdate, 
select=c('DATE_COLLECTED','MONITORING_POINT_ALIAS_ID','QUALITY_ASSURANCE_TYPE_DESC','TEST_CODE','TEST_SHORT_DESC','READING_INDICATOR_CODE','FINAL_AMOUNT','ABBREVIATION'))

 Delete Blanks and QA column #
wqn.removeblanks 
<-subset(wqn.last5yrs,QUALITY_ASSURANCE_TYPE_DESC=="Duplicate"|is.na(QUALITY_ASSURANCE_TYPE_DESC),select=c('DATE_COLLECTED','MONITORING_POINT_ALIAS_ID',


'TEST_CODE','TEST_SHORT_DESC','READING_INDICATOR_CODE','FINAL_AMOUNT','ABBREVIATION'))
 Delete Null Results
wqn.removenull <- 
subset(wqn.removeblanks,FINAL_AMOUNT!="NA",select=c('DATE_COLLECTED','MONITORING_POINT_ALIAS_ID','TEST_CODE','TEST_SHORT_DESC','READING_INDICATOR_CODE','FINAL_AMOUNT','ABBREVIATION'))
 

### Remove non-relevant parameters 

wqn.removeparm <- subset(wqn.removenull,TEST_CODE!= "571"_CODE!="572"&
   TEST_CODE!="573"& TEST_CODE!="543"& 
TEST_CODE!="561"& TEST_CODE!="546"
 & TEST_CODE!="595"& TEST_CODE!="596"& 
TEST_CODE!="597"& TEST_CODE!="598"
 & TEST_CODE!="599"& TEST_CODE!="600"& 
TEST_CODE!="71946"& TEST_CODE!="71940"
 & TEST_CODE!="587"& TEST_CODE!="593"& 
TEST_CODE!="71939"& TEST_CODE!="71937"
 & TEST_CODE!="574"& TEST_CODE!="549"& 
TEST_CODE!="99014"& TEST_CODE!="547"
 & TEST_CODE!="298"& TEST_CODE!="551"& 
TEST_CODE!="71930"& TEST_CODE!="70508"
 & TEST_CODE!="564"& TEST_CODE!="709"& 
TEST_CODE!="111"& TEST_CODE!="592"
 & TEST_CODE!="MMTECMF"& TEST_CODE!="588"& 
TEST_CODE!="589"& TEST_CODE!="590"
 & TEST_CODE!="594"& TEST_CODE!="71936"& 
TEST_CODE!="71945"& TEST_CODE!="F00061"
 

Re: [R] Plotting Very Large lat-lon data in x-y axes graph

2018-12-13 Thread Jim Lemon
Hi Ogbos,
Back on the air after a few days off. I don't have your data ("QUERY
2"), but I think this will fix your problem.

library(maps)
map("world")
box()
library(plotrix)
color.legend(-180,-150,100,-130,legend=c(0,25000,5,75000,10),
 rect.col=color.scale(1:5,extremes=c("blue","red")),gradient="x")

Notice that I have swapped the "yb" and "yt" values so that they are
in increasing order. If they are reversed, the numbers will appear
within the color bar. Also you don't need to call color.gradient, just
pass the output of a five increment color scale from blue to red (or
whatever you like) to the rect.col argument.

Jim

__
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.


Re: [R] [External] RE: help

2018-12-13 Thread David L Carlson
OK. Follow the chain of subsets to figure out where the dates go missing.

Scanning the code I see the following subsets: wqn.last5yrs, wqn.removeblanks, 
wqn.removenull, wqn.removeparm, n.det, wqn.ph, wqn.noph. Use the range function 
to find out where the observations get dropped out. 

range(wqn.last5yrs$DATE_COLLECTED)

David C

-Original Message-
From: Miller, Shawn  
Sent: Thursday, December 13, 2018 1:42 PM
To: David L Carlson 
Cc: R-help@r-project.org
Subject: RE: [External] RE: help

Yes I confirmed all the dates I need are in the test.xlsx table. The 
final.2.xlsx table does not have the dates  for July, August, September.

-Original Message-
From: David L Carlson [mailto:dcarl...@tamu.edu] 
Sent: Thursday, December 13, 2018 2:33 PM
To: Miller, Shawn 
Cc: R-help@r-project.org
Subject: RE: [External] RE: help

Use Reply-All to keep the thread on the list.

If the most recent WQN SIS Data Download table is 14June2018_WQN_Data_Download, 
does it contain any data for the months July, August, September, October, 
November, December? After extracting the data you create the file 
"Anti-deg_requests/test.xlsx". Have you confirmed that all of the dates you 
need are present in that file?


David L Carlson
Department of Anthropology
Texas A University
College Station, TX 77843-4352

-Original Message-
From: Miller, Shawn 
Sent: Thursday, December 13, 2018 1:15 PM
To: David L Carlson 
Subject: RE: [External] RE: help

setwd("c:/users/shawnmille/Desktop/Anti-deg_requests/")

library(plyr)
library(reshape2)
library(RODBC)
library(dplyr)



## MAKE SURE YOU ARE USING THE 32-bit VERSION OF R (See Tools>Global 
Options>General in RStudio to set this) ## READING DATA FROM EXISTING DATABASES 
(EXAMPLE: ACCESS 2010) chan <- odbcConnectAccess("WQN Datadumps.mdb")

# Show list of tables in database
sqlTables(chan,tableType='TABLE')
# Fetch the most recent WQN SIS Data Download table, this takes a couple 
minutes allwqn <- 
sqlFetch(chan,'14June2018_WQN_Data_Download',stringsAsFactors=FALSE)
names(allwqn)
## subset to the desired fields and values, choose your WQN by modifying command

wqn.specific <- subset(allwqn,MONITORING_POINT_ALIAS_ID 
=='WQN0735',select=c('DATE_COLLECTED','MONITORING_POINT_ALIAS_ID','QUALITY_ASSURANCE_TYPE_DESC',

  
'TEST_CODE','TEST_SHORT_DESC','READING_INDICATOR_CODE','FINAL_AMOUNT','ABBREVIATION'))
  

###VIEW ENTIRE DATASET, this coding can be used to view any created datasets in 
excel#
library(xlsx)
write.xlsx(wqn.specific,"c:/users/shawnmille/Desktop/Anti-deg_requests/test.xlsx")
 

###VIEW ENTIRE DATASET#

# FOR ACTIVE WQN STATION GET TODAY'S DATE and date of 5 years ago + 4 months or 
put in last date in command# today <- Sys.Date()
TODAY.5<-today-1949
## Select data where DATA_COLLECTED >= TODAY.5## wqn.specific$DATE_COLLECTED <- 
as.Date(wqn.specific$DATE_COLLECTED ,"%m/%d/%y") wqn.last5yrs <- 
subset(wqn.specific,DATE_COLLECTED >= TODAY.5, 
select=c('DATE_COLLECTED','MONITORING_POINT_ALIAS_ID','QUALITY_ASSURANCE_TYPE_DESC','TEST_CODE','TEST_SHORT_DESC','READING_INDICATOR_CODE','FINAL_AMOUNT','ABBREVIATION'))


#OR FOR INACTIVE WQN STATION ENTER THE LAST DATE OF RECORD BELOW AND GET PAST 5 
YEARS OF DATA IN SUBSET# lastdate <- as.Date("11/01/2010", format = "%m/%d/%Y") 
firstdate <- lastdate-1949 wqn.specific$DATE_COLLECTED <- 
as.Date(wqn.specific$DATE_COLLECTED ,"%m/%d/%y") wqn.last5yrs <- 
subset(wqn.specific,DATE_COLLECTED >= firstdate & DATE_COLLECTED <= lastdate, 
select=c('DATE_COLLECTED','MONITORING_POINT_ALIAS_ID','QUALITY_ASSURANCE_TYPE_DESC','TEST_CODE','TEST_SHORT_DESC','READING_INDICATOR_CODE','FINAL_AMOUNT','ABBREVIATION'))

 Delete Blanks and QA column #
wqn.removeblanks 
<-subset(wqn.last5yrs,QUALITY_ASSURANCE_TYPE_DESC=="Duplicate"|is.na(QUALITY_ASSURANCE_TYPE_DESC),select=c('DATE_COLLECTED','MONITORING_POINT_ALIAS_ID',


'TEST_CODE','TEST_SHORT_DESC','READING_INDICATOR_CODE','FINAL_AMOUNT','ABBREVIATION'))
 Delete Null Results
wqn.removenull <- 
subset(wqn.removeblanks,FINAL_AMOUNT!="NA",select=c('DATE_COLLECTED','MONITORING_POINT_ALIAS_ID','TEST_CODE','TEST_SHORT_DESC','READING_INDICATOR_CODE','FINAL_AMOUNT','ABBREVIATION'))
 

### Remove non-relevant parameters 

wqn.removeparm <- subset(wqn.removenull,TEST_CODE!= "571"_CODE!="572"&
   TEST_CODE!="573"& TEST_CODE!="543"& 
TEST_CODE!="561"& TEST_CODE!="546"
 & TEST_CODE!="595"& TEST_CODE!="596"& 
TEST_CODE!="597"& TEST_CODE!="598"
 & TEST_CODE!="599"& TEST_CODE!="600"& 
TEST_CODE!="71946"& TEST_CODE!="71940"
 & TEST_CODE!="587"& TEST_CODE!="593"& 
TEST_CODE!="71939"& TEST_CODE!="71937"
   

Re: [R] [FORGED] Re: R plot split screen in uneven panels

2018-12-13 Thread Rolf Turner



On 12/14/18 1:44 AM, Luigi Marongiu wrote:


Thank you, that worked good. I tried to read the help for
layout/split.screen but I found it confusing.




Me too.  I conjecture that *everybody* finds it confusing, except maybe 
Paul M., and I'm not so sure about him! :-)


However it *is possible* to fight your way through the help. 
Experimenting is useful!  And when you succeed in fighting your way 
through, it works *well*.  (Not "good"!!!)


cheers,

Rolf Turner

--
Technical Editor ANZJS
Department of Statistics
University of Auckland
Phone: +64-9-373-7599 ext. 88276

__
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.


Re: [R] [External] RE: help

2018-12-13 Thread David L Carlson
Use Reply-All to keep the thread on the list.

If the most recent WQN SIS Data Download table is 14June2018_WQN_Data_Download, 
does it contain any data for the months July, August, September, October, 
November, December? After extracting the data you create the file 
"Anti-deg_requests/test.xlsx". Have you confirmed that all of the dates you 
need are present in that file?


David L Carlson
Department of Anthropology
Texas A University
College Station, TX 77843-4352

-Original Message-
From: Miller, Shawn  
Sent: Thursday, December 13, 2018 1:15 PM
To: David L Carlson 
Subject: RE: [External] RE: help

setwd("c:/users/shawnmille/Desktop/Anti-deg_requests/")

library(plyr)
library(reshape2)
library(RODBC)
library(dplyr)



## MAKE SURE YOU ARE USING THE 32-bit VERSION OF R (See Tools>Global 
Options>General in RStudio to set this)
## READING DATA FROM EXISTING DATABASES (EXAMPLE: ACCESS 2010)
chan <- odbcConnectAccess("WQN Datadumps.mdb")

# Show list of tables in database
sqlTables(chan,tableType='TABLE')
# Fetch the most recent WQN SIS Data Download table, this takes a couple minutes
allwqn <- sqlFetch(chan,'14June2018_WQN_Data_Download',stringsAsFactors=FALSE)
names(allwqn)
## subset to the desired fields and values, choose your WQN by modifying command

wqn.specific <- subset(allwqn,MONITORING_POINT_ALIAS_ID 
=='WQN0735',select=c('DATE_COLLECTED','MONITORING_POINT_ALIAS_ID','QUALITY_ASSURANCE_TYPE_DESC',

  
'TEST_CODE','TEST_SHORT_DESC','READING_INDICATOR_CODE','FINAL_AMOUNT','ABBREVIATION'))
  

###VIEW ENTIRE DATASET, this coding can be used to view any created datasets in 
excel#
library(xlsx)
write.xlsx(wqn.specific,"c:/users/shawnmille/Desktop/Anti-deg_requests/test.xlsx")
 

###VIEW ENTIRE DATASET#

# FOR ACTIVE WQN STATION GET TODAY'S DATE and date of 5 years ago + 4 months or 
put in last date in command#
today <- Sys.Date()
TODAY.5<-today-1949
## Select data where DATA_COLLECTED >= TODAY.5##
wqn.specific$DATE_COLLECTED <- as.Date(wqn.specific$DATE_COLLECTED ,"%m/%d/%y")
wqn.last5yrs <- subset(wqn.specific,DATE_COLLECTED >= TODAY.5, 
select=c('DATE_COLLECTED','MONITORING_POINT_ALIAS_ID','QUALITY_ASSURANCE_TYPE_DESC','TEST_CODE','TEST_SHORT_DESC','READING_INDICATOR_CODE','FINAL_AMOUNT','ABBREVIATION'))


#OR FOR INACTIVE WQN STATION ENTER THE LAST DATE OF RECORD BELOW AND GET PAST 5 
YEARS OF DATA IN SUBSET#
lastdate <- as.Date("11/01/2010", format = "%m/%d/%Y")
firstdate <- lastdate-1949
wqn.specific$DATE_COLLECTED <- as.Date(wqn.specific$DATE_COLLECTED ,"%m/%d/%y")
wqn.last5yrs <- subset(wqn.specific,DATE_COLLECTED >= firstdate & 
DATE_COLLECTED <= lastdate, 
select=c('DATE_COLLECTED','MONITORING_POINT_ALIAS_ID','QUALITY_ASSURANCE_TYPE_DESC','TEST_CODE','TEST_SHORT_DESC','READING_INDICATOR_CODE','FINAL_AMOUNT','ABBREVIATION'))

 Delete Blanks and QA column #
wqn.removeblanks 
<-subset(wqn.last5yrs,QUALITY_ASSURANCE_TYPE_DESC=="Duplicate"|is.na(QUALITY_ASSURANCE_TYPE_DESC),select=c('DATE_COLLECTED','MONITORING_POINT_ALIAS_ID',


'TEST_CODE','TEST_SHORT_DESC','READING_INDICATOR_CODE','FINAL_AMOUNT','ABBREVIATION'))
 
 Delete Null Results
wqn.removenull <- 
subset(wqn.removeblanks,FINAL_AMOUNT!="NA",select=c('DATE_COLLECTED','MONITORING_POINT_ALIAS_ID','TEST_CODE','TEST_SHORT_DESC','READING_INDICATOR_CODE','FINAL_AMOUNT','ABBREVIATION'))
 

### Remove non-relevant parameters 

wqn.removeparm <- subset(wqn.removenull,TEST_CODE!= "571"_CODE!="572"&
   TEST_CODE!="573"& TEST_CODE!="543"& 
TEST_CODE!="561"& TEST_CODE!="546"
 & TEST_CODE!="595"& TEST_CODE!="596"& 
TEST_CODE!="597"& TEST_CODE!="598"
 & TEST_CODE!="599"& TEST_CODE!="600"& 
TEST_CODE!="71946"& TEST_CODE!="71940"
 & TEST_CODE!="587"& TEST_CODE!="593"& 
TEST_CODE!="71939"& TEST_CODE!="71937"
 & TEST_CODE!="574"& TEST_CODE!="549"& 
TEST_CODE!="99014"& TEST_CODE!="547"
 & TEST_CODE!="298"& TEST_CODE!="551"& 
TEST_CODE!="71930"& TEST_CODE!="70508"
 & TEST_CODE!="564"& TEST_CODE!="709"& 
TEST_CODE!="111"& TEST_CODE!="592"
 & TEST_CODE!="MMTECMF"& TEST_CODE!="588"& 
TEST_CODE!="589"& TEST_CODE!="590"
 & TEST_CODE!="594"& TEST_CODE!="71936"& 
TEST_CODE!="71945"& TEST_CODE!="F00061"
 & TEST_CODE!="71947"& TEST_CODE!="555",
 
select=c('DATE_COLLECTED','MONITORING_POINT_ALIAS_ID','TEST_CODE','TEST_SHORT_DESC','READING_INDICATOR_CODE','FINAL_AMOUNT','ABBREVIATION'))

###  Combine test codes that are measuring the same analyte, format testcode to 
include first 5 digits###



Re: [R] help

2018-12-13 Thread David L Carlson
You need Santa Claus not r-help. You haven't given us a fraction of the 
information we would need to help. You don't show us your code. You don't tell 
us where the information is coming from except "today's date." You don't tell 
us what data you want. You don't seem to know the difference between R and 
R-Studio.


David L Carlson
Department of Anthropology
Texas A University
College Station, TX 77843-4352


-Original Message-
From: R-help  On Behalf Of Miller, Shawn
Sent: Thursday, December 13, 2018 11:29 AM
To: R-help@r-project.org
Subject: [R] help

Need help with R studio. Code is to pull data from todays date plus 5 years 4 
months from now. I am missing the last 3 months of data. Can you please help?

Shawn Miller | Aquatic Biologist II | Assessment Section
Environmental Protection | Clean Water
Rachel Carson State Office Building
400 Market Street | Harrisburg, PA 17101
Phone: 717.772.2185 | Fax: 717.772.3249
www.depweb.state.pa.us


[[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.

__
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

2018-12-13 Thread Miller, Shawn
Need help with R studio. Code is to pull data from todays date plus 5 years 4 
months from now. I am missing the last 3 months of data. Can you please help?

Shawn Miller | Aquatic Biologist II | Assessment Section
Environmental Protection | Clean Water
Rachel Carson State Office Building
400 Market Street | Harrisburg, PA 17101
Phone: 717.772.2185 | Fax: 717.772.3249
www.depweb.state.pa.us


[[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.


Re: [R] In need of TCGA Workflow to identify portion expression

2018-12-13 Thread Sarah Goslee
Spencer, you will find far more knowledgeable help on the Bioconductor
mailing list.

But here's a starting poing:
https://www.bioconductor.org/packages/release/workflows/html/TCGAWorkflow.html

Sarah
On Thu, Dec 13, 2018 at 8:01 AM Spencer Brackett
 wrote:
>
> Good morning,
>
>   I am looking for a workflow compatible with a TCGA file, and one that can
> essentially identify the protein expression involved with TMZ-induced MGMT
> methylation. Any advice or information that could lead me to finding such a
> workflow would be greatly appreciated!
>
> Best,
>
> Spencer Brackett
>

-- 
Sarah Goslee (she/her)
http://www.numberwright.com

__
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] In need of TCGA Workflow to identify portion expression

2018-12-13 Thread Spencer Brackett
Good morning,

  I am looking for a workflow compatible with a TCGA file, and one that can
essentially identify the protein expression involved with TMZ-induced MGMT
methylation. Any advice or information that could lead me to finding such a
workflow would be greatly appreciated!

Best,

Spencer Brackett

[[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.


Re: [R] R plot split screen in uneven panels

2018-12-13 Thread Luigi Marongiu
Thank you, that worked good. I tried to read the help for
layout/split.screen but I found it confusing.
On Wed, Dec 12, 2018 at 5:51 PM Bert Gunter  wrote:
>
> Incidentally, here is another way to do what (I think) you asked using 
> layout():
>
> m <- matrix(c(1,2,2), nrow =1)
> layout(m)
> plot(1:10, type = "p",main = "The First Plot")
> plot(10:1, type = "l", main ="The Second Plot")
>
> On my device, the plots use different size fonts, point sizes, etc. and so 
> aesthetically differ. I do not know why and am too lazy to delve into the 
> code.
>
> Bert Gunter
>
> "The trouble with having an open mind is that people keep coming along and 
> sticking things into it."
> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>
>
> On Wed, Dec 12, 2018 at 8:39 AM Bert Gunter  wrote:
>>
>> ?layout
>> Please read the Help file **carefully** and work through the **examples**. I 
>> cannot explain better than they.
>> Here is code using layout() that I think does what you want:
>>
>> m <- matrix(1:2, nrow =1)
>> layout(m, widths = c(1,2))
>> plot(1:10, type = "p",main = "The First Plot")
>> plot(10:1, type = "l", main ="The Second Plot")
>>
>> Note that both the lattice package and ggplot2 can also do this sort of 
>> thing much more flexibly(and therefore requiring more effort to learn).
>>
>> Cheers,
>> Bert
>>
>>
>> Bert Gunter
>>
>> "The trouble with having an open mind is that people keep coming along and 
>> sticking things into it."
>> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>>
>>
>> On Wed, Dec 12, 2018 at 7:19 AM Luigi Marongiu  
>> wrote:
>>>
>>> Dear all,
>>> I would like to draw two plots in the same device so that there is a
>>> single row and two columns, with the first column being 1/3 of the
>>> device's width.
>>> I am creating a PNG object with width = 30 and height = 20 cm.
>>> I know that I should use split.screen or layout but I am lost with the
>>> matrix to pass to the functions.
>>> For istance, I tried:
>>> # distance in arbitrary units (so let's say cm) from of corners
>>> # left, right, bottom, and top counting from bottom left corner
>>> # that is first panel has the bottom right corner 20 cm from the bottom 
>>> left?
>>> > m = matrix(c(0,20,40,0, 20,60,40,0), byrow=T, ncol=4)
>>> > m
>>>  [,1] [,2] [,3] [,4]
>>> [1,]0   20   400
>>> [2,]   20   60   400
>>> > split.screen(m)
>>> Error in par(split.screens[[cur.screen]]) :
>>>   invalid value specified for graphical parameter "fig"
>>> > m[1,]
>>> [1]  0 20 40  0
>>> > split.screen(m[1,])
>>> Error in split.screen(m[1, ]) : 'figs' must specify at least one screen
>>>
>>> What should be the syntax for this task?
>>>
>>> --
>>> Best regards,
>>> Luigi
>>>
>>> __
>>> 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.



-- 
Best regards,
Luigi

__
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.


Re: [R] R plot split screen in uneven panels

2018-12-13 Thread Martin Maechler
> Bert Gunter 
> on Wed, 12 Dec 2018 08:51:04 -0800 writes:

> Incidentally, here is another way to do what (I think) you asked using
> layout():

> m <- matrix(c(1,2,2), nrow =1)
> layout(m)
> plot(1:10, type = "p", main ="The First Plot")
> plot(10:1, type = "l", main ="The Second Plot")

> On my device, the plots use different size fonts, point sizes, etc. and so
> aesthetically differ. 

Really? -- Not at all for me [Linux default device =
X11(type="cairo")], where all these are identical on the left
and the right plot.

Such behavior seems like a bogous graphics device  or
bogous interaction with underlying libraries or ??

> I do not know why and am too lazy to delve into the code.
> Bert Gunter

Can you at least tell us a bit more, e.g.

  dev.capabilities()
?

Best, Martin

__
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] Visualizing contrasts for lmer models

2018-12-13 Thread Witold E Wolski
Hello,

Is there an R-package which implements visualizations of estimated
coefficients and the data for lmer models similar to those shown here:

http://genomicsclass.github.io/book/pages/interactions_and_contrasts.html
in sections:

Examining the estimated coefficients
(ideally with ggplot)

???

I find these visualizations (especially those for contrasts) very
helpful but despite R -package searches I failed to find a generic
implementation.

best regards
Witek

Witold Eryk Wolski

__
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-es] Random Forest con poca "n" y muchos predictores

2018-12-13 Thread Gemma Ruiz-Olalla
Hola,

Me he iniciado hace poco en Machine Learning, y tengo una duda sobre mis
conjuntos de datos: el primero tiene 37 variables explicativas y 116
instancias, y el segundo, 140 variables explicativas y 195 instancias. El
primero lo veo bien, ya que hay 3 veces más casos que variables
explicativas, pero creo que el segundo caso puede suponer un problema al
haber casi el mismo número de predictores que de casos, verdad?

Para "arreglar" esto (en un Random Forest), tendría sentido hacer iterar el
train() unas 50-100 veces? Ir guardando estos modelos
resultantes (entrenados) en una lista, para luego hacer una especie de
promedio con ellos, y éste resultante (sus parámetros ntree y mtry) usarlo
para generar el modelo randomForest() definitivo.

Tiene sentido, o qué podría hacer si no?

Muchas gracias!

-- 
Gemma Ruiz-Olalla
gemma.ruizola...@gmail.com

[[alternative HTML version deleted]]

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


Re: [R] R and factorytalk historian

2018-12-13 Thread PIKAL Petr
Hi

Yes, there should not be any problem with transfering data from Excel to R.

However my trust to Excel is not big, therefore I wanted to avoid such 
unnecessary intermediate step. But according to FTH lecturers they do not know 
about any option for direct export to csv or other suitable data format.

It seems that nobody has experience with direct connection FTH to R, so I would 
like to thank all for their answers and I would consider this topic closed.

Cheers
Petr

> -Original Message-
> From: R-help  On Behalf Of Hasan Diwan
> Sent: Wednesday, December 12, 2018 8:21 PM
> To: R Project Help 
> Subject: Re: [R] R and factorytalk historian
>
> Could you not script Excel to export automatically to CSV --
> https://stackoverflow.com/a/10803229/783412, for example -- and import the
> result into R? -- H
>
> On Wed, 12 Dec 2018 at 07:17, PIKAL Petr  wrote:
>
> > Hi
> >
> > Well, the final answer is that data from FTH could be transfered to
> > other software **only** through Excel.
> >
> > Regarding RetroEncabulator, readings could be enahanced by extensive
> > and elaborate use of nanoputian molecules chained together.
> >
> > Cheers
> > Petr
> >
> > > -Original Message-
> > > From: Viechtbauer, Wolfgang (SP)
> > > 
> > > Sent: Wednesday, December 12, 2018 11:21 AM
> > > To: PIKAL Petr ; r-help
> > > 
> > > Subject: RE: R and factorytalk historian
> > >
> > > Dear Petr,
> > >
> > > Sorry, no experience with the FTH, but related to this, has anybody
> > gotten R to
> > > interface nicely with the Retro Encabulator, providing live read
> > > outs of
> > the
> > > synchronizing cardinal grammeters?
> > >
> > > (my apologies, I just couldn't resist)
> > >
> > > Best,
> > > Wolfgang
> > >
> > > >-Original Message-
> > > >From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of
> > > >PIKAL Petr
> > > >Sent: Tuesday, 11 December, 2018 16:09
> > > >To: r-help
> > > >Subject: [R] R and factorytalk historian
> > > >
> > > >Hallo all
> > > >
> > > >Does anybody know if R could be used directly with FactoryTalk
> > > >Historian programme from Rockwell automation.
> > > >
> > > >It is probably possible to use Excel as interface but I would
> > > >prefer not to.
> > > >
> > > >Best regards.
> > > >
> > > >Petr Pikal
> > Osobní údaje: Informace o zpracování a ochraně osobních údajů
> > obchodních partnerů PRECHEZA a.s. jsou zveřejněny na:
> > https://www.precheza.cz/zasady-ochrany-osobnich-udaju/ | Information
> > about processing and protection of business partner’s personal data
> > are available on website:
> > https://www.precheza.cz/en/personal-data-protection-principles/
> > Důvěrnost: Tento e-mail a jakékoliv k němu připojené dokumenty jsou
> > důvěrné a podléhají tomuto právně závaznému prohláąení o vyloučení
> > odpovědnosti: https://www.precheza.cz/01-dovetek/ | This email and any
> > documents attached to it may be confidential and are subject to the
> > legally binding disclaimer: https://www.precheza.cz/en/01-disclaimer/
> >
> > __
> > 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.
> >
>
>
> --
> OpenPGP:
> https://sks-keyservers.net/pks/lookup?op=get=0xFEBAD7FFD041BBA1
> If you wish to request my time, please do so using
> *bit.ly/hd1AppointmentRequest *.
> Si vous voudrais faire connnaisance, allez a *bit.ly/hd1AppointmentRequest
> *.
>
>  keyservers.net/pks/lookup?op=get=0xFEBAD7FFD041BBA1>Sent
> from my mobile device
> Envoye de mon portable
>
> [[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.
Osobní údaje: Informace o zpracování a ochraně osobních údajů obchodních 
partnerů PRECHEZA a.s. jsou zveřejněny na: 
https://www.precheza.cz/zasady-ochrany-osobnich-udaju/ | Information about 
processing and protection of business partner’s personal data are available on 
website: https://www.precheza.cz/en/personal-data-protection-principles/
Důvěrnost: Tento e-mail a jakékoliv k němu připojené dokumenty jsou důvěrné a 
podléhají tomuto právně závaznému prohláąení o vyloučení odpovědnosti: 
https://www.precheza.cz/01-dovetek/ | This email and any documents attached to 
it may be confidential and are subject to the legally binding disclaimer: 
https://www.precheza.cz/en/01-disclaimer/

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see