Re: [R] Analysing diallel and line x tester mating design with multiple location in R

2019-03-29 Thread David Luckett
Hi Gbemisola,
You can find functions for diallel analysis (Griffing and Hayman) and
LxT analysis in several R packages:
agricolae (on CRAN),
DiallelAnalysisR (on CRAN),
plantbreeding (on R-forge), and
AGD-R (on the CIMMYT website; a front-end built on R).

If these are not enough (!) you could try other stand-alone software,
such as: PBTOOLS, GENES, QGAStation, TNAUSTAT, ICRISAT Genstat
scripts, GSCA (not free), or Dial98.

HTH, Cheers
David Luckett
djluck...@gmail.com
0408 750 703

__
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] Quantile Density Contours

2019-03-29 Thread Bernard Comcast
Thanks Abs - I was able to get the plot I needed with the hdrcde package but I 
will check out your package as well.

I continue to be impressed with the power Of R and the various packages 
available.

Thanks again


Bernard
Sent from my iPhone so please excuse the spelling!"

> On Mar 29, 2019, at 8:51 PM, Abs Spurdle  wrote:
> 
> My R package, "probhat", provides plots of bivariate PDFs and bivariate CDFs, 
> using kernel smoothing.
> Note that there is no bivariate quantile function, as such.
> 
> Here's the vignette:
> https://cran.r-project.org/web/packages/probhat/vignettes/probhat.pdf
> 
> This contains examples.
> 
> Note that I'm not subscribed to this mailing list.
> (Maybe I will subscribe).
> And I had difficulty reading the email addresses from the archive page.
> 

