Displaying 20 results from an estimated 100 matches similar to: "automating a script to read a file"
2012 Sep 24
2
Latitude Longitude to SPDF
Hi Team,
Need your guidance in building SPDF objects from Latitude, Longitude
Information available.
I am using package "plotGoogleMaps" which is really awesome but it requires
SPDF objects to build the maps.
I have a data frame which have Latitude and Longitude information and
wanted to convert it in SPDF for making maps.
Please help me to find suitable package or function to convert
2013 Sep 19
3
lattice: double y - problem changing axis color after doubleYScale
Hi,
I have had some troubles using doubleYScale. No matter what I try, I cant manage to change the color of the y-axis in the end. I have to produce a black and white plot. There is also something I do not understand regarding fontfamilyj="serif" when using it in:
strip=strip.custom()
Maybe someone has a better idea for defining which line and dots belong to which y-axis when not using
2012 Aug 13
1
Fine Tuning Country Map
Dear All,
Please see the short script at the end of the email, which I assembled
looking for bits and pieces on the web.
It essentially does what I need: it plots several countries as a
color-coded map.
I just would like to fine-tune a bit the final image, in particular
(1) Select my own colors for "painting" the countries (i.e. associate
manually a color to every level)
(2) Be
2010 Dec 09
4
String to array
Hello,
how convert x in xarray (numbers)?
> x
[1] "0 - 13"
> y
[1] "11 - 23"
> z
[1] "220 - 9"
> xarray
[1] 0 13
> yarray
[1] 11 23
> zarray
[1] 220 9
Thanks,
RMB
2011 Apr 13
2
FW: how to enclose two xyplot
Dear R-users,
I have to plot two xyplot, and I wish to enclose this two graphs with just one headline, the same x scale, the same grid etc.
These parameters should tie in, in order to obtain, visually, a unique graph formed by two xyplot.
I try to give an idea:
xyplot1: |_|_|_|
xyplot2: |_|_|_|
what i want: | | | |
|_|_|_|
I tried to use the command
2013 Jan 04
1
SpatialPolygon with the max value gets no color assigned in spplot function when using "at" parameter
Hi,
I would like to do coloring of map regions based on the region values
"weight". The approach I am taking is first to break regions into equal
intervals,
classIntervals(spdf$weight,4)$brks #4 intervals in this case
and coloring all regions within the interval with the same color
col = brewer.pal(4,"RdYlGn"))
The max "weight" is as well the boundary of the
2010 Jul 07
0
subscripts for panel.superpose in lattice
Hi,
I am trying to superimpose (overlay) regression lines to scatter plots
by groups with xyplot (dysfunctional code below). However, my call of
panel.superpose breaks down because of the subscripts requirement. I
tried to research the documentation and examples, but I cannot figure
out how to make xyplot plug subscripts to a panel... call. Could you
have a look? It would be greatly appreciated.
2012 Mar 16
3
Y-axis label on the right hand side in lattice?
Hello,
Is there a way to add ylab on the right hand side also (in lattice)?
Different from the left hand side?
Cheers
Saptarshi
[[alternative HTML version deleted]]
2009 Aug 30
1
Trying to rename spatial pts data frame slot that isn't a slot()
Dear List,
I am analyzing the home range area of fish and seem to have lost the individuals ID names during my manipulations, and can't find out how to rename them. I calculated the MCP of the fish using mcp() in Adehabitat. MCP's were converted to spatial points data frame and exported to qGIS for manipulations. At this point the ID names were lost. I brought the manipulated
2010 Apr 19
2
Overlay of barchart and xyplot
Hello R Folks,
I am new to R. I have been struggling to overlay a barchart with a
xyplot together on one plot but did not get this worked out. Any help
and idea are greatly appreciated.
I attached R scripts for barchart and xyplot below and also data I used.
What I am trying to do is just to put the barchart and xyplot together
on one plot.
Huapeng
<<dispersal_infestation.csv>>
2017 Nov 23
0
How to produce rainfall maps
Thank you Sarah and Mike for your explanations.
My final objective is to produce maps (png image or any kind of extension I can import in LaTeX) where rainfall data are interpolated, using the Inverse Distance method or Kriging.
My input file (pointfile.csv in the reported example) reports the station code, lat and long of the meteorological station and the rainfall value (which might be the
2012 Jul 20
1
Dissolve polygon
Hi,
I am working with a SpatialPolygonsDataFrame of many islands. There are a
lot of polygons (islands) composing my SpatialPolygonsDataFrame.
I want to extract the elevation of each island.
I need to separate the different polygons (like dissolve function in
arcgis), to have the elevation of each island.
Do you have any idea how can I do that ?
I already read a lot of forum, and read the
2006 Jan 07
1
maptools, write.polylistShape
Dear Roger,
I am trying to use the write.polylistShape() function of maptools for
the first time and realize that it handles list of polygons of class
'polylist'. However, it seems that no as.polylist() function exist in
the package. The question behind that is: in your opinion, which would
be the best way to convert a list of matrix of polygon nodes
coordinates into an object of
2009 Jul 10
2
while( ) to get a vector until the sum of elements are <= X ?
I have a vector of values
X = seq(1:10)
I want to get another vector V of with sample (with replacement) of X but
with a constrain: V will have as much elements as those necessary to V sum
exactly 10.
If the N-th value of V make the sum greater than 10, it's is subtracted with
the difference to achieve the constrain.
I don't know how to achieve this. with a while?
2009 Jan 15
1
misalignment of x-axis when overlaying two plots using latticeExtra
Dear R-helpers:
I am an entry-level R user and have a question related to overlaying a
barchart and and a xyplot using latticeExtra.
My problem is that when I overlay them I fail to align their x-axes.
I show my problem below through an example.
#the example data frame is provided below
vec <-c(1,5.056656,0.5977967,0.06126587,0.08557778,
2,4.601049,0.5995989,0.05002188,0.11410027,
2015 Aug 04
2
Duda interpolación (package ' gstat ')
Hola,
# Hacemos el KED. Ver función "krige()":
KED.rad <- krige(
formula=pluvPcp~layer, # covariable -> radar
locations=lluvia.rad.pluv.spdf,
newdata=radarGrid, # podría ser cualquier objeto Spatial
model=v.fit, # modelo de semivariograma.
maxdist=Inf
2017 Nov 22
2
How to produce rainfall maps
Fwiw the engine behind geom_raster needs explicit observation-per-row form
for input (with no structural normalization), so conversion to points is
perfectly proper here, albeit confusing in context. (It's closer to what
graphics devices actually use ultimately, but the expansion is laid out
very early in ggplot2 because there's no standard for intermediate forms.)
Cheers, Mike
On Wed,
2009 Dec 11
3
Please help with a basic function
Hello,
I am learning how to use functions, but I'm running into a roadblock.
I would like my function to do two things: 1) convert an object to a
dataframe, 2) and then subset the dataframe. Both of these commands work
fine outside the function, but I would like to wrap them in a function so I
can apply the code iteratively to many such objects.
Here's what I wrote, but it doesn't
2008 Jul 08
0
Multiple Plots and y Axis Labels
Hi,
I'm using the mfrow parameter in par() to plot several timeseries with a
common time x axis as a sequence of plots one below the other. I reduced
the top and bottom margins to zero to get a very nice looking plot but
sometimes the labels on the y axes from one plot overlap with the y axis
labels on the plot above or below.
Any ideas how I can prevent this without losing the look of the
2017 Oct 11
1
Iterate in a Spatial Polygon Dataframe in R?
Hi all,
?I'm trying to iterate in a SpatialPolygonDataFrame thatcontains 110 features. I tried to use the following code?
iterate.spdf =function(x){ for (i in 1:nrow(x)){ p = x[i, ]} return(p)}
but with no success as it returns with aSpatialPolygonDataFrame that contains onlyone feature. The code seems to overwrite the polygons to end up with only onefeature.
?Any suggestions?Ashraf, cheers