Re: [R] Steps to create spatial plots

2018-01-16 Thread lily li
Hi Eric,

Thanks, it works. If I want to convert the matrix to the 1-D vector for the
levelplot, should I use the command below? I thought the t() is a reverse
function, but may be not.

values <- layer$z
values.v <- as.vector(t(values))

On Tue, Jan 16, 2018 at 12:36 AM, Eric Berger  wrote:

> If layer$z is a matrix and you want to reverse the order of the rows, you
> can do:
>
> n <- nrow(layer$z)
> layer$z <- layer$z[ n:1, ]
>
> HTH,
> Eric
>
>
> On Tue, Jan 16, 2018 at 8:43 AM, lily li  wrote:
>
>> Sorry for the emails, I just wanted to have an example.
>> layer$z
>>
>> 1  1  3  4  6  2
>> 2  3  4  1  2  9
>> 1  4  5  2  1  8
>>
>> How to convert the matrix to layer$z = c(1, 4, 5, 2, 1, 8, 2, 3, 4, 1, 2,
>> 9, 1, 1, 3, 4, 6, 2)?
>> I think this vector is the order that levelplot can use. Thanks again.
>>
>>
>> On Mon, Jan 15, 2018 at 10:58 PM, lily li  wrote:
>>
>> > Hi Bert,
>> >
>> > I think you are correct that I can use levelplot, but I have a question
>> > about converting data. For example, the statement:
>> > levelplot(Z~X*Y), Z is row-wise from the lower left corner to the upper
>> > right corner.
>> > My dataset just have gridded Z data as a txt file (or can be called
>> > matrix?), how to convert them to the vector in order for levelplot to
>> use?
>> > Thanks.
>> >
>> > On Mon, Jan 15, 2018 at 6:04 PM, Bert Gunter 
>> > wrote:
>> >
>> >> From your description, I am **guessing** that you may not want a
>> "spatial
>> >> map" (including projections) at all, but rather something like a level
>> >> plot. See ?levelplot in the lattice package for details. Both I am sure
>> >> ggplot2 has something similar.
>> >>
>> >> Apologies if I havemisunderstood your intent/specifications.
>> >>
>> >> 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 Mon, Jan 15, 2018 at 4:54 PM, lily li  wrote:
>> >>
>> >>> Hi Roman,
>> >>>
>> >>> Thanks for your reply. For the spatial coordinates layer, I just have
>> >>> coordinates of the upper left corner, numbers of rows and columns of
>> the
>> >>> spatial map, and grid cell size. How to create a spatial layer of
>> >>> coordinates from this data? Thanks.
>> >>>
>> >>>
>> >>> On Mon, Jan 15, 2018 at 3:26 PM, Roman Luštrik <
>> roman.lust...@gmail.com>
>> >>> wrote:
>> >>>
>> >>> > You will need to coerce your data into a "spatial" kind, as
>> >>> implemented in
>> >>> > `sp` or as of late, `sf` packages. You might want to give the
>> >>> vignettes a
>> >>> > whirl before you proceed.
>> >>> > Roughly, you will have to coerce the data to Spatial* (you could go
>> >>> for a
>> >>> > point, raster or grid type, I think) and also specify the
>> projection.
>> >>> Once
>> >>> > you have that, plotting should be handled by packages.
>> >>> >
>> >>> > Here are a few quick links that might come handy:
>> >>> >
>> >>> > https://cran.r-project.org/web/views/Spatial.html
>> >>> > http://www.datacarpentry.org/R-spatial-raster-vector-
>> >>> > lesson/10-vector-csv-to-shapefile-in-r/
>> >>> >
>> >>> >
>> >>> > Cheers,
>> >>> > Roman
>> >>> >
>> >>> > On Mon, Jan 15, 2018 at 11:22 PM, lily li 
>> wrote:
>> >>> >
>> >>> >> Hi users,
>> >>> >>
>> >>> >> I have no clear clue about plotting spatial data. For example, I
>> just
>> >>> >> have a table with attribute values of each grid cell, such as
>> >>> elevation.
>> >>> >> Then I have coordinates of the upper left corner in UTM, the number
>> >>> of rows
>> >>> >> and columns, and grid cell size. How to create spatial plot of
>> >>> elevations
>> >>> >> for the grid cells, in color ramp? Should I create a spatial grid
>> >>> layer
>> >>> >> with all the polygons first? Thanks.
>> >>> >>
>> >>> >> --
>> >>> >> --
>> >>> >> You received this message because you are subscribed to the ggplot2
>> >>> >> mailing list.
>> >>> >> Please provide a reproducible example:
>> https://github.com/hadley/devt
>> >>> >> ools/wiki/Reproducibility
>> >>> >>
>> >>> >> To post: email ggpl...@googlegroups.com
>> >>> >> To unsubscribe: email ggplot2+unsubscr...@googlegroups.com
>> >>> >> More options: http://groups.google.com/group/ggplot2
>> >>> >>
>> >>> >> ---
>> >>> >> You received this message because you are subscribed to the Google
>> >>> Groups
>> >>> >> "ggplot2" group.
>> >>> >> To unsubscribe from this group and stop receiving emails from it,
>> >>> send an
>> >>> >> email to ggplot2+unsubscr...@googlegroups.com.
>> >>> >> For more options, visit https://groups.google.com/d/optout.
>> >>> >>
>> >>> >
>> >>> >
>> >>> >
>> >>> > --
>> >>> > In God we trust, all others bring data.
>> >>> >
>> >>>
>> >>> [[alternative HTML version deleted]]
>> >>>
>> >>> __
>> >>> 

Re: [R] Merging RData files

2018-01-16 Thread Henrik Bengtsson
To expand on what Bert suggests.  Use:

loadToEnv <- function(file, ..., envir = new.env()) {
  base::load(file = file, envir = envir, ...)
}

envA <- loadToEnv("a.RData")
envB <- loadToEnv("b.RData")

and then access the objects in environments envA and envB using
environment access methods, e.g. ls(envir = envA), envA[[name]],
envA$foo, as.list(envA) [careful is large objects], ...

/H

