by Celeste » Sat Dec 22, 2012 1:27 am
It still won't run. Here is my code.
# RGeoS package
# 1.) Load RGeoS library
library(RGeoS)
library(e1071)
library(gstat)
library(fBasics)
library(R2HTML)
library(xtable)
# 2.) Set working directory
setwd("F:/laptop_07182012/masters")
# 3.) Build database from ASCII
gold1.table<-read.table("rbow_au.csv",header=T,na.strings="-1.00E+30",sep=",",colClasses="numeric")
#gold1.table<-read.table("rbow_au.csv",header=T,na.strings="-1.00E+30",sep=",",colClasses="numeric")
#gold1.table<-read.table("spur_box.csv",header=T,na.strings="-1.00E+30",sep=",",colClasses="numeric")
#gold1.table<-read.table("dstar_box.csv",header=T,na.strings="-1.00E+30",sep=",",colClasses="numeric")
head(gold1.table,n=10)
#Subset Data for variography
gold1.tablesub<-subset(gold1.table,AU>0.003)
head(gold1.tablesub,n=10)
# 4a.) First had to turn all znils into missing values that R could read
###Recode -1e+30 to missing = NA
#gold1.table[gold1$Au==-1e+30,"Au"] <- NA
#Don't need to do this due to the above step
# 4b.) Creating a database
gold1data.db<-db.create(gold1.table,flag.grid=FALSE,ndim=3,autoname=F)
gold1data.db
gold1.vario2<-vario.calc(gold1data.db,lag=100,nlag=8,tolang=15,dir=c(0,15,30,45,60,75,90),calcul="vg")
gold2.model<-model.auto(gold1.vario2,struct=c("Nugget Effect","Spherical"),
title="Modelling Variogram with Nugget Effect and Spherical Structure",xlab="Variance",
ylab="Distance")
#Variogram Maps
#set spatial coordinates
grid <- db.create(flag.grid=T,nx=c(100,100,100))
grid <- simtub(,grid,model=gold2.model,nbtuba=1000)
dbmap <- vmap.grid(grid,nx=30,ny=30)
The dbmap (vmap.grid) freezes my computer and I have a new Dell with 8 GB RAM.
Please let me know if you can help me. Thank you.