similar to: By function

Displaying 20 results from an estimated 1300 matches similar to: "By function"

2012 Sep 25
2
Strange data frame behavior
Hello all, I don't understand a strange behavior in data frame manipulation. data_frame1 = data.frame(Site = c("S1", "S2", "S3", "S4", "L1", "L2", "L3", "L4"), Number = c(1, 3, 5, 2, 1, 1, 2, 1)) data_frame2 = data_frame1 [data_frame1$Site != "S1", ] dput (data_frame2) structure(list(Site =
2013 Oct 15
2
Data handling
Hello all, I'm having a problem with data handling. My input data is (dput in the after the signature): Date Time Fraction 06/19/13 22:15:39 0.3205 06/19/13 22:15:44 0.3205 06/19/13 22:15:49 0.3205 06/19/13 22:15:54 0.3205 06/19/13 22:15:59 0.3205 06/19/13 22:16:09 0.3205 Date in format month/day/year, Time in HH:MM:SS and fraction represents the fractions of
2012 Sep 18
2
Formula in a data-frame
Hello all, I'm new in R, and I have a data-frame like this (dput information below): Specie Fooditem Occurrence Volume 1 Schizodon vegetal 1 0.05 2 Schizodon sediment 1 0.60 3 Schizodon vegetal 1 0.15 4 Schizodon alga 1 0.05 5 Schizodon sediment 1 0.90 6 Schizodon
2012 Nov 23
2
Data frame manipulation
Hello, I have a table that was constructed in a wrong way (dput data on bottom - wrong data-frame): Local Mês Dia Colonia X6h X7h X8h X9h X10h X11h X12h X13h X14h X15h X16h X17h 1 Conceição Junho 1 3 2.16137 2.20412 2.08991 1.72428 1.69897 1.62325 1.44716 1.51851 1.43136 1.47712 1.51851 1.04139 2 Conceição Junho 2 3 2.46538 2.13672
2013 Feb 27
1
Separation issue in binary response models - glm, brglm, logistf
Dear all, I am encountering some issues with my data and need some help. I am trying to run glm analysis with a presence/absence variable as response variable and several explanatory variable (time, location, presence/absence data, abundance data). First I tried to use the glm() function, however I was having 2 warnings concerning glm.fit () : # 1: glm.fit: algorithm did not converge # 2:
2006 Sep 21
2
R data query
Dear Sir/Madam, I am encountering one of those alien computer momements one finds every so often in life. See the sequence below: > fish3.fis <-read.csv("emperor2.csv", check.names = TRUE, strip.white = TRUE) > colnames(fish3.fis) [1] "Month" "Year" "FishingArea" "SumOfTotalCatch" "CPUE" [6]
2012 May 05
3
alarm() doesn't beep
Dear all I'd like to make a beeping sound in R, but alarm() doesn't beep? I checked ?alarm but I couldn't find any pointers to system configuration. Any ideas? Regards Liviu > sessionInfo() R version 2.14.2 (2012-02-29) Platform: x86_64-pc-linux-gnu (64-bit) locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 [5]
2009 Aug 04
2
100% CPU when running (cran2deb) JGR on Debian
Dear all, I installed the amd64 cran2deb [1] JGR binaries on a fresh Debian testing, and JGR is missbehaving. When JGR starts up, one core of the CPU goes to 100% and stays there, even though I am keeping it idle and not performing any operation. I tried JGR with both sun-java6-jdk and openjdk-6-jdk, debian-liv:/home/liviu# update-alternatives --config java There are 4 choices for the alternative
2013 Apr 15
6
how to transform string to "Camel Case"?
Dear all, Given the following vector: > (z <- c('R project', 'hello world', 'something Else')) [1] "R project" "hello world" "something Else" I know how to obtain all capitals or all lower case letters: > tolower(z) [1] "r project" "hello world" "something else" > toupper(z) [1] "R
2011 Mar 06
4
sorting & subsetting a data.frame
Dear all This may be obvious, but I cannot get it working. I'm trying to subset & sort a data frame in one go. x <- iris x$Species1 <- as.character(x$Species) ##subsetting alone works fine with(x, x[Sepal.Length==6.7,]) ##sorting alone works fine with(x, x[order(Sepal.Length, rev(sort(Species1))),]) ##gets subsetted, but not sorted as expected with(x, x[(Sepal.Length==6.7) &
2009 Aug 20
4
expanding 1:12 months to Jan:Dec
Dear R users I would like to do some spreadsheet style expansion of dates. For example, I would need to obtain a vector of months. I approached in an obviously wrong way: > paste(01:12) [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" > as.Date(paste(01:12),
2009 Nov 10
1
Titles on panel graphs created in zoo
I have a plotted a stacked panel graph (single x axis and multiple y axis) using the package zoo and would like to add a title for each separate panel. I am using the script: z <- with(mydata,zoo(cbind(mydata$Water.level,mydata$Submerged.plants, mydata$Crayfish.CPUE,mydata$Carp.CPUE),Year)) plot(z,type="b",pch=16,lty=2,xlab="Year",ylab=c("Metres","Realtive
2012 Jan 30
1
how to sum multiple data entries for the same sampling event?
I'm having trouble with some catch per unit effort data (CPUE, fisheries data). Some of the samples were "retained" and some "unretained," and they are entered as 2 separate entries for the same sampling event (Date and time). I want to calculate the total CPUE (so sum the "retained" and "unretained" number for each sampling event) and am having troubld
2011 Dec 04
1
Polishing my geom_bar for publication
Dear list, I am new with ggplot2 and I have spend quiet some time putting together the following code to create the attached plot. However there's still a few things that I'm having trouble with! I would be grateful if someone can tell me how to fix (1) the colour of my bars into grey scales (2) removing the y-axis (species name) on the right figure to avoid duplication, and (3) fix the
2010 Nov 30
3
pca analysis: extract rotated scores?
Dear all I'm unable to find an example of extracting the rotated scores of a principal components analysis. I can do this easily for the un-rotated version. data(mtcars) .PC <- princomp(~am+carb+cyl+disp+drat+gear+hp+mpg, cor=TRUE, data=mtcars) unclass(loadings(.PC)) # component loadings summary(.PC) # proportions of variance mtcars$PC1 <- .PC$scores[,1] # extract un-rotated scores of
2012 May 19
4
weighted averages for two variables
Hi R users, I have a dataset with multiple variables and i'm trying to weigh average depths for fish species per year by their abundance (CPUE. I have tried the weighted.mean function but as i have two columns for the x value the lenghts differ with the w (CPUE). How do I solve this problem? So far I have tried this: data<-by(allspecies, list(allspecies$Depth, allspecies$Year),
2006 Nov 26
1
GLM and LM singularities
Hi- I'm wrestling with some of my data apparently not being called into a GLM or an LM. I'm looking at factors affecting fish annual catch rates (ie. CPUE) over 30 years. Two of the factors I'm using are sea surface temperature and sea surface temperature anomaly. A small sample of my data is below: CPUE Year Vessel_ID Base_Port Boat_Lgth Planing SST Anomaly 0.127
2007 Dec 07
1
Adding a subset to a glm messes up factors?
Hi everyone, I have a problem with running a glm using a subset of my data. Whenever I choose a subset, in the summary the factors arent shown (as if the variable was a continuous variable). If I dont use subsets then all the factors are shown. I have copied the output from summary for both cases. Thanks for the help, Muri > model<-glm(log(cpue)~year,family=gaussian) Call: glm(formula =
2009 Oct 14
3
currency conversion function?
Dear all Is there any R function that would perform currency conversion using up-to-date exchange rates? I would be looking for a function that allows to download recent exchange rates (say, from Yahoo!) and then use these in converting currencies (say, USD to EUR). I am not sure whether r-sig-finance would be more appropriate, but the (off-)topic feels general enough to me. Thank you Liviu --
2011 Aug 10
3
convert 'list' to 'vector'?
Dear all How does one convert a "non-symmetric" list to a vector? See below: > x <- list() > x[[1]] <- letters[1:5] > x[[2]] <- letters[6:10] > x[[3]] <- letters[11:12] > x [[1]] [1] "a" "b" "c" "d" "e" [[2]] [1] "f" "g" "h" "i" "j" [[3]] [1] "k"