Re: [R] Systemfit Question

2018-05-16 Thread Spencer Graves
  I got an error when I tried to source the "structure" below beginning with "Empdata <- structure(list(country = structure(c(1L, 1L, 1L, 1L, 1L, 1L,":  The source ended with " "98", "983", "991", "995", "997"), + + + + + +  )) +"   I supplied ")" a

[R] Systemfit Question

2018-05-16 Thread Ngwinui Azenui
I can't get my simultaneous equations to work using system fit. Please help. #Reproducible script Empdata<- read.csv("/Users/ngwinuiazenui/Documents/UPLOADemp.csv") View(Empdata) str(Empdata) Empdata$gnipc<-as.numeric(Empdata$gnipc) install.packages("systemfit") library("systemfit") pdata <- plm.d

Re: [R] Installing an Archived Package

2018-05-16 Thread Duncan Murdoch
On 16/05/2018 2:15 PM, Evguenia Ignatova wrote: Hello again, I did not expect the browser to automatically extract, so I changed the Safari setting and it downloaded as a “gz” file. It is clear now that R is finding the package but I get a different error as follows: install.packages("polyc

Re: [R] Installing an Archived Package

2018-05-16 Thread Rui Barradas
Hello, I downloaded the file "polycor_0.7-8.tar.gz" from CRAN with Mozilla Firefox and then ran gzFile <- file.choose() install.packages(gzFile, repos=NULL, type="source") and it worked at the first try. Hope this helps, Rui Barradas On 5/16/2018 6:26 PM, William Dunlap via R-help wrote:

Re: [R] Installing an Archived Package

2018-05-16 Thread Evguenia Ignatova
Excellent - I will know where to look for the required packages next time. I actually was able to install everything successfully in Sierra in the end, interestingly enough. Found the plain text option and will definitely post to the Mac-specific mailing list when appropriate. Thank you, Evgu

Re: [R] Installing an Archived Package

2018-05-16 Thread David Winsemius
> On May 16, 2018, at 2:15 PM, Evguenia Ignatova wrote: > > Hello again, > > I did not expect the browser to automatically extract, so I changed the > Safari setting and it downloaded as a “gz” file. > > It is clear now that R is finding the package but I get a different error as > follows:

Re: [R] Installing an Archived Package

2018-05-16 Thread Evguenia Ignatova
Great to know! I installed mvtnorm and everything installed like a charm after. SPSS executed the package smoothly, too. Thank you so much again for all your help - this really saved me! All the best, Evguenia > On May 16, 2018, at 2:34 PM, Duncan Murdoch wrote: > > On 16/05/2018 2:15 PM, Evg

Re: [R] Installing an Archived Package

2018-05-16 Thread Evguenia Ignatova
Hello again, I did not expect the browser to automatically extract, so I changed the Safari setting and it downloaded as a “gz” file. It is clear now that R is finding the package but I get a different error as follows: > install.packages("polycor_0.7-8.tar.gz", repos=NULL, type="source") ERRO

Re: [R] Installing an Archived Package

2018-05-16 Thread Richard M. Heiberger
You can tell Macintosh not to automatically unpack tar.gz files. https://apple.stackexchange.com/questions/961/how-to-stop-safari-from-unzipping-files-after-download On Wed, May 16, 2018 at 11:24 AM, Evguenia Ignatova wrote: > Hello, > > I am having difficulty installing the most recent compati

Re: [R] Installing an Archived Package

2018-05-16 Thread William Dunlap via R-help
install.packages("/polycor_0.7-8.tar.gz", repos=NULL, type="source") The initial slash would be a problem - it means to find poglycor_0.7.8.tar.gz in the root directory. Remove the slash, find where the tar.gz file was put, and try using that location. Recall the destdir setting you used in

Re: [R] Installing an Archived Package

2018-05-16 Thread Michael Dewey
Dear Evguenia In that case the program you are using to download is being helpful and unzipping the archive for you. You could replace helpful with irritating in that sentence. You need to try another downloader. Michael On 16/05/2018 18:11, Evguenia Ignatova wrote: Hello Michael and Duncan

Re: [R] Installing an Archived Package

2018-05-16 Thread Evguenia Ignatova
Hello Michael and Duncan, Thank you for your pointers. The file downloaded without the “gz” extension to my R working directory folder as a “tar” file. I did not unpack the file. I tried renaming the file and running the code with “gz” added - please see below. > install.packages("/polycor_0.7-

Re: [R] Installing an Archived Package

2018-05-16 Thread Duncan Murdoch
On 16/05/2018 11:24 AM, Evguenia Ignatova wrote: Hello, I am having difficulty installing the most recent compatible version of the “polycor" package (0.7-8), for R 3.2.1 on my Mac. Here is the package source page: https://cran.r-project.org/src/contrib/Archive/polycor/

Re: [R] Installing an Archived Package

2018-05-16 Thread Michael Dewey
Dear Evguenia What happens if you manually download the version you want and run install.packages() on that file? Your first attempt is on a .tar file not on the tar.gz file in the archive, not sure if that makes a difference. Michael On 16/05/2018 16:24, Evguenia Ignatova wrote: Hello, I

Re: [R] Raster extract by polygon generating NAs

2018-05-16 Thread Bert Gunter
Better posted on the r-sig-geo list, I think. -- 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, May 16, 2018 at 8:11 AM, Joao Carreiras wrote: >

[R] Installing an Archived Package

2018-05-16 Thread Evguenia Ignatova
Hello, I am having difficulty installing the most recent compatible version of the “polycor" package (0.7-8), for R 3.2.1 on my Mac. Here is the package source page: https://cran.r-project.org/src/contrib/Archive/polycor/ . This version

[R] Raster extract by polygon generating NAs

2018-05-16 Thread Joao Carreiras
Greetings! I'm using the extract command (raster package) with a raster layer (x) and a spatial polygons dataframe (y). I'm using it to extract the sum of raster values by each spatial polygon. However, I'm getting NAs as a result for some polygon IDs, which I know isn't true because that doesn't

Re: [R] Bilateral matrix

2018-05-16 Thread Bert Gunter
xtabs does this automatically if your cross classifying variables are factors with levels all the cities (sorted, if you like): > x <- sample(letters[1:5],8, rep=TRUE) > y <- sample(letters[1:5],8,rep=TRUE) > xtabs(~ x + y) y x c d e a 1 0 0 b 0 0 1 c 1 0 0 d 1 1 1 e 1 1 0 > lvls

Re: [R] Bilateral matrix

2018-05-16 Thread William Dunlap via R-help
Make current_location and previous_location factors with the same set of levels. The levels could be the union of the values in the two columns or a predetermined list. E.g., > x <- data.frame(previous_location=c("Mount Vernon","Burlington"), current_location=c("Sedro Woolley","Burlington")) > a

Re: [R] Bilateral matrix

2018-05-16 Thread Miluji Sb
Dear Bert and Huzefa, Apologies for the late reply, my account got hacked and I have just managed to recover it. Thank you very much for your replies and the solutions. Both work well. I was wondering if there was any way to ensure (force) that all possible combinations show up in the output. Th

Re: [R] How to average values from grid cells with coordinates

2018-05-16 Thread Jim Lemon
Hi lily, There are one or two assumptions to be made here. First is that the latitude and longitude values of the "black" cells are equally spaced as in your illustration. Second, that all latitude and longitude values for the "red" cells fall at the corners of four "black" cells. You can get the