[R] Fwd: fields package question

Eric Berger ericjberger @ending from gm@il@com
Wed Dec 26 17:52:46 CET 2018


Forwarding to the full R-help list.
The protocol is for everyone to see the full set of questions and answers.
This allows for:
    1. more people to contribute, which generally improves the quality of
the answer
    2. people with similar questions can find this thread via search and
see the full discussion

---------- Forwarded message ---------
From: M P <mzp3769 using gmail.com>
Date: Wed, Dec 26, 2018 at 6:32 PM
Subject: Re: [R] fields package question
To: Eric Berger <ericjberger using gmail.com>


Thanks, dput outputs below. I'd like to evaluate surface e.g. at (-10.5,
0.935)
> dput(x)
structure(c(-10.9251387646973, -10.8977397823155, -10.8197783096724,
-10.7568035566262, -10.701995233594, -10.5966347583582, -10.4868838826637,
-10.4143132015642, -10.2601624697659, -10.1266311291125), .Dim = 10L)
> dput(y)
structure(c(0.899999976158142, 0.910000026226044, 0.920000016689301,
0.930000007152557, 0.939999997615814, 0.949999988079071, 0.959999978542328,
0.970000028610229, 0.980000019073486, 0.990000009536743), .Dim = 10L)
> dput(z)
structure(c(0.0170888844877481, 0.0163554549217224, 0.0143800554797053,
0.0132564017549157, 0.0123229259625077, 0.0108034228906035,
0.00943510234355927,
0.00868543982505798, 0.00763010373339057, 0.00705513963475823,
0.0173761900514364, 0.0166240241378546, 0.0145960496738553,
0.0134453792124987,
0.0124927284196019, 0.0109430542215705, 0.00954837258905172,
0.00878583826124668, 0.00772488862276077, 0.00716213695704937,
0.0178007110953331, 0.0170208644121885, 0.0149147948250175,
0.0137240244075656,
0.0127429272979498, 0.0111485198140144, 0.0097147086635232,
0.00893292296677828,
0.00786342192441225, 0.00731897540390491, 0.0180797930806875,
0.0172817632555962, 0.0151241403073072, 0.0139069128781557,
0.012907050549984,
0.0112831527367234, 0.0098235122859478, 0.00902892742305994,
0.00795362330973148, 0.00742132356390357, 0.0186295621097088,
0.0177957788109779, 0.015536243095994, 0.014266736805439,
0.0132297882810235,
0.0115476427599788, 0.0100369155406952, 0.00921681523323059,
0.00812961626797915, 0.00762135302647948, 0.0190353523939848,
0.0181752592325211, 0.0158403068780899, 0.0145321246236563,
0.0134677225723863,
0.0117424847558141, 0.0101939048618078, 0.00935473665595055,
0.00825834088027477, 0.00776780024170876, 0.0190353523939848,
0.0181752592325211, 0.0158403068780899, 0.0145321246236563,
0.0134677225723863,
0.0117424847558141, 0.0101939048618078, 0.00935473665595055,
0.00825834088027477, 0.00776780024170876, 0.0190353523939848,
0.0181752592325211, 0.0158403068780899, 0.0145321246236563,
0.0134677225723863,
0.0117424847558141, 0.0101939048618078, 0.00935473665595055,
0.00825834088027477, 0.00776780024170876, 0.0190353523939848,
0.0181752592325211, 0.0158403068780899, 0.0145321246236563,
0.0134677225723863,
0.0117424847558141, 0.0101939048618078, 0.00935473665595055,
0.00825834088027477, 0.00776780024170876, 0.0190353523939848,
0.0181752592325211, 0.0158403068780899, 0.0145321246236563,
0.0134677225723863,
0.0117424847558141, 0.0101939048618078, 0.00935473665595055,
0.00825834088027477, 0.00776780024170876), .Dim = c(10L, 10L))