[[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] Structuring data for Correspondence Analysis

2019-03-29 Thread jim holtman
I am not familiar with SAS, so what did you want your output to look like.
There is the 'table' function that might do the job and then there is
always 'dplyr' which can do the hard stuff.  So we need more information on
what you want.

Jim Holtman
*Data Munger Guru*


*What is the problem that you are trying to solve?Tell me what you want to
do, not how you want to do it.*


On Fri, Mar 29, 2019 at 6:35 AM Alfredo 
wrote:

> Hi, I am very new to r and need help from you to do a correspondence
> analysis because I don't know how to structure the following data:
>
> Thank you.
>
> Alfredo
>
>
>
> library(ca,lib.loc=folder)
>
> table <- read.csv(file="C:\\Temp\\Survey_Data.csv", header=TRUE, sep=",")
>
> head (table, n=20)
>
> Preference   SexAge   Time
>
> 1   News/Info/Talk M  25-30  06-09
>
> 2Classical F  >3509-12
>
> 3  Rock and Top 40 F  21-25  12-13
>
> 4 Jazz M  >3513-16
>
> 5   News/Info/Talk F  25-30  16-18
>
> 6 Don't listen F  30-35  18-20
>
> ...
>
> 19 Rock and Top 40 M  25-30  16-18
>
> 20  Easy Listening F  >3518-20
>
>
>
> In SAS I would simply do this:
>
> proc corresp data=table dim=2 outc=_coord;
>
>table Preference, Sex Age Time;
>
> run;
>
>
>
> I don't know how convert in R a data frame to a frequency table to execute
> properly this function:
>
> ca <- ca(, graph=FALSE)
>
>
> [[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.
>

[[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] aggregate output to data frame

2019-03-29 Thread jim holtman
You can also use 'dplyr'

library(tidyverse)
result <- pcr %>%
  group_by(Gene, Type, Rep) %>%
  summarise(mean = mean(Ct),
   sd = sd(Ct),
   oth = sd(Ct) / sqrt(sd(Ct))
  )

Jim Holtman
*Data Munger Guru*


*What is the problem that you are trying to solve?Tell me what you want to
do, not how you want to do it.*


On Wed, Mar 27, 2019 at 7:40 PM Jim Lemon  wrote:

> Hi Cyrus,
> Try this:
>
> pcr<-data.frame(Ct=runif(66,10,20),Gene=rep(LETTERS[1:22],3),
>  Type=rep(c("Std","Unkn"),33),Rep=rep(1:3,each=22))
> testagg<-aggregate(pcr$Ct,c(pcr["Gene"],pcr["Type"],pcr["Rep"]),
>  FUN=function(x){c(mean(x), sd(x), sd(x)/sqrt(sd(x)))})
> nxcol<-dim(testagg$x)[2]
> newxs<-paste("x",1:nxcol,sep="")
> for(col in 1:nxcol)
>  testagg[[newxs[col]]]<-testagg$x[,col]
> testagg$x<-NULL
>
> Jim
>
> On Thu, Mar 28, 2019 at 12:39 PM cir p via R-help 
> wrote:
> >
> > Dear users,
> > i am trying to summarize data using "aggregate" with the following
> command:
> >
> >
> aggregate(pcr$Ct,c(pcr["Gene"],pcr["Type"],pcr["Rep"]),FUN=function(x){c(mean(x),
> sd(x), sd(x)/sqrt(sd(x)))})
> >
> > and the structure of the resulting data frame is
> >
> > 'data.frame':66 obs. of  4 variables:
> > $ Gene: Factor w/ 22 levels "14-3-3e","Act5C",..: 1 2 3 4 5 6 7 8 9 10
> ...
> > $ Type: Factor w/ 2 levels "Std","Unkn": 2 2 2 2 2 2 2 2 2 2 ...
> > $ Rep : int  1 1 1 1 1 1 1 1 1 1 ...
> >  $ x   : num [1:66, 1:3] 16.3 16.7 18.2 17.1 18.6 ...
> >
> > The actual data is "bundled" in a matrix $x of the data frame. I would
> like to have the columns of this matrix as individual numeric columns in
> the same data frame instead of a matrix, but cant really figure it out how
> to do this in an efficient way. Could someone help me with the construction
> of this?
> >
> > Thanks a lot,
> >
> > Cyrus
> >
> > __
> > 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.
>

[[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] converting a character string to an object name

2019-03-29 Thread Jeff Newmiller
Seconded!

On March 29, 2019 11:33:01 AM PDT, Rui Barradas  wrote:
>Hello,
>
>I recommend you save them all in a list. It's a much better idea than
>to 
>have length(names(wb)) objects in the globalenv.
>Something like the following would read them all in one go.
>
>xls_list <- lapply(seq_along(names(wb))[-1], function(i){
> read.xlsx(wb, sheet = i)
>})
>
>names(xls_list) <- gsub(" ", "_", names(wb)[-1])
>
>
>Then, you can process the list members with the *apply() functions, as
>in
>
>result_list <- lapply(xls_list, some_function, arg2, arg3)
>
>The first function argument is the sheet, arg2, etc, would be other 
>function arguments.
>
>Hope this helps,
>
>Rui Barradas
>
>Às 13:07 de 29/03/2019, Assa Yeroslaviz escreveu:
>> I am trying to automate the way i read my tables. I have an Excel
>sheet I'm
>> reading using openxlsx package. The sheet contains over 30 sheets, i
>would
>> like to save each of them as separate objects.
>> 
>> my workflow for now is as such:
>> 
>> wb <- loadWorkbook(xlsxFile =
>"Output/Up_Down_Regulated_Gene_Lists.xlsx")
>> NAMES <- gsub(pattern = " ", replacement = "_", x = names(wb))
>> [1] "KO1_vs._WT_up""KO2_vs._WT_down"  "KO3_vs._WT_up"
>> "KO1_vs._WT_down"  "KO2_vs._WT_up" ...
>> for (i in 2:length(names(wb)) ){
>>tmp <- read.xlsx(wb, sheet = i)
>> 
>> ... Here I would like to have each sheet read in and sacved as a
>separate
>> data.frame.
>> 
>> }
>> 
>> Is there a way to read for each sheet the name from names(wb) and
>convert
>> it to a name for the object?
>> 
>> something like this
>> The object  KO1_vs._WT_up will save the first sheet with the same
>name
>> The object  KO2_vs._WT_down will save the second sheet.
>> etc.
>> 
>> Any ideas?
>> 
>> thanks
>> Assa
>> 
>>  [[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.

-- 
Sent from my phone. Please excuse my brevity.

__
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] converting a character string to an object name

2019-03-29 Thread Rui Barradas

Hello,

I recommend you save them all in a list. It's a much better idea than to 
have length(names(wb)) objects in the globalenv.

Something like the following would read them all in one go.

xls_list <- lapply(seq_along(names(wb))[-1], function(i){
read.xlsx(wb, sheet = i)
})

names(xls_list) <- gsub(" ", "_", names(wb)[-1])


Then, you can process the list members with the *apply() functions, as in

result_list <- lapply(xls_list, some_function, arg2, arg3)

The first function argument is the sheet, arg2, etc, would be other 
function arguments.


Hope this helps,

Rui Barradas

Às 13:07 de 29/03/2019, Assa Yeroslaviz escreveu:

I am trying to automate the way i read my tables. I have an Excel sheet I'm
reading using openxlsx package. The sheet contains over 30 sheets, i would
like to save each of them as separate objects.

my workflow for now is as such:

wb <- loadWorkbook(xlsxFile = "Output/Up_Down_Regulated_Gene_Lists.xlsx")
NAMES <- gsub(pattern = " ", replacement = "_", x = names(wb))
[1] "KO1_vs._WT_up""KO2_vs._WT_down"  "KO3_vs._WT_up"
"KO1_vs._WT_down"  "KO2_vs._WT_up" ...
for (i in 2:length(names(wb)) ){
   tmp <- read.xlsx(wb, sheet = i)

... Here I would like to have each sheet read in and sacved as a separate
data.frame.

}

Is there a way to read for each sheet the name from names(wb) and convert
it to a name for the object?

something like this
The object  KO1_vs._WT_up will save the first sheet with the same name
The object  KO2_vs._WT_down will save the second sheet.
etc.

Any ideas?

thanks
Assa

[[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-es] Problemas para trabajar en R con proxy

2019-03-29 Thread Pablo
Buenas tardes,

Tengo poblemas para poder instalar paquetes con 'devtools::install_github'
y también para utilizar funciones que descargan información desde la web
('getbb', del paquete osmdata, por ejemplo).

Al intentar utilizar estas funciones desde la computadora del trabajo me
surgen errores como:

> poligono <- getbb('poligono', +  format_out = 
> "sf_polygon")Error in curl::curl_fetch_memory(url, handle = handle) :
  Timeout was reached: Connection timed out after 1 milliseconds

o

> devtools::install_github('rindec/eph')Error in curl::curl_fetch_memory(url, 
> handle = h) :
  Unsupported proxy 'https:// username:pasword@proxy:port', libcurl is
built without the HTTPS-proxy support.


Intenté definir el proxy de antemano aunque sin éxito.
¿Alguien tuvo alguna experiencia semejante o alguna forma de resolverlo?

Saludos y muchas gracias de antemano,
Pablo.

[[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] converting a character string to an object name

2019-03-29 Thread Bert Gunter
I think you want ?assign


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 Fri, Mar 29, 2019 at 10:39 AM Assa Yeroslaviz  wrote:

> I am trying to automate the way i read my tables. I have an Excel sheet I'm
> reading using openxlsx package. The sheet contains over 30 sheets, i would
> like to save each of them as separate objects.
>
> my workflow for now is as such:
>
> wb <- loadWorkbook(xlsxFile = "Output/Up_Down_Regulated_Gene_Lists.xlsx")
> NAMES <- gsub(pattern = " ", replacement = "_", x = names(wb))
> [1] "KO1_vs._WT_up""KO2_vs._WT_down"  "KO3_vs._WT_up"
> "KO1_vs._WT_down"  "KO2_vs._WT_up" ...
> for (i in 2:length(names(wb)) ){
>   tmp <- read.xlsx(wb, sheet = i)
>
> ... Here I would like to have each sheet read in and sacved as a separate
> data.frame.
>
> }
>
> Is there a way to read for each sheet the name from names(wb) and convert
> it to a name for the object?
>
> something like this
> The object  KO1_vs._WT_up will save the first sheet with the same name
> The object  KO2_vs._WT_down will save the second sheet.
> etc.
>
> Any ideas?
>
> thanks
> Assa
>
> [[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.
>

[[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] converting a character string to an object name

2019-03-29 Thread Ivan Krylov
On Fri, 29 Mar 2019 14:07:16 +0100
Assa Yeroslaviz  wrote:

> Is there a way to read for each sheet the name from names(wb) and
> convert it to a name for the object?

See `get` and `assign` functions for a way to use strings as object
names. Generally, it might not be a good idea to do that (what if your
spreadsheet contains a sheet named `c` or `q`, or `data.frame`?).

If you want to save yourself some typing, consider using `with` or
`within`, though they suffer from similar problems.

-- 
Best regards,
Ivan

__
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] converting a character string to an object name

2019-03-29 Thread Assa Yeroslaviz
I am trying to automate the way i read my tables. I have an Excel sheet I'm
reading using openxlsx package. The sheet contains over 30 sheets, i would
like to save each of them as separate objects.

my workflow for now is as such:

wb <- loadWorkbook(xlsxFile = "Output/Up_Down_Regulated_Gene_Lists.xlsx")
NAMES <- gsub(pattern = " ", replacement = "_", x = names(wb))
[1] "KO1_vs._WT_up""KO2_vs._WT_down"  "KO3_vs._WT_up"
"KO1_vs._WT_down"  "KO2_vs._WT_up" ...
for (i in 2:length(names(wb)) ){
  tmp <- read.xlsx(wb, sheet = i)

... Here I would like to have each sheet read in and sacved as a separate
data.frame.

}

Is there a way to read for each sheet the name from names(wb) and convert
it to a name for the object?

something like this
The object  KO1_vs._WT_up will save the first sheet with the same name
The object  KO2_vs._WT_down will save the second sheet.
etc.

Any ideas?

thanks
Assa

[[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] Error while using keras package

2019-03-29 Thread Baki UNAL via R-help
Hello
I successfully installed keras and TensorFlow backend with install_keras(). I 
attached the installation log as keras_install_log.txt. After that I tried to 
download mnist data with dataset_mnist() function. However I got the following 
error message:
#
> library(keras)
> mnist <- dataset_mnist()
Using TensorFlow backend.
Error: ImportError: Traceback (most recent call last):
  File 
"C:\Users\user\MINICO~1\envs\R-TENS~1\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py",
 line 14, in swig_import_helper    return importlib.import_module(mname)
  File "C:\Users\user\MINICO~1\envs\R-TENS~1\lib\importlib\__init__.py", line 
126, in import_module    return _bootstrap._gcd_import(name[level:], package, 
level)
  File "", line 994, in _gcd_import
  File "", line 971, in _find_and_load
  File "", line 955, in _find_and_load_unlocked
  File "", line 658, in _load_unlocked
  File "", line 571, in module_from_spec
  File "", line 922, in create_module
  File "", line 219, in _call_with_frames_removed
ImportError: DLL load failed with error code -1073741795

During handling of the above exce
#---

I also attached the error message as error_message.txt
How can I fix this problem.
Thanks

> library(keras)
> install_keras()
Creating r-tensorflow conda environment for TensorFlow installation...
Fetching package metadata .
Solving package specifications: .

Package plan for installation in environment 
C:\Users\user\MINICO~1\envs\r-tensorflow:

The following NEW packages will be INSTALLED:

certifi:2019.3.9-py36_0   
pip:19.0.3-py36_0 
python: 3.6.8-h9f7ef89_7  
setuptools: 40.8.0-py36_0 
sqlite: 3.27.2-he774522_0 
vc: 14.1-h0510ff6_4   
vs2015_runtime: 14.15.26706-h3a45250_0
wheel:  0.33.1-py36_0 
wincertstore:   0.2-py36h7fe50ca_0

vs2015_runtime 100% |###| Time: 0:00:05 394.52 kB/s
vc-14.1-h0510f 100% |###| Time: 0:00:00 687.53 kB/s
sqlite-3.27.2- 100% |###| Time: 0:00:02 408.91 kB/s
python-3.6.8-h 100% |###| Time: 0:00:57 370.52 kB/s
certifi-2019.3 100% |###| Time: 0:00:00 463.10 kB/s
setuptools-40. 100% |###| Time: 0:00:01 438.73 kB/s
wheel-0.33.1-p 100% |###| Time: 0:00:00 493.57 kB/s
pip-19.0.3-py3 100% |###| Time: 0:00:04 404.28 kB/s
#
# To activate this environment, use:
# > activate r-tensorflow
#
# To deactivate an active environment, use:
# > deactivate
#
# * for power-users using bash, you must source
#

Fetching package metadata ...
Solving package specifications: .

Package plan for installation in environment 
C:\Users\user\MINICO~1\envs\r-tensorflow:

The following NEW packages will be INSTALLED:

absl-py: 0.7.1-py36_0  conda-forge
asn1crypto:  0.24.0-py36_1003  conda-forge
astor:   0.7.1-py_0conda-forge
blas:1.0-mkl  
ca-certificates: 2019.3.9-hecc5488_0   conda-forge
cffi:1.12.2-py36hb32ad35_1 conda-forge
chardet: 3.0.4-py36_1003   conda-forge
cryptography:2.5-py36h74b6da3_1conda-forge
freetype:2.10.0-h5db478b_0 conda-forge
gast:0.2.2-py_0conda-forge
grpcio:  1.16.0-py36hbb4b082_1000  conda-forge
h5py:2.9.0-nompi_py36h3cb27cb_1102 conda-forge
hdf5:1.10.4-nompi_hcc15c50_1106conda-forge
icc_rt:  2019.0.0-h0cc432a_1  
idna:2.8-py36_1000 conda-forge
intel-openmp:2019.3-203   
jpeg:9c-hfa6e2cd_1001  conda-forge
keras:   2.2.4-py36_0  conda-forge
keras-applications:  1.0.4-py_1conda-forge
keras-preprocessing: 1.0.2-py_1conda-forge
libblas: 3.8.0-4_mkl   conda-forge
libcblas:3.8.0-4_mkl   conda-forge
libgpuarray: 0.7.6-hfa6e2cd_1003   conda-forge
liblapack:   3.8.0-4_mkl   conda-forge
libpng:  1.6.36-h7602738_1000  conda-forge
libprotobuf: 3.7.0-h1a1b453_2  conda-forge
libtiff: 

[R] Structuring data for Correspondence Analysis

2019-03-29 Thread Alfredo
Hi, I am very new to r and need help from you to do a correspondence
analysis because I don't know how to structure the following data:

Thank you.

Alfredo

 

library(ca,lib.loc=folder)

table <- read.csv(file="C:\\Temp\\Survey_Data.csv", header=TRUE, sep=",")

head (table, n=20)

Preference   SexAge   Time

1   News/Info/Talk M  25-30  06-09

2Classical F  >3509-12

3  Rock and Top 40 F  21-25  12-13

4 Jazz M  >3513-16  

5   News/Info/Talk F  25-30  16-18

6 Don't listen F  30-35  18-20

...

19 Rock and Top 40 M  25-30  16-18

20  Easy Listening F  >3518-20

 

In SAS I would simply do this:

proc corresp data=table dim=2 outc=_coord;

   table Preference, Sex Age Time;

run;

 

I don't know how convert in R a data frame to a frequency table to execute
properly this function:

ca <- ca(, graph=FALSE)


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