Displaying 20 results from an estimated 2000 matches similar to: "split strings"
2008 Mar 31
1
unexpected GAM result - at least for me!
Hi
I am afraid i am not understanding something very fundamental.... and does not matter how much i am looking into the book "Generalized Additive Models" of S. Wood i still don't understand my result.
I am trying to model presence / absence (presence = 1, absence = 0) of a species using some lidar metrics (i have 4 of these). I am using different models and such .... and when i
2008 Mar 27
1
dreaded p-val for d^2 of a glm / gam
OK,
I really dread to ask that .... much more that I know some discussion about p-values and if they are relevant for regressions were already on the list. I know to get p-val of regression coefficients - this is not a problem. But unfortunately one editor of a journal where i would like to publish some results insists in giving p-values for the squared deviance i get out from different glm and
2007 Sep 06
1
write geotiff with projection - RGDAL package
Hi,
Doing more search i've discovered package RGDAL that can write a geotiff file with projection. I saved a geotiff file in UTM projection and if i read the file back in R and check the projection seems that everything is OK. But if i load the file in ArcGIS (ESRI product) i get the warning that the file is missing spatial reference so it cannot be projected, but it is displayed correctly.
2007 Sep 05
1
geotiff or tiff files with world files
Hi,
I have a matrix of data which i can vizualize as an image - for example. I would like to save this image as a geotiff file or at a tiff file with a world file which holds the projection of my data (ultimately the data represent a map of some sort). I know i can save the data as an ESRI grid, but i am not interested in that.
I wonder if anybody knows about any code which will help me do
2007 Aug 02
6
- round() strange behaviour
Hi,
I am getting some strange results using round - it seems that it depends if the number before the decimal point is odd or even ....
For example:
> round(1.5)[1] 2> round(2.5)[1] 2
While i would expect that round(2.5) be 3 and not 2.
Do you have any explanation for that?
I really appreciate your input,
Monica
2007 Dec 13
6
spliting strings ...
Hi everyone,
I have a vector of strings, each string made up by different number of words. I want to get a new vector which has only the first word of each string in the first vector. I came up with this:
str <- c('aaa bbb', 'cc', 'd eee aa', 'mmm o n')
str1 <- rep(1, length(str))
for (i in 1:length(str)) {
str1[i] <- strsplit(str, "
2008 May 22
15
Pros and Cons of R
Hi,
I am doing a very informal presentation for my office about R capabilities to deal with and analyze spatial data, display data and maps, and connections with GIS. I've used in my presentation info from the CRAN, the spatial Task view, and the more striking graphics examples from http://addictedtor.free.fr/graphiques/thumbs.php and NCEAS
2011 Nov 22
5
x, y for point of intersection
Hi everyone,
?
I am trying to get a point of intersection between a
polyline and a straight line ?.. and get the x and y coordinates of this point.
For exemplification consider this:
?
?
set.seed(123)
?
k1 <-rnorm(100, mean=1.77, sd=3.33)
?k1 <- sort(k1)
q1 <- rnorm(100, mean=2.37, sd=0.74)
q1 <- sort(q1, decreasing = TRUE)
plot(k1, q1, xlim <- c((min(k1)-5),
2008 Jul 23
2
Warning message in if else statement
Hi,
I am using an if else statement inside a function ?. If I use that function I have no problems ?. If I use the function with the if else statement inside a second function I get the following waring:
Warning message:
In if (pval == 0) p_value <- "< 2.2e-16" else p_value <- pval :
the condition has length> 1 and only the first element will be used
Using the second
2006 Aug 31
4
problems with plot.data.frame
Hi list,
I have a question about 'plot'. I am trying to plot values registered every
month - or every other month. If i build a data.frame called mydata like
this (as an example)
jan 3 1 7
mar 2 4 2
may 1 3 2
jul 3 7 4
sep 5 2 3
nov 3 1 5
and use the command line:
plot(mydata[c(1,3)])
I get a graph that has on the x axis my months in alphabetical
2008 Mar 13
4
a more elegant way to get percentages?
Hi,
I am trying to get percentages in a more elegant way. I have a data.frame with locations and values (counts) of species at that location. Each location is repeated for each species i have values for and i would like to get percentages of each species at that location. I am not sure if i am clear in my explanations so i will paste my code below:
#####################
> x
locat val
1
2009 Feb 12
3
Aggregrate function
Hi,
I have to recognize that i don't fully understand the aggregate function, but i think it should help me with what i want to do.
xveg is a data.frame with location, species, and total for the species. Each location is repeated, once for every species present at that location. For each location i want to find out which species has the maximum total ... so i've tried different ways to
2007 Sep 06
2
larger decimal numbers get rounded ....
Hi,
I am sure there is a reason but ...... why larger decimal numbers get rounded to the nearest integer?
Example:
a <- 3308000.5
a
[1] 3308001
I would like my numbers to be decimals .... since they do represent coordinates and i don't want them rounded .... how can i keep them as they are?
Thanks,
Monica
_________________________________________________________________
2010 Nov 08
2
Error: could not find function "extract" in package raster
Hi,
I would like to use the function "extract" from package raster and i get the following error:
m01e <- extract(marsh01, p)
Error: could not find function "extract"
marsh01 is a raster object and p is an intersectExtent object that is not null.
The package is installed and loaded, i use a Windows machine 64 bit and R x64 2.11.0. Do i really need to update my R to use
2010 Nov 24
3
Custom ticks on x axis when dates are involved
Hi,
I have a set of irregular time series and i want to produce a simple plot, with dates on x axis and attribute value of y axis. This is simple enough but my x axis is divided automatically by ticks every 5 years. I would like to have a tick every year at January 1st. I am not sure how i can do that - i end up with something very close to what i want, but it is clunky and not very correct. I
2009 Feb 17
4
joining "one-to-many"
Hello list,
I am wondering if a joining "one-to-many" can be done a little bit easier. I tried merge function but I was not able to do it, so I end up using for and if.
Suppose you have a table with locations, each location repeated several times, and some attributes at that location. The second table has the same locations, but only once with a different set of attributes. I would
2008 Apr 18
2
Correspondence and detrended correspondence analysis
Hi,
I hope someone knows the answer to this or has a real good reference about it (I am using Legendre & Legendre, Numerical Ecology, 1998).... My data is a data.frame with locations as rows and vegetation assemblages / species as columns. I've done a PCA, a correspondance analysis (CA) using ca in ca package and a detrended correspondance analysis (DCA) using decorana from vegan package.
2008 Aug 11
2
: bquote inside legend()
Hi,
I have a graph and I would like to write some values inside the legend that were saved in a variable. Please revise the code below in which I've wrote 2 different legends, but I am not happy with either of them. What I want is a legend with tile "Legend" and underneath a line with a name and a value like that: value = 2.
#Code begin:
# -------------------
a = 2 # result of a
2007 Aug 10
2
Cleaning up the memory
Hi,
I have 4 huge tables on which i want to do a PCA analysis and a kmean clustering. If i run each table individually i have no problems, but if i want to run it in a for loop i exceed the memory alocation after the second table, even if i save the results as a csv table and i clean up all the big objects with rm command. To me it seems that even if i don't have the objects anymore, the
2007 Sep 07
2
confusion matrix - better code?
Hi,
I’ve written some code to obtain a confusion matrix when the true classification and the predicted classification are known. Suppose true classification is called “tr” and predicted classification is “pr”. I have 4 classes in tr, but only 3 classes out of 4 are predicted in “pr”. Following is my code, but looks quite “clunky” to me. I wonder if you have any suggestions to improve it.