On Wed, Dec 26, 2018 at 1:24 AM Eric Berger <ericjberger using gmail.com> wrote:
>
> In your printing out of z your copy-paste effort seems to have missed
columns 1-7 of rows 1-4.
> It would be better if you would provide the data by using the dput()
function, as in:
> dput(y)
> dput(z)
>
> then copy-paste the output from that.
>
>
> On Wed, Dec 26, 2018 at 1:50 AM M P <mzp3769 using gmail.com> wrote:
>>
>> Actually, let's set it
>> grid_new.l <- list(abcissa=c(-15.0,-14.5),ordinate=y)
>> to avoid out of bounds
>>
>> On Tue, Dec 25, 2018 at 4:41 PM M P <mzp3769 using gmail.com> wrote:
>>>
>>> Thanks, Eric, for looking into that.
>>> The values are below and since I subset the new abcissa  is smaller
range
>>> grid_new.l <- list(abcissa=c(-15.0,-14.),ordinate=y)
>>> I am emailing form gmail - don't know why is using html to format when
all is in ascii
>>>
>>> x
>>>  [1] -15.20180 -15.01948 -14.86533 -14.73180 -14.61402 -14.50866
-14.41335
>>>  [8] -14.32634 -14.24629 -14.17219
>>> y
>>>  [1] 0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45
>>> z
>>> [5,] 0.6467642 0.6467642 0.6467642 0.6467642 0.6467642 0.6467642
0.6467642
>>>  [6,] 0.5597143 0.5597143 0.5597143 0.5597143 0.5597143 0.5597143
0.5597143
>>>  [7,] 0.4854133 0.4854133 0.4854133 0.4854133 0.4854133 0.4854133
0.4854133
>>>  [8,] 0.4278326 0.4278326 0.4278326 0.4278326 0.4278326 0.4278326
0.4278326
>>>  [9,] 0.3834149 0.3834149 0.3834149 0.3834149 0.3834149 0.3834149
0.3834149
>>> [10,] 0.3433031 0.3433031 0.3433031 0.3433031 0.3433031 0.3433031
0.3433031
>>>            [,8]      [,9]     [,10]
>>>  [1,] 1.1900951 1.1900951 1.1900951
>>>  [2,] 1.0636935 1.0636935 1.0636935
>>>  [3,] 0.8927228 0.8927228 0.8927228
>>>  [4,] 0.7554456 0.7554456 0.7554456
>>>  [5,] 0.6467642 0.6467642 0.6467642
>>>  [6,] 0.5597143 0.5597143 0.5597143
>>>  [7,] 0.4854133 0.4854133 0.4854133
>>>  [8,] 0.4278326 0.4278326 0.4278326
>>>  [9,] 0.3834149 0.3834149 0.3834149
>>> [10,] 0.3433031 0.3433031 0.3433031
>>>
>>>
>>>
>>> On Tue, Dec 25, 2018 at 12:45 AM Eric Berger <ericjberger using gmail.com>
wrote:
>>>>
>>>> Since you don't provide lambda, rh or qext it is impossible to
reproduce what you are seeing.
>>>> Also note that in this mailing list HTML formatted emails are not
passed along.
>>>>
>>>>
>>>>
>>>> On Tue, Dec 25, 2018 at 4:13 AM M P <mzp3769 using gmail.com> wrote:
>>>>>
>>>>> Hello,
>>>>> I used commands below to obtain a surface, can plot it and all looks
as
>>>>> expected.
>>>>> How do I evaluate values at new point. I tried as below but that
produces
>>>>> errors.
>>>>> Thanks for suggestions/help.
>>>>>
>>>>> x <- log(lambda)
>>>>> y <- rh
>>>>> z <- qext[,,2]
>>>>>
>>>>> grid.l <- list(abcissa=x,ordinate=y)
>>>>> xg <- make.surface.grid(grid.l)
>>>>> out.p <- as.surface(xg,z)
>>>>> plot.surface(out.p,type="p")
>>>>>
>>>>> tried:
>>>>> grid_new.l <- list(abcissa=c(-15.0,-10.),ordinate=y)
>>>>> xg_new <- make.surface.grid(grid_new.l)
>>>>>
>>>>> out_new.p <- predict.surface(out.p,xg_new)
>>>>>
>>>>> results in this prompt:
>>>>> predict.surface is now the function predictSurface>
>>>>>
>>>>>         [[alternative HTML version deleted]]
>>>>>
>>>>> ______________________________________________
>>>>> R-help using 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]]



More information about the R-help mailing list