Displaying 20 results from an estimated 20000 matches similar to: "t.test in a loop"
2009 Jan 28
3
for/if loop
Hi, it's my first time to write a loop with R for my homework. This loop is
part of the function. I wanna assign values for hll according to panel
[ii,1]=pp. I didn't get any error message in this part. but then when I
further calculate another stuff with hll, the function can't return. I think
it must be some problem in my loop. Probably something stupid or easy. But I
tried to look
2009 Jan 28
3
initial value in 'vmmin' is not finite
Dear r helpers
I run the following code for nested logit and got a message that
Error in optim(c(0, 0, 0, 0, 0.1, -2, -0.2), fr, hessian = TRUE, method = "BFGS") : initial value in 'vmmin' is not finite
What does this mean? and how can I correct it?
Thank you
June
> yogurt = read.table("yogurtnp.csv", header=F,sep=",")> attach(yogurt)>
2009 Mar 02
1
initial gradient and vmmin not finite
Dear Rhelpers
I have the problem with initial values, could you please tell me how to solve it?
Thank you
June
> p = summary(maxLik(fr,start=c(0,0,0,1,0,-25,-0.2)))
Error in maxRoutine(fn = logLik, grad = grad, hess = hess, start = start, :
NA in the initial gradient
> p = summary(maxLik(fr,start=c(0,0,0,1,0,-25,-0.2),method="BFGS"))
Error in optim(start, func, gr =
2007 Apr 04
5
how to image.plot a XY grid file into a lat-lon map
Hi All,
I have a netcdf gridded file with LCC projection. I can easily use
image.plot to visualize it. However, as the axises are in X,Y, not Lat and
Lon, I could not add state or country maps onto it (or lat lon information).
I do have a grid2d file that describes the lat and lon for each (X,Y) grid,
but the lat and lon are not regularly spaced, so I could not use image.plot.
Does anyone know
2012 Nov 20
2
[lattice] how to overlay a geographical map on a levelplot?
r-help lattice adepts:
I have a question which is somewhat geospatial, so I posted to r-sig-geo
rather than here:
https://stat.ethz.ch/pipermail/r-sig-geo/2012-November/016757.html
> summary: How to overlay a geographical map on each panel in a lattice
> (or Trellis), e.g., of levelplot's? Note I am not inquiring about
> creating choropleth maps[,]
which Sarkar 2008 covers quite
2018 Jan 24
2
Issue with concatenation of URL losing
Thank you for your help in advance.
I am trying to pull some data back from a web service
library(httr)
sample2 <- GET("https://elevation.mapzen.com/height?json={\"range\":false,\"shape\":[{\"lat\":40.7,\"lon\":-76.5}]}&api_key=mycode")
result2 <- content(sample2)
height <- result2$height[[1]]
I would like to put by own latitude
2018 May 20
1
How to average values from grid cells with coordinates
Hi lily,
It's not too hard to do it using dataframes. Getting the indexing
right is usually that hardest part:
# these values are the centers of the black cells
lat<-rep(28:38,11)
lon<-rep(98:108,each=11)
pop<-sample(80:200,121)
# just use the data.frame function
blackcells<-data.frame(lat=lat,lon=lon,pop=pop)
plot(0,type="n",xlim=c(97.5,108.5),ylim=c(27.5,38.5),
2010 Jan 05
3
R matching lat/lon pairs from two datasets?
Hello,
I am trying to match lat/lon from one dataset with the lat/lon from a
second dataset and use that rows data for calculations. I am using
match, but this is finding the first match and not comparing the pair,
how can I determine if the lat/lon are the same? See example below. Is
there a better way to determine to a matching pair of lat/lon values?
Example Datasets:
> data2
2009 Nov 10
3
NetCDF output in R
Dear CSAG R users,
I will be glad if someone can point out what I am doing wrong or not doing at all in this.
I am trying to write out netcdf file in R. I have 26 time step but only the first time step is written.
For example:
>library(ncdf)
>path <- '/home/work/'
>forecast <- open.ncdf(paste(path,'cam.1980.2005.nc',sep=""))
> fore <-
2009 Nov 10
3
NetCDF output in R
Dear CSAG R users,
I will be glad if someone can point out what I am doing wrong or not doing at all in this.
I am trying to write out netcdf file in R. I have 26 time step but only the first time step is written.
For example:
>library(ncdf)
>path <- '/home/work/'
>forecast <- open.ncdf(paste(path,'cam.1980.2005.nc',sep=""))
> fore <-
2018 May 16
5
How to average values from grid cells with coordinates
Hi R users,
I have a question about data processing. I have such a dataset, while each
black grid cell has a few attributes and the corresponding attribute
values. The latitude and longitude of the center of each grid cell are
given also.
Then I want to average the attribute values from four adjacent grid cells
to get the average value for the center of each red grid cell. Thus, there
are the
2013 Feb 22
3
Help xyplot
Hi Mackay and anybody
(a) Is it possible to select randomly (let say five grids) and plot?
(b) Is it possible to plot five nearest grid in one figure?
The original question and improved codes:
#I am ploting gridded time series data. I would like the actual lat
#and lon value appear on the graph-if possible inside the graph as
#numbers. If there is also more elegant ways to plot the graphs I
2009 Jan 22
1
convergence problem gamm / lme
Hope one of you could help with the following question/problem:
We would like to explain the spatial
distribution of juvenile fish. We have 2135 records, from 75 vessels
(code_tripnr) and 7 to 39 observations for each vessel, hence the random effect
for code_tripnr. The offset (‘offsetter’) accounts for the haul duration and
sub sampling factor. There are no extreme outliers in lat/lon. The model
2018 Jan 24
0
Issue with concatenation of URL losing
a) you need to read the help pages on the paste function... more likely
you are looking for the paste0 function because extra spaces will most
likely break the GET request format.
b) quotes do not become "stuck" as \" ... that is a visual representation
intended to clarify that that quote is not terminating the string but is
actually part of it. If you want to see the contents
2008 May 02
3
data transformation
Dear all,
how can I, with R, transform a presence-absence (0/1) matrix of species
occurrences into a presence-only table (3 columns) with the names of the
species (1st column), the lat information of the sites (2nd column) and
the lon information of the sites (3rd column), as given in the below
example?
Thanks a lot for your help!
Christian
my dataframe:
site lat lon spec1 spec2 spec3 spec4
2011 Jun 07
1
RgoogleMaps Axes
R Help,
I posted a question on StackOverflow yesterday regarding an issue I've been having with the RgoogleMaps packages' displaying of axes. ?Here is the text of that submission:
http://stackoverflow.com/questions/6258408/rgooglemaps-axes
"I can't find any documentation of the following problem I'm having with the axis labels in RGoogleMaps:
library(RgoogleMaps)
datas
2018 May 16
0
How to average values from grid cells with coordinates
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 four "black" cells by finding the lat/lon values that
are
2017 Aug 28
3
Extracting subset from netCDF file using lat/lon and converting into .csv in R
I have a series of nertCDF files containing global data for a particular
variable, e.g. tmin/tmax/precipiation/windspeed/relative
humuidity/radiation etc. I get the following information when using
*nc_open* function in R:
datafile: https://www.dropbox.com/s/xpo7zklcmtm3g5r/gfdl_preci.nc?dl=0
File gfdl_preci.nc (NC_FORMAT_NETCDF4_CLASSIC):
1 variables (excluding dimension variables):
2011 May 06
1
read a netcdf file _Fill_value=-32768
Hello
I am a new user of R .
and I ve problem with R and netcdf .
I succed installation , I could use all examples .
But when I take my netcf it is different .
I want to do statistic on this kind of file .
1)
first calculate mean .
my data is like that
through ncdump -h test.nc
netcdf test {
dimensions:
lat = 301 ;
lon = 401 ;
time = UNLIMITED ; // (80 currently)
2012 Jul 24
5
First value in a row
Hi.
This is likely a trivial problem but have not found a solution.
Imagine the following dataframe:
Lat Lon x1 x2 x3
01 10 NA NA .1
01 11 NA .2 .3
01 12 .4 .5 .6
I want to generate another column that consist of the first value in
each row from columns x1 to x3. That is
NewColumn
.1
.2
.4
Any input greatly appreciated,
Thanks,
Camilo
Camilo Mora, Ph.D.