On Tue, Jan 16, 2018 at 7:30 AM, Bert Gunter  wrote:
> ?load
>
> Read this carefully. Pay attention to its instructions re: overwriting
> existing objects.
>
> 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 Tue, Jan 16, 2018 at 12:43 AM, Steven Yen  wrote:
>
>> I ran two separate hours-long projects. Results of each were saved to
>> two separate .RData files.
>> Content of each includes, among others, the following:
>>
>> mese  t p sig
>> pc21.age0.640 0.219  2.918 0.004 ***
>> pc21.agesq  0.000 0.000NaN   NaN
>> pc21.inc0.903 0.103  8.752 0.000 ***
>> pc21.incsq  0.000 0.000NaN   NaN
>> pc21.sei10  0.451 0.145  3.122 0.002 ***
>> pc21.sblkprot  -4.334 3.387  1.280 0.201
>> ...
>>
>> Question: How can I combine/consolidate the two .RData files into one?
>> Thank you.
>>
>>
>>
>>
>>
>> [[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.

__
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] barplot that displays sums of values of 2 y colums grouped by different variables

2018-01-16 Thread kenneth dyson
Thanks everyone.

Got it to work like this, if anyone is interested:

import the data with readr, taking in only the columns that have numeric 
values ("n" and "y") and the column with the groups ("city").

aggregate the data by the group ("city") so that each variable has a sum:

|sum_data <-aggregate(.~City__c,data=raw_data,sum)|

reshape the data so that the groups are now variables (there will be 3 
columns: "city", "variable", "value"):

|library(reshape2)library(ggplot2)sums <-melt(sum_data)|

plot using ggplot:

|ggplot(sums,aes(x =city,y=value,fill =variable,ymax 
=1000))+geom_bar(stat="identity",width=.8,position ="dodge")|


On 2018-01-15 6:01 PM, Jeff Newmiller wrote:
> It is not generally advisable to get too fancy with stat functions in 
> ggplot... things can easily get more complicated than ggplot is ready 
> to handle when it comes to calculations. It is better to create data 
> that corresponds directly to the graphical representations you are 
> mapping them to.
>
> Read [1] for more on this philosophy.
>
> [1] H. Wickham, Tidy Data, Journal of Statistical Software, vol. 59, 
> no. 10, pp. 123, Sep. 2014. http://www.jstatsoft.org/v59/i10/
>
> #---
> library(ggplot2) # ggplot
> library(dplyr)   # `%>%`, group_by, summarise
> #> Attaching package: 'dplyr'
> #> The following objects are masked from 'package:stats':
> #>
> #> filter, lag
> #> The following objects are masked from 'package:base':
> #>
> #> intersect, setdiff, setequal, union
> library(tidyr)   # gather
>
> dta <- read.table( text =
> "city n y
> mon 100 200
> tor 209 300
> edm 98 87
> mon 20 76
> tor 50 96
> edm 62 27
> ", header = TRUE )
>
> dta2 <- (   dta
>     %>% group_by( city )
>     %>% summarise( n = sum( n )
>  , y = sum( y )
>  )
>     %>% gather( Response, value, -city )
>     )
>
> ggplot( dta2, aes( x=city, y=value, fill = Response ) ) +
>     geom_bar( stat="identity", position="dodge" )
>
> #' ![](https://i.imgur.com/cosFf3B.png)
> #---
>
> On Mon, 15 Jan 2018, kenneth dyson wrote:
>
>> I am trying to create a barplot displaying the sums of 2 columns of 
>> data grouped by a variable. the data is set up like this:
>>
>> "city" "n" "y" 
>> mon 100 200 
>> tor 209 300 
>> edm 98 87 
>> mon 20 76 
>> tor 50 96 
>> edm 62 27 
>>
>> the resulting plot should have city as the x-axis, 2 bars per city, 1 
>> representing the sum of "n" in that city, the other the sum of "y" in 
>> that city.
>>
>> If possible also show the sum in each bar as a label?
>>
>> I aggregated the data into sums like this:
>>
>> sum_data <- aggregate(. ~ City,data=raw_data,sum)
>>
>> this gave me the sums per city as I wanted but for some reason 1 of 
>> the cities is missing in the output.
>>
>> Using this code for the plot:
>>
>> ggplot(sum_data,aes(x = City,y = n)) + geom_bar(aes(fill = y),stat = 
>> "identity",position = "dodge")
>>
>> gave be a bar plot with one bar per city showing the sum of y as a 
>> color gradient. not what I expected given the "dodge" command in 
>> geom_bar.
>>
>> Thanks.
>>
>> __
>> 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.
>>
>
> --- 
>
> Jeff Newmiller    The .   . Go 
> Live...
> DCN:    Basics: ##.#. ##.#.  Live Go...
>   Live:   OO#.. Dead: OO#.. Playing
> Research Engineer (Solar/Batteries    O.O#.   #.O#. with
> /Software/Embedded Controllers)   .OO#.   .OO#. 
> rocks...1k
> --- 
>


[[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] flatpak installation package?

2018-01-16 Thread Jeff Newmiller
Of course... R _is_ open source. However, it is unwise to assume that the 
volunteers scratching itches for their preferred distros will take on 
additional work... it is more likely that you will need to take on scratching 
that new itch.
-- 
Sent from my phone. Please excuse my brevity.

On January 16, 2018 7:36:45 AM PST, Treutwein Bernhard 
 wrote:
>Is there any chance for a distribution independent flatpak installation
>package for R ?
>
>See: http://flatpak.org 
>
>Background: I recently bought an Acer notebook with endless OS
>preinstalled
>(see: http://endlessos.com).  It is Debian based, but uses only flatpak
>as installation
>package format.
>
>regards
>--
>  Bernhard Treutwein
>
>__
>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] flatpak installation package?

2018-01-16 Thread Treutwein Bernhard
Is there any chance for a distribution independent flatpak installation package 
for R ?

See: http://flatpak.org 

Background: I recently bought an Acer notebook with endless OS preinstalled
(see: http://endlessos.com).  It is Debian based, but uses only flatpak as 
installation
package format.

regards
--
  Bernhard Treutwein

__
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] Merging RData files

2018-01-16 Thread Bert Gunter
?load

Read this carefully. Pay attention to its instructions re: overwriting
existing objects.

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 Tue, Jan 16, 2018 at 12:43 AM, Steven Yen  wrote:

> I ran two separate hours-long projects. Results of each were saved to
> two separate .RData files.
> Content of each includes, among others, the following:
>
> mese  t p sig
> pc21.age0.640 0.219  2.918 0.004 ***
> pc21.agesq  0.000 0.000NaN   NaN
> pc21.inc0.903 0.103  8.752 0.000 ***
> pc21.incsq  0.000 0.000NaN   NaN
> pc21.sei10  0.451 0.145  3.122 0.002 ***
> pc21.sblkprot  -4.334 3.387  1.280 0.201
> ...
>
> Question: How can I combine/consolidate the two .RData files into one?
> Thank you.
>
>
>
>
>
> [[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] Information installation package sjPlot

2018-01-16 Thread Paul Bivand
This depends on the resources of your computer. If it's very small,
some dependencies can take a long time.

My record is the glmmTMB dependency with over 24 hours compilation (on
an old netbook).

One helpful way round can be to download the .tar.gz of the package,
close down all other programs, and run R CMD install package.tar.gz
from the command line.

Paul

On 11 January 2018 at 23:21, Orvalho Augusto  wrote:
> That is very strange.
>
> I am using Ubuntu 16.04 and managed to install it in less than 5 minutes.
>
> OA
>
> On Wed, Jan 10, 2018 at 12:00 PM, Luca Danieli 
> wrote:
>
>> Hi all,
>>
>> I am new. I am installing the library sjPlot on Ubunto 16.10 and I guess
>> it is installing some dependencies. But it is taking more than 1.5 hours,
>> is it possible?
>>
>> It has right now halted (hope momentarily) in installing the package
>> 'rstan', particularly the file lang__grammars__statement_grammar_inst.o
>>
>> Other packages installed include: dygraphs, colourpicker, raster.
>>
>> Is it good or is something going wrong?
>>
>> Luca
>>
>> Get Outlook for Android
>>
>>
>> [[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.

__
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] Merging RData files

2018-01-16 Thread Duncan Murdoch

On 16/01/2018 7:13 AM, Steven Yen wrote:
Understood. In my case, a.RData and b.RData contain identical 
variables/data, plus simulation outputs from separate runs. The codes 
deliver what I need. Good to know the three lines work. Thank you.


You might also want to investigate saveRDS/readRDS.  Those functions are 
similar to save/load, but they only write a single variable and don't 
write variable names, so you can do things like


saveRDS(x, "x.rds")
y <- readRDS("x.rds")

to read the value of x directly into y.

Duncan Murdoch



On 1/16/2018 8:06 PM, Duncan Murdoch wrote:

On 16/01/2018 6:33 AM, Steven Yen wrote:

Hi all,
This is great. Again, here is what I need. I run two separate jobs (a.R
and b.R) with results (say regression outputs) going to a.RData and
b.RData. I like to put all results in one place (where I can retrieve
them in one place, ab.RData). The following codes do it (I am not sure
if line 2 is needed but I am happy). Thank you all.

load("a.RData")
save.image("ab.RData")
load("b.RData")
save.image("ab.RData")


That's the same as

load("a.RData")
load("b.RData")
save.image("ab.RData")

because the second saved image overwrites the first one.  It'll be 
okay if all the variable names are different in a.RData and b.RData, 
but will lose values from a.RData if any of them have the same names 
as objects in b.RData.  See the link I posted earlier to avoid this.


Duncan Murdoch



On 1/16/2018 7:08 PM, PIKAL Petr wrote:

Huh.

I may by completely wrong but you cannot do such "merging". .RData 
files are AFAIK places where all objects from given session are stored.


However you could load each .RData file and save/export result (one 
object).


BTW, what do you mean exactly by "combine/consolidate"?

And finally, post your questions in plain text not html, otherwise 
they can be mangled.


Cheers
Petr


-Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of 
Steven Yen

Sent: Tuesday, January 16, 2018 9:44 AM
To: r-help@r-project.org
Subject: [R] Merging RData files

I ran two separate hours-long projects. Results of each were saved 
to two

separate .RData files.
Content of each includes, among others, the following:

  me    se  t p sig pc21.age
0.640 0.219  2.918 0.004 ***
pc21.agesq  0.000 0.000    NaN   NaN pc21.inc 0.903 0.103  
8.752 0.000

*** pc21.incsq  0.000 0.000    NaN   NaN
pc21.sei10  0.451 0.145  3.122 0.002 *** pc21.sblkprot -4.334 
3.387  1.280

0.201 ...

Question: How can I combine/consolidate the two .RData files into one?
Thank you.





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


Tento e-mail a jakékoliv k němu připojené dokumenty jsou důvěrné a 
jsou určeny pouze jeho adresátům.
Jestliže jste obdržel(a) tento e-mail omylem, informujte laskavě 
neprodleně jeho odesílatele. Obsah tohoto emailu i s přílohami a 
jeho kopie vymažte ze svého systému.
Nejste-li zamýšleným adresátem tohoto emailu, nejste oprávněni tento 
email jakkoliv užívat, rozšiřovat, kopírovat či zveřejňovat.
Odesílatel e-mailu neodpovídá za eventuální škodu způsobenou 
modifikacemi či zpožděním přenosu e-mailu.


V případě, že je tento e-mail součástí obchodního jednání:
- vyhrazuje si odesílatel právo ukončit kdykoliv jednání o uzavření 
smlouvy, a to z jakéhokoliv důvodu i bez uvedení důvodu.
- a obsahuje-li nabídku, je adresát oprávněn nabídku bezodkladně 
přijmout; Odesílatel tohoto e-mailu (nabídky) vylučuje přijetí 
nabídky ze strany příjemce s dodatkem či odchylkou.
- trvá odesílatel na tom, že příslušná smlouva je uzavřena teprve 
výslovným dosažením shody na všech jejích náležitostech.
- odesílatel tohoto emailu informuje, že není oprávněn uzavírat za 
společnost žádné smlouvy s výjimkou případů, kdy k tomu byl písemně 
zmocněn nebo písemně pověřen a takové pověření nebo plná moc byly 
adresátovi tohoto emailu případně osobě, kterou adresát zastupuje, 
předloženy nebo jejich existence je adresátovi či osobě jím 
zastoupené známá.


This e-mail and any documents attached to it may be confidential and 
are intended only for its intended recipients.
If you received this e-mail by mistake, please immediately inform 
its sender. Delete the contents of this e-mail with all attachments 
and its copies from your system.
If you are not the intended recipient of this e-mail, you are not 
authorized to use, disseminate, copy or disclose this e-mail in any 
manner.
The sender of this e-mail shall not be liable for any possible 
damage caused by modifications of the e-mail or by delay with 
transfer of the email.


In case that this e-mail forms part of business dealings:
- the sender 

[R] Letters group Games-Howell post hoc in R

2018-01-16 Thread David Bars Cortina
Hello everybody,

I use the sweetpotato database included in R package:

data(sweetpotato) This dataset contains two variables: yield(continous
variable) and virus(factor variable).

Due to Levene test is significant I cannot assume homogeneity of variances
and I apply Welch test in R instead of one-way ANOVA followed by Tukey
posthoc.

Nevertheless, the problems come from when I apply posthoc test. In Tukey
posthoc test I use library(agricolae) and displays me the superscript
letters between virus groups. Therefore there are no problems.

Nevertheless, to perform Games-Howell posthoc, I use
library(userfriendlyscience) and I obtain Games-Howell output but it's
impossible for me to obtain a letter superscript comparison between virus
groups as it is obtained through library(agricolae).

The code used it was the following:

library(userfriendlyscience)

data(sweetpotato)

oneway<-oneway(sweetpotato$virus, y=sweetpotato$yield, posthoc =
'games-howell')

oneway

I try with cld() importing previously library(multcompView) but doesn't work.

Can somebody could helps me?

Thanks in advance,

David Bars.

__
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] Packages couldn't load

2018-01-16 Thread Thierry Onkelinx
You need to make sure that the rJava package is working.

Consider using the readxl package instead of xlsx.

Best regards,

ir. Thierry Onkelinx
Statisticus / Statistician

Vlaamse Overheid / Government of Flanders
INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE
AND FOREST
Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality Assurance
thierry.onkel...@inbo.be
Havenlaan 88 bus 73, 1000 Brussel
www.inbo.be

///
To call in the statistician after the experiment is done may be no
more than asking him to perform a post-mortem examination: he may be
able to say what the experiment died of. ~ Sir Ronald Aylmer Fisher
The plural of anecdote is not data. ~ Roger Brinner
The combination of some data and an aching desire for an answer does
not ensure that a reasonable answer can be extracted from a given body
of data. ~ John Tukey
///




2018-01-16 13:08 GMT+01:00 Emeka Don :
> Dear All,
> I have been trying to install Xlsx package in R but  i have been getting
> this error after the installation. Please can anyone help?
>
>> any(grepl("xlsx",installed.packages()))
> [1] TRUE
>> library("xlsx")
> Loading required package: rJava
> Error: package or namespace load failed for ‘rJava’:
>  .onLoad failed in loadNamespace() for 'rJava', details:
>   call: fun(libname, pkgname)
>   error: JAVA_HOME cannot be determined from the Registry
> Error: package ‘rJava’ could not be loaded
> In addition: Warning messages:
> 1: package ‘xlsx’ was built under R version 3.4.3
> 2: package ‘rJava’ was built under R version 3.4.3
>
> Thank you
>
> --
> Onyeuwaoma Nnaemeka Dom PhD.
> Scientific Officer.
> Center for Basic Space Science (CBSS)
> National Space Research and Development Agency (NASRDA)
> Federal Ministry of Science and Technology
> University of Nigeria, Nsukka
> P. M. B. 2022, Nsukka, Enugu State, Nigeria.
> +2348032686377, +2347052835685
> email:onyeuwaoma.em...@cbss.nasrda.gov.ng
>
> [[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] Merging RData files

2018-01-16 Thread Steven Yen
Understood. In my case, a.RData and b.RData contain identical 
variables/data, plus simulation outputs from separate runs. The codes 
deliver what I need. Good to know the three lines work. Thank you.

On 1/16/2018 8:06 PM, Duncan Murdoch wrote:
> On 16/01/2018 6:33 AM, Steven Yen wrote:
>> Hi all,
>> This is great. Again, here is what I need. I run two separate jobs (a.R
>> and b.R) with results (say regression outputs) going to a.RData and
>> b.RData. I like to put all results in one place (where I can retrieve
>> them in one place, ab.RData). The following codes do it (I am not sure
>> if line 2 is needed but I am happy). Thank you all.
>>
>> load("a.RData")
>> save.image("ab.RData")
>> load("b.RData")
>> save.image("ab.RData")
>
> That's the same as
>
> load("a.RData")
> load("b.RData")
> save.image("ab.RData")
>
> because the second saved image overwrites the first one.  It'll be 
> okay if all the variable names are different in a.RData and b.RData, 
> but will lose values from a.RData if any of them have the same names 
> as objects in b.RData.  See the link I posted earlier to avoid this.
>
> Duncan Murdoch
>
>>
>> On 1/16/2018 7:08 PM, PIKAL Petr wrote:
>>> Huh.
>>>
>>> I may by completely wrong but you cannot do such "merging". .RData 
>>> files are AFAIK places where all objects from given session are stored.
>>>
>>> However you could load each .RData file and save/export result (one 
>>> object).
>>>
>>> BTW, what do you mean exactly by "combine/consolidate"?
>>>
>>> And finally, post your questions in plain text not html, otherwise 
>>> they can be mangled.
>>>
>>> Cheers
>>> Petr
>>>
 -Original Message-
 From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of 
 Steven Yen
 Sent: Tuesday, January 16, 2018 9:44 AM
 To: r-help@r-project.org
 Subject: [R] Merging RData files

 I ran two separate hours-long projects. Results of each were saved 
 to two
 separate .RData files.
 Content of each includes, among others, the following:

   me    se  t p sig pc21.age    
 0.640 0.219  2.918 0.004 ***
 pc21.agesq  0.000 0.000    NaN   NaN pc21.inc 0.903 0.103  
 8.752 0.000
 *** pc21.incsq  0.000 0.000    NaN   NaN
 pc21.sei10  0.451 0.145  3.122 0.002 *** pc21.sblkprot -4.334 
 3.387  1.280
 0.201 ...

 Question: How can I combine/consolidate the two .RData files into one?
 Thank you.





     [[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.
>>> 
>>> Tento e-mail a jakékoliv k němu připojené dokumenty jsou důvěrné a 
>>> jsou určeny pouze jeho adresátům.
>>> Jestliže jste obdržel(a) tento e-mail omylem, informujte laskavě 
>>> neprodleně jeho odesílatele. Obsah tohoto emailu i s přílohami a 
>>> jeho kopie vymažte ze svého systému.
>>> Nejste-li zamýšleným adresátem tohoto emailu, nejste oprávněni tento 
>>> email jakkoliv užívat, rozšiřovat, kopírovat či zveřejňovat.
>>> Odesílatel e-mailu neodpovídá za eventuální škodu způsobenou 
>>> modifikacemi či zpožděním přenosu e-mailu.
>>>
>>> V případě, že je tento e-mail součástí obchodního jednání:
>>> - vyhrazuje si odesílatel právo ukončit kdykoliv jednání o uzavření 
>>> smlouvy, a to z jakéhokoliv důvodu i bez uvedení důvodu.
>>> - a obsahuje-li nabídku, je adresát oprávněn nabídku bezodkladně 
>>> přijmout; Odesílatel tohoto e-mailu (nabídky) vylučuje přijetí 
>>> nabídky ze strany příjemce s dodatkem či odchylkou.
>>> - trvá odesílatel na tom, že příslušná smlouva je uzavřena teprve 
>>> výslovným dosažením shody na všech jejích náležitostech.
>>> - odesílatel tohoto emailu informuje, že není oprávněn uzavírat za 
>>> společnost žádné smlouvy s výjimkou případů, kdy k tomu byl písemně 
>>> zmocněn nebo písemně pověřen a takové pověření nebo plná moc byly 
>>> adresátovi tohoto emailu případně osobě, kterou adresát zastupuje, 
>>> předloženy nebo jejich existence je adresátovi či osobě jím 
>>> zastoupené známá.
>>>
>>> This e-mail and any documents attached to it may be confidential and 
>>> are intended only for its intended recipients.
>>> If you received this e-mail by mistake, please immediately inform 
>>> its sender. Delete the contents of this e-mail with all attachments 
>>> and its copies from your system.
>>> If you are not the intended recipient of this e-mail, you are not 
>>> authorized to use, disseminate, copy or disclose this e-mail in any 
>>> manner.
>>> The sender of this e-mail shall not be liable for any possible 
>>> damage caused by modifications of the e-mail or by delay with 
>>> transfer of the 

[R] Packages couldn't load

2018-01-16 Thread Emeka Don
Dear All,
I have been trying to install Xlsx package in R but  i have been getting
this error after the installation. Please can anyone help?

> any(grepl("xlsx",installed.packages()))
[1] TRUE
> library("xlsx")
Loading required package: rJava
Error: package or namespace load failed for ‘rJava’:
 .onLoad failed in loadNamespace() for 'rJava', details:
  call: fun(libname, pkgname)
  error: JAVA_HOME cannot be determined from the Registry
Error: package ‘rJava’ could not be loaded
In addition: Warning messages:
1: package ‘xlsx’ was built under R version 3.4.3
2: package ‘rJava’ was built under R version 3.4.3

Thank you

-- 
Onyeuwaoma Nnaemeka Dom PhD.
Scientific Officer.
Center for Basic Space Science (CBSS)
National Space Research and Development Agency (NASRDA)
Federal Ministry of Science and Technology
University of Nigeria, Nsukka
P. M. B. 2022, Nsukka, Enugu State, Nigeria.
+2348032686377, +2347052835685
email:onyeuwaoma.em...@cbss.nasrda.gov.ng

[[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] Merging RData files

2018-01-16 Thread Duncan Murdoch

On 16/01/2018 6:33 AM, Steven Yen wrote:

Hi all,
This is great. Again, here is what I need. I run two separate jobs (a.R
and b.R) with results (say regression outputs) going to a.RData and
b.RData. I like to put all results in one place (where I can retrieve
them in one place, ab.RData). The following codes do it (I am not sure
if line 2 is needed but I am happy). Thank you all.

load("a.RData")
save.image("ab.RData")
load("b.RData")
save.image("ab.RData")


That's the same as

load("a.RData")
load("b.RData")
save.image("ab.RData")

because the second saved image overwrites the first one.  It'll be okay 
if all the variable names are different in a.RData and b.RData, but will 
lose values from a.RData if any of them have the same names as objects 
in b.RData.  See the link I posted earlier to avoid this.


Duncan Murdoch



On 1/16/2018 7:08 PM, PIKAL Petr wrote:

Huh.

I may by completely wrong but you cannot do such "merging". .RData files are 
AFAIK places where all objects from given session are stored.

However you could load each .RData file and save/export result (one object).

BTW, what do you mean exactly by "combine/consolidate"?

And finally, post your questions in plain text not html, otherwise they can be 
mangled.

Cheers
Petr


-Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Steven Yen
Sent: Tuesday, January 16, 2018 9:44 AM
To: r-help@r-project.org
Subject: [R] Merging RData files

I ran two separate hours-long projects. Results of each were saved to two
separate .RData files.
Content of each includes, among others, the following:

  mese  t p sig pc21.age0.640 0.219  
2.918 0.004 ***
pc21.agesq  0.000 0.000NaN   NaN pc21.inc0.903 0.103  8.752 
0.000
*** pc21.incsq  0.000 0.000NaN   NaN
pc21.sei10  0.451 0.145  3.122 0.002 *** pc21.sblkprot  -4.334 3.387  1.280
0.201 ...

Question: How can I combine/consolidate the two .RData files into one?
Thank you.





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


Tento e-mail a jakékoliv k němu připojené dokumenty jsou důvěrné a jsou určeny 
pouze jeho adresátům.
Jestliže jste obdržel(a) tento e-mail omylem, informujte laskavě neprodleně 
jeho odesílatele. Obsah tohoto emailu i s přílohami a jeho kopie vymažte ze 
svého systému.
Nejste-li zamýšleným adresátem tohoto emailu, nejste oprávněni tento email 
jakkoliv užívat, rozšiřovat, kopírovat či zveřejňovat.
Odesílatel e-mailu neodpovídá za eventuální škodu způsobenou modifikacemi či 
zpožděním přenosu e-mailu.

V případě, že je tento e-mail součástí obchodního jednání:
- vyhrazuje si odesílatel právo ukončit kdykoliv jednání o uzavření smlouvy, a 
to z jakéhokoliv důvodu i bez uvedení důvodu.
- a obsahuje-li nabídku, je adresát oprávněn nabídku bezodkladně přijmout; 
Odesílatel tohoto e-mailu (nabídky) vylučuje přijetí nabídky ze strany příjemce 
s dodatkem či odchylkou.
- trvá odesílatel na tom, že příslušná smlouva je uzavřena teprve výslovným 
dosažením shody na všech jejích náležitostech.
- odesílatel tohoto emailu informuje, že není oprávněn uzavírat za společnost 
žádné smlouvy s výjimkou případů, kdy k tomu byl písemně zmocněn nebo písemně 
pověřen a takové pověření nebo plná moc byly adresátovi tohoto emailu případně 
osobě, kterou adresát zastupuje, předloženy nebo jejich existence je adresátovi 
či osobě jím zastoupené známá.

This e-mail and any documents attached to it may be confidential and are 
intended only for its intended recipients.
If you received this e-mail by mistake, please immediately inform its sender. 
Delete the contents of this e-mail with all attachments and its copies from 
your system.
If you are not the intended recipient of this e-mail, you are not authorized to 
use, disseminate, copy or disclose this e-mail in any manner.
The sender of this e-mail shall not be liable for any possible damage caused by 
modifications of the e-mail or by delay with transfer of the email.

In case that this e-mail forms part of business dealings:
- the sender reserves the right to end negotiations about entering into a 
contract in any time, for any reason, and without stating any reasoning.
- if the e-mail contains an offer, the recipient is entitled to immediately 
accept such offer; The sender of this e-mail (offer) excludes any acceptance of 
the offer on the part of the recipient containing any amendment or variation.
- the sender insists on that the respective contract is concluded only upon an 
express mutual agreement on all its aspects.
- the sender of this e-mail informs that he/she is not authorized to enter into 
any contracts on 

Re: [R] Merging RData files

2018-01-16 Thread Steven Yen
Hi all,
This is great. Again, here is what I need. I run two separate jobs (a.R 
and b.R) with results (say regression outputs) going to a.RData and 
b.RData. I like to put all results in one place (where I can retrieve 
them in one place, ab.RData). The following codes do it (I am not sure 
if line 2 is needed but I am happy). Thank you all.

load("a.RData")
save.image("ab.RData")
load("b.RData")
save.image("ab.RData")

On 1/16/2018 7:08 PM, PIKAL Petr wrote:
> Huh.
>
> I may by completely wrong but you cannot do such "merging". .RData files are 
> AFAIK places where all objects from given session are stored.
>
> However you could load each .RData file and save/export result (one object).
>
> BTW, what do you mean exactly by "combine/consolidate"?
>
> And finally, post your questions in plain text not html, otherwise they can 
> be mangled.
>
> Cheers
> Petr
>
>> -Original Message-
>> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Steven Yen
>> Sent: Tuesday, January 16, 2018 9:44 AM
>> To: r-help@r-project.org
>> Subject: [R] Merging RData files
>>
>> I ran two separate hours-long projects. Results of each were saved to two
>> separate .RData files.
>> Content of each includes, among others, the following:
>>
>>  mese  t p sig pc21.age0.640 0.219  
>> 2.918 0.004 ***
>> pc21.agesq  0.000 0.000NaN   NaN pc21.inc0.903 0.103  8.752 
>> 0.000
>> *** pc21.incsq  0.000 0.000NaN   NaN
>> pc21.sei10  0.451 0.145  3.122 0.002 *** pc21.sblkprot  -4.334 3.387  
>> 1.280
>> 0.201 ...
>>
>> Question: How can I combine/consolidate the two .RData files into one?
>> Thank you.
>>
>>
>>
>>
>>
>>[[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.
> 
> Tento e-mail a jakékoliv k němu připojené dokumenty jsou důvěrné a jsou 
> určeny pouze jeho adresátům.
> Jestliže jste obdržel(a) tento e-mail omylem, informujte laskavě neprodleně 
> jeho odesílatele. Obsah tohoto emailu i s přílohami a jeho kopie vymažte ze 
> svého systému.
> Nejste-li zamýšleným adresátem tohoto emailu, nejste oprávněni tento email 
> jakkoliv užívat, rozšiřovat, kopírovat či zveřejňovat.
> Odesílatel e-mailu neodpovídá za eventuální škodu způsobenou modifikacemi či 
> zpožděním přenosu e-mailu.
>
> V případě, že je tento e-mail součástí obchodního jednání:
> - vyhrazuje si odesílatel právo ukončit kdykoliv jednání o uzavření smlouvy, 
> a to z jakéhokoliv důvodu i bez uvedení důvodu.
> - a obsahuje-li nabídku, je adresát oprávněn nabídku bezodkladně přijmout; 
> Odesílatel tohoto e-mailu (nabídky) vylučuje přijetí nabídky ze strany 
> příjemce s dodatkem či odchylkou.
> - trvá odesílatel na tom, že příslušná smlouva je uzavřena teprve výslovným 
> dosažením shody na všech jejích náležitostech.
> - odesílatel tohoto emailu informuje, že není oprávněn uzavírat za společnost 
> žádné smlouvy s výjimkou případů, kdy k tomu byl písemně zmocněn nebo písemně 
> pověřen a takové pověření nebo plná moc byly adresátovi tohoto emailu 
> případně osobě, kterou adresát zastupuje, předloženy nebo jejich existence je 
> adresátovi či osobě jím zastoupené známá.
>
> This e-mail and any documents attached to it may be confidential and are 
> intended only for its intended recipients.
> If you received this e-mail by mistake, please immediately inform its sender. 
> Delete the contents of this e-mail with all attachments and its copies from 
> your system.
> If you are not the intended recipient of this e-mail, you are not authorized 
> to use, disseminate, copy or disclose this e-mail in any manner.
> The sender of this e-mail shall not be liable for any possible damage caused 
> by modifications of the e-mail or by delay with transfer of the email.
>
> In case that this e-mail forms part of business dealings:
> - the sender reserves the right to end negotiations about entering into a 
> contract in any time, for any reason, and without stating any reasoning.
> - if the e-mail contains an offer, the recipient is entitled to immediately 
> accept such offer; The sender of this e-mail (offer) excludes any acceptance 
> of the offer on the part of the recipient containing any amendment or 
> variation.
> - the sender insists on that the respective contract is concluded only upon 
> an express mutual agreement on all its aspects.
> - the sender of this e-mail informs that he/she is not authorized to enter 
> into any contracts on behalf of the company except for cases in which he/she 
> is expressly authorized to do so in writing, and such authorization or power 
> of attorney is submitted to the recipient or the person represented by the 
> 

Re: [R] Merging RData files

2018-01-16 Thread PIKAL Petr
Huh.

I may by completely wrong but you cannot do such "merging". .RData files are 
AFAIK places where all objects from given session are stored.

However you could load each .RData file and save/export result (one object).

BTW, what do you mean exactly by "combine/consolidate"?

And finally, post your questions in plain text not html, otherwise they can be 
mangled.

Cheers
Petr

> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Steven Yen
> Sent: Tuesday, January 16, 2018 9:44 AM
> To: r-help@r-project.org
> Subject: [R] Merging RData files
>
> I ran two separate hours-long projects. Results of each were saved to two
> separate .RData files.
> Content of each includes, among others, the following:
>
> mese  t p sig pc21.age0.640 0.219  
> 2.918 0.004 ***
> pc21.agesq  0.000 0.000NaN   NaN pc21.inc0.903 0.103  8.752 
> 0.000
> *** pc21.incsq  0.000 0.000NaN   NaN
> pc21.sei10  0.451 0.145  3.122 0.002 *** pc21.sblkprot  -4.334 3.387  
> 1.280
> 0.201 ...
>
> Question: How can I combine/consolidate the two .RData files into one?
> Thank you.
>
>
>
>
>
>   [[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.


Tento e-mail a jakékoliv k němu připojené dokumenty jsou důvěrné a jsou určeny 
pouze jeho adresátům.
Jestliže jste obdržel(a) tento e-mail omylem, informujte laskavě neprodleně 
jeho odesílatele. Obsah tohoto emailu i s přílohami a jeho kopie vymažte ze 
svého systému.
Nejste-li zamýšleným adresátem tohoto emailu, nejste oprávněni tento email 
jakkoliv užívat, rozšiřovat, kopírovat či zveřejňovat.
Odesílatel e-mailu neodpovídá za eventuální škodu způsobenou modifikacemi či 
zpožděním přenosu e-mailu.

V případě, že je tento e-mail součástí obchodního jednání:
- vyhrazuje si odesílatel právo ukončit kdykoliv jednání o uzavření smlouvy, a 
to z jakéhokoliv důvodu i bez uvedení důvodu.
- a obsahuje-li nabídku, je adresát oprávněn nabídku bezodkladně přijmout; 
Odesílatel tohoto e-mailu (nabídky) vylučuje přijetí nabídky ze strany příjemce 
s dodatkem či odchylkou.
- trvá odesílatel na tom, že příslušná smlouva je uzavřena teprve výslovným 
dosažením shody na všech jejích náležitostech.
- odesílatel tohoto emailu informuje, že není oprávněn uzavírat za společnost 
žádné smlouvy s výjimkou případů, kdy k tomu byl písemně zmocněn nebo písemně 
pověřen a takové pověření nebo plná moc byly adresátovi tohoto emailu případně 
osobě, kterou adresát zastupuje, předloženy nebo jejich existence je adresátovi 
či osobě jím zastoupené známá.

This e-mail and any documents attached to it may be confidential and are 
intended only for its intended recipients.
If you received this e-mail by mistake, please immediately inform its sender. 
Delete the contents of this e-mail with all attachments and its copies from 
your system.
If you are not the intended recipient of this e-mail, you are not authorized to 
use, disseminate, copy or disclose this e-mail in any manner.
The sender of this e-mail shall not be liable for any possible damage caused by 
modifications of the e-mail or by delay with transfer of the email.

In case that this e-mail forms part of business dealings:
- the sender reserves the right to end negotiations about entering into a 
contract in any time, for any reason, and without stating any reasoning.
- if the e-mail contains an offer, the recipient is entitled to immediately 
accept such offer; The sender of this e-mail (offer) excludes any acceptance of 
the offer on the part of the recipient containing any amendment or variation.
- the sender insists on that the respective contract is concluded only upon an 
express mutual agreement on all its aspects.
- the sender of this e-mail informs that he/she is not authorized to enter into 
any contracts on behalf of the company except for cases in which he/she is 
expressly authorized to do so in writing, and such authorization or power of 
attorney is submitted to the recipient or the person represented by the 
recipient, or the existence of such authorization is known to the recipient of 
the person represented by the recipient.
__
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] Merging RData files

2018-01-16 Thread Duncan Murdoch

On 16/01/2018 3:43 AM, Steven Yen wrote:

I ran two separate hours-long projects. Results of each were saved to
two separate .RData files.
Content of each includes, among others, the following:

     me    se  t p sig
pc21.age    0.640 0.219  2.918 0.004 ***
pc21.agesq  0.000 0.000    NaN   NaN
pc21.inc    0.903 0.103  8.752 0.000 ***
pc21.incsq  0.000 0.000    NaN   NaN
pc21.sei10  0.451 0.145  3.122 0.002 ***
pc21.sblkprot  -4.334 3.387  1.280 0.201
...

Question: How can I combine/consolidate the two .RData files into one?
Thank you.




Load both of them, produce the object you want to save, and save it. If 
some objects have the same names in both files, do this carefully:  the 
second load will overwrite the first one.  A safe way to do it is 
described here:  https://www.r-bloggers.com/safe-loading-of-rdata-files-2/


Duncan Murdoch

__
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] sum multiple csv files

2018-01-16 Thread Alejandra Lopez-Galan
Hi all,

Thanks for your help and sorry for the confusion. Also Thanks Jeff,
your solution worked well, I was trying to perform matrix
(element-wise) addition as you mentioned, but I didn't know how to
formulate my question. Thanks for the references, they also help me to
understand more.

Cheers,
Alejandra



On Tue, Jan 16, 2018 at 2:35 AM, Jeff Newmiller
 wrote:
> Your message seems unclear, and as evidence the respondents are giving 
> various answers. You should provide a small sample of input and output data 
> as it would look in R to avoid this kind of thrashing about. See [1][2][3] 
> for guidance. Note that you also really need to figure out how to make sure 
> your email program sends plain text, because HTML formatting WILL be stripped 
> by the mailing list (read the Posting Guide) and that process often garbles 
> it.
>
> My own possibly-confused reading of your question ("each cvs file has 47 rows 
> and colunms, so the final data frame should have the same") is that you do 
> not yet understand the difference between matrices and data frames ([4]), and 
> you want to perform matrix (element-wise) addition. This would require that 
> you convert the data frames read in by read.csv into matrices before adding 
> them:
>
> All_data <- lapply(filenames
> ,function(i){
> ###read cvs files and add the row and column names to each data frame
> ###
>  as.matrix( read.csv(i, header=FALSE, sep = "", col.names = col_names, 
> row.names = row_names)
> })
>
> result <- Reduce( `+`, All_data )
>
> This will fail if any of the values in your csv files are non-numeric, but 
> dealing with that would require us to know specifics about your files or 
> intent that you have omitted. (The dput function is indispensable for 
> clarifying such issues [1][2].)
> ---
>
> [1] 
> http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example
>
> [2] http://adv-r.had.co.nz/Reproducibility.html
>
> [3] https://cran.r-project.org/web/packages/reprex/index.html (read the 
> vignette)
>
> [4] see "Introduction to R" (part of the R documentation)
>
> --
> Sent from my phone. Please excuse my brevity.
>
> On January 15, 2018 1:29:05 AM PST, Alejandra Lopez-Galan 
>  wrote:
>>Hi, I am pretty new to R and I would apreciatte very much your help to
>>solve my problem. I have 40 csv files that have the same structure, and
>>I
>>want to merge them into a single data frame.
>>
>>I already have load and combined all the cvs files into a large list,
>>and I
>>created two
>>
>>filenames <- list.files('data',full.names=TRUE)
>>
>>All_data <- lapply(filenames,function(i){
>>###read cvs files and add the row and column names to each data
>>frame###
>> read.csv(i, header=FALSE, sep = "", col.names = col_names, row.names =
>>row_names)
>> })
>>
>>However I would like to sum the rows of cvs files to get a single data
>>frame (each cvs file has 47 rows and colunms, so the final data frame
>>should have the same). I could only do it one by one data data frame,
>>but I
>>was wondering if anyone could give an idea of how to write a function
>>for
>>this.
>>
>>Thanks,
>>Alejandra
>>
>>   [[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] Merging RData files

2018-01-16 Thread Steven Yen
I ran two separate hours-long projects. Results of each were saved to 
two separate .RData files.
Content of each includes, among others, the following:

    me    se  t p sig
pc21.age    0.640 0.219  2.918 0.004 ***
pc21.agesq  0.000 0.000    NaN   NaN
pc21.inc    0.903 0.103  8.752 0.000 ***
pc21.incsq  0.000 0.000    NaN   NaN
pc21.sei10  0.451 0.145  3.122 0.002 ***
pc21.sblkprot  -4.334 3.387  1.280 0.201
...

Question: How can I combine/consolidate the two .RData files into one? 
Thank you.





[[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] [R-pkgs] Natural Language Processing for non-English languages with udpipe

2018-01-16 Thread Jan Wijffels
Dear R users,

I'm happy to announce the release of version 0.3 of the udpipe R package on
CRAN (https://CRAN.R-project.org/package=udpipe). The udpipe R package is a
Natural Language Processing toolkit that provides language-agnostic
'tokenization', 'parts of speech tagging', 'lemmatization', 'morphological
feature tagging' and 'dependency parsing' of raw text. Next to text
parsing, the R package also allows you to train annotation models based on
data of 'treebanks' in 'CoNLL-U' format as provided at
http://universaldependencies.org/format.html.

The R package provides direct access to language models trained on more
than 50 languages. The following languages are directly available:

afrikaans, ancient_greek-proiel, ancient_greek, arabic, basque, belarusian,
bulgarian, catalan, chinese, coptic, croatian, czech-cac, czech-cltt,
czech, danish, dutch-lassysmall, dutch, english-lines, english-partut,
english, estonian, finnish-ftb, finnish, french-partut, french-sequoia,
french, galician-treegal, galician, german, gothic, greek, hebrew, hindi,
hungarian, indonesian, irish, italian, japanese, kazakh, korean,
latin-ittb, latin-proiel, latin, latvian, lithuanian, norwegian-bokmaal,
norwegian-nynorsk, old_church_slavonic, persian, polish, portuguese-br,
portuguese, romanian, russian-syntagrus, russian, sanskrit, serbian,
slovak, slovenian-sst, slovenian, spanish-ancora, spanish, swedish-lines,
swedish, tamil, turkish, ukrainian, urdu, uyghur, vietnamese

We hope that the package will allow other R users to build natural language
applications on top of the resulting parts of speech tags, tokens,
morphological features and dependency parsing output. And we hope in
particular that applications will arise which are not limited to English
only (like the textrank R package or the cleanNLP package to name a few)

Note that the package has no external software dependencies (no java nor
python) and depends only on 2 R packages (Rcpp and data.table), which makes
the package easy to install on any platform.

The package is available on CRAN at
https://CRAN.R-project.org/package=udpipe and is developed at
https://github.com/bnosac/udpipe
A small docusaurus website is made available at
https://bnosac.github.io/udpipe/en

We hope you enjoy using it and we would like to thank Milan Straka for all
the efforts done on UDPipe as well as all persons involved in
http://universaldependencies.org

all the best,
Jan

Jan Wijffels
Statistician
www.bnosac.be  | +32 486 611708

[[alternative HTML version deleted]]

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

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