Re: [R] Importing data with value labels into R

2022-11-14 Thread IAGO GINÉ VÁZQUEZ
Hello Maryam,

The haven function for reading Stata files is read_dta (not read.dta!!!). May 
this be your issue?

Iago


De: R-help  de part de Maryam Iraniparast 

Enviat el: dilluns, 14 de novembre de 2022 19:07
Per a: r-help@r-project.org 
Tema: [R] Importing data with value labels into R

Hello!

I want to read SPSS data into R and I want to carry the value labels with my 
dataset.
Based on my research, only Stata file can transfer the value labels to R (It is 
easy to save SPSS data with Stata format).
The last time I did that successfully, I was using R4.2.1 and the following 
code. But it does not work anymore.


install.packages("tidyverse")

install.packages("haven")
library(tidyverse)

library(haven)

df=file.choose() *Note: Select the STATA file from the folder where it is saved.

dataset=read.dta(df)

I appreciate any thoughts or suggestion.

Thanks,
Mary

[[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] Rare behaviour for nlme::reStruct example and question about ?lmeObject

2022-11-14 Thread IAGO GINÉ VÁZQUEZ
Dear developers,

When I run the example code in the help of reStruct, I get


> library(nlme)
> rs1 <- reStruct(list(Dog = ~day, Side = ~1), data = Pixel)
> rs1
Uninitialized random effects structure
> str(rs1)
List of 2
 $ Side:Error in pdMatrix.pdSymm(x) :
  cannot extract matrix from an uninitialized object


Is it expected?

In addition to that I would like to ask if shouldn't be `terms` documented in 
`?lmeObject`.


Kind regards,

Iago




[[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] Importing data with value labels into R

2022-11-14 Thread Maryam Iraniparast
Hello!

I want to read SPSS data into R and I want to carry the value labels with my 
dataset.
Based on my research, only Stata file can transfer the value labels to R (It is 
easy to save SPSS data with Stata format).
The last time I did that successfully, I was using R4.2.1 and the following 
code. But it does not work anymore.


install.packages("tidyverse")

install.packages("haven")
library(tidyverse)

library(haven)

df=file.choose() *Note: Select the STATA file from the folder where it is saved.

dataset=read.dta(df)

I appreciate any thoughts or suggestion.

Thanks,
Mary

[[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] ubuntu 22

2022-11-14 Thread Jeff Newmiller
Seems like a problem with your system package manager repository configuration. 
Maybe better pursued on the R-sig-debian mailing list (Ubuntu is derived from 
Debian). Be sure to describe exactly what you did (e.g. which web page 
instructions did you follow).

On November 14, 2022 3:22:51 PM PST, "Ragia ."  wrote:
>
>  dear group ,
>cant install r base into ubuntu 22.
>the msg is
>The following packages have unmet dependencies:
> r-base-core : Depends: libicu70 (>= 70.1-1~) but it is not installable
>   Recommends: r-recommended but it is not going to be installed
>   Recommends: r-doc-html but it is not going to be installed
>E: Unable to correct problems, you have held broken packages.
>thanks in advance
>
>   [[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.

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


[R] unmet dependency for r-base-core ... was Re: ubuntu 22

2022-11-14 Thread David Winsemius


On 11/14/22 15:22, Ragia . wrote:
>dear group ,
> cant install r base into ubuntu 22.
> the msg is
> The following packages have unmet dependencies:
>   r-base-core : Depends: libicu70 (>= 70.1-1~) but it is not installable


Have you tried looking up the package that would contain libicu70?  I 
had no problem locating a copy of libicu70_70.1-2_amd64.deb 

 
with search terms: "libicu70 ubuntu 22".


> Recommends: r-recommended but it is not going to be installed
> Recommends: r-doc-html but it is not going to be installed
> E: Unable to correct problems, you have held broken packages.
> thanks in advance
>
>   [[alternative HTML version deleted]]


Do note that Rhelp is a plain text mailing list. And further note that 
the proper mailing list (also plain text) would have been R-SIG-debian.


-- 

David.

>
> __
> 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 guidehttp://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] ubuntu 22

2022-11-14 Thread Ragia .


  dear group ,
cant install r base into ubuntu 22.
the msg is
The following packages have unmet dependencies:
 r-base-core : Depends: libicu70 (>= 70.1-1~) but it is not installable
   Recommends: r-recommended but it is not going to be installed
   Recommends: r-doc-html but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
thanks in advance

[[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] Logistic regression for large data

2022-11-14 Thread Bill Dunlap
summary(Base)

would show if one of columns of Base was read as character data instead of
the expected numeric.  That could cause an explosion in the number of dummy
variables, hence a huge design matrix.

-Bill


On Fri, Nov 11, 2022 at 11:30 PM George Brida 
wrote:

> Dear R users,
>
> I have a database  called Base.csv   (attached to this email) which
> contains 13 columns and 8257 rows and whose the first 8 columns are dummy
> variables which take 1 or 0. The problem is when I wrote the following
> instructions to do a logistic regression , R runs for hours and hours
> without giving an output:
>
> Base=read.csv("C:\\Users\\HP\\Desktop\\New\\Base.csv",header=FALSE,sep=";")
>
> fit_1=glm(Base[,2]~Base[,1]+Base[,10]+Base[,11]+Base[,12]+Base[,13],family=binomial(link="logit"))
>
> Apparently, there is not enough memory to have the requested output. Is
> there any other function for logistic regression that handle large data and
> return output in reasonable time.
>
> Many thanks
>
> Kind regards
>
> George
> __
> 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.


[ESS] flymake + lintr do not work as expected on emacs 27.2 linux Mint

2022-11-14 Thread Sparapani, Rodney via ESS-help
Hi Ottorino:

My $0.02.  I haven�t found anything in 27.2 that is worth the upgrade.
I would recommend sticking with 26.3.  That is what I use regularly
with occasional playing around with 27.2 and 28.

--
Rodney Sparapani, Associate Professor of Biostatistics
Director, Wisconsin Chapter of the American Statistical Association
Institute for Health and Equity, Division of Biostatistics
Medical College of Wisconsin, Milwaukee Campus

[[alternative HTML version deleted]]

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [R] Rate of Reading into R from net

2022-11-14 Thread Enrico Schumann
On Mon, 14 Nov 2022, Nick Wray writes:

> Hello I am trying read  nc rainfall  files directly from the UK centre for
> hydrology and ecology website -
> hourly:about 300Mb
> https://catalogue.ceh.ac.uk/datastore/eidchub/fc9423d6-3d54-467f-bb2b-fc7357a3941f/
> and daily about 90Mb
> https://catalogue.ceh.ac.uk/datastore/eidchub/2ab15bf0-ad08-415c-ba64-831168be7293/precip/
>
> I can download them "by hand" no problem using the ncdf4 package but
> there's lots and I wanted to streamline the process
>
> code I've used (which works for "by hand" downloading) is (for example)
>
> nc_data<-nc_open("
> https://catalogue.ceh.ac.uk/datastore/eidchub/2ab15bf0-ad08-415c-ba64-831168be7293/precip/chess-met_precip_gb_1km_daily_19610301-19610331.nc
> ")
>
> However, when I run this I don't get an error message but R just sits there
> with the little red circle (at least 30 minutes for the 90Mb files)
>
> What I'm wondering is two things - a)is the data in fact downloading but
> it's just taking ages and I need to let it run and go and have a coffee
>b)is there (I can't find
> anything) within R which allows me to monitor the progress of the download,
> if in fact it is taking place?
> Thanks Nick Wray
>

Have you tried 'download.file'?  It should provide a
progress bar if the file size is known.  I'd first
download the file, and then read it.


-- 
Enrico Schumann
Lucerne, Switzerland
http://enricoschumann.net

__
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] Rate of Reading into R from net

2022-11-14 Thread Ivan Krylov
В Mon, 14 Nov 2022 13:04:31 +
Nick Wray  пишет:

> nc_data<-nc_open("
> https://catalogue.ceh.ac.uk/datastore/eidchub/2ab15bf0-ad08-415c-ba64-831168be7293/precip/chess-met_precip_gb_1km_daily_19610301-19610331.nc
> ")
> 
> However, when I run this I don't get an error message but R just sits
> there with the little red circle (at least 30 minutes for the 90Mb
> files)

Not sure why it just sits there, but looking at the package source
code, I can see that ncdf4::nc_open eventually forwards its arguments
to the nc_open function from the netcdf library:

https://github.com/cran/ncdf4/blob/1.19/R/ncdf4.R#L568
https://github.com/cran/ncdf4/blob/1.19/src/ncdf.c#L862
https://docs.unidata.ucar.edu/netcdf-c/current/group__datasets.html#gaccbdb128a1640e204831256dbbc24d3e

netcdf does support some form of remote file access, but only
OPeNDAP-compatible URLs are supposed to work. Your links ask me to log
in, which may mean that they won't work with netcdf. It might be easier
to use one of the R packages that let you work with libcurl and give
them the cookies from your browser in order to download the files
first, then access them.

See also: https://stackoverflow.com/a/70368135

What does ncdump say about these URLs?

-- 
Best regards,
Ivan

[1] 

__
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] Rate of Reading into R from net

2022-11-14 Thread Nick Wray
Hello I am trying read  nc rainfall  files directly from the UK centre for
hydrology and ecology website -
hourly:about 300Mb
https://catalogue.ceh.ac.uk/datastore/eidchub/fc9423d6-3d54-467f-bb2b-fc7357a3941f/
and daily about 90Mb
https://catalogue.ceh.ac.uk/datastore/eidchub/2ab15bf0-ad08-415c-ba64-831168be7293/precip/

I can download them "by hand" no problem using the ncdf4 package but
there's lots and I wanted to streamline the process

code I've used (which works for "by hand" downloading) is (for example)

nc_data<-nc_open("
https://catalogue.ceh.ac.uk/datastore/eidchub/2ab15bf0-ad08-415c-ba64-831168be7293/precip/chess-met_precip_gb_1km_daily_19610301-19610331.nc
")

However, when I run this I don't get an error message but R just sits there
with the little red circle (at least 30 minutes for the 90Mb files)

What I'm wondering is two things - a)is the data in fact downloading but
it's just taking ages and I need to let it run and go and have a coffee
   b)is there (I can't find
anything) within R which allows me to monitor the progress of the download,
if in fact it is taking place?
Thanks Nick Wray

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