Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9143759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T10:06:15+00:00 2026-06-17T10:06:15+00:00

Hi I have been trying to create the simple contours using the simple data

  • 0

Hi I have been trying to create the simple contours using the simple data set.

The dataset used is as follows:

 dput(elevation)
structure(list(x = c(1L, 2L, 3L, 5L, 10L, 12L, 13L, 9L), y = c(5L, 
20L, 18L, 25L, 31L, 25L, 8L, 12L), z = c(5L, 10L, 15L, 8L, 7L, 
6L, 2L, 4L)), .Names = c("x", "y", "z"), class = "data.frame", row.names = c("1", 
"2", "3", "4", "5", "6", "7", "8"))

I just combined the above data to a file named elevation.csv

I used loess and expand.grid function to do the interpolation. How do we choose the degree and span in the loess model ?

The code I used to plot is as follows:

require(ggplot2)    
require(geoR)
elevation <- read.table("elevation.csv",header=TRUE, sep=",")
elevation

elevation.df <- data.frame(x=elevation$x,y=elevation$y,z=5*elevation$z)
elevation.df
elevation.loess=loess(z~x*y, data=elevation.df,degree=2,span=0.25)
elevation.fit=expand.grid(list(x=seq(1,13,2),y=seq(5,30,4)))
elevation.fit[1:20,]
z = predict(elevation.loess,newdata=elevation.fit)
elevation.fit$Height=as.numeric(z)
v <- ggplot(elevation.fit,aes(x,y,z=Height))
v1 <- v+stat_contour(aes(colour=..level..))+geom_point(data=elevation.df,aes(x=x,y=y,z=z))
direct.label(v1)

I am not sure whether the result I got is the accurate result or not. Could anyone verify this result with any other technique and share the view ? Actually I have to work through a large dataset and want to start with simple things first.

The output I got with the above code is as follows:

enter image description here

Is this the good method to handle the large number of dataset ?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T10:06:16+00:00Added an answer on June 17, 2026 at 10:06 am

    I get this … after warnings and an error about no function named direct.label:

    Warning messages:
    1: In simpleLoess(y, x, w, span, degree, parametric, drop.square, normalize,  :
      span too small.   fewer data values than degrees of freedom.
    2: In simpleLoess(y, x, w, span, degree, parametric, drop.square, normalize,  :
      pseudoinverse used at 0.23095 0.70587
    3: In simpleLoess(y, x, w, span, degree, parametric, drop.square, normalize,  :
      neighborhood radius 1.9692
    4: In simpleLoess(y, x, w, span, degree, parametric, drop.square, normalize,  :
      reciprocal condition number  0
    5: In simpleLoess(y, x, w, span, degree, parametric, drop.square, normalize,  :
      There are other near singularities as well. 2.063
    

    enter image description here

    What is “correct ” in this data-impoverished situation is a matter of judgment. With such a spotty coverage of the 2D range, I would consider labeling the z value of the points. The warnings are signs that the mathematics are getting “stressed”. I think it suggests a problem in the area above y = 30.

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to create an XML using the simplexml library (v2.6.2) http://simple.sourceforge.net/home.php
I have been trying to create a simple calculator. Using PHP I managed to
I have been trying to create a simple program with Python which uses OpenCV
I have been trying to create a ListView which I can sort using drag
I have been trying to create an observable tweeter feed using tweetsharp with the
I have been trying to learn node.js. I am trying to create a simple
I've been trying to create simple script that swaps table data based on the
I have been trying to create a simple point light in HLSL for a
I have been trying to create a simple application that will let the user
Hello Guys! I have been trying to create a simple sample code for my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.