similar to: An apply and rep question

Displaying 20 results from an estimated 1000 matches similar to: "An apply and rep question"

2012 Aug 05
4
find date between two other dates
Hi, I am trying to assign "Season" values to dates depending on when they occur. For example, the following dates would be assigned the following "Season" numbers based on the "season" intervals detailed below in the code: ddate Season 29/12/1998 20:00:33 1 02/01/1999 05:20:44 2 02/01/1999 06:18:36 2 02/02/1999
2006 Jul 07
3
Converting data frame to zoo
Dear list, I know this is really basic question but I just couldn't get anything to work. (I did a R site search with keywords "zoo" and "data frame" but the server timed out on me.) I have a time series which has the following (typical) format, DATE Open High Low Close Volume 01-JAN-2006 5.25 5.25
2006 Aug 25
5
Quickie : unload library
Dear list, I know it must be obvious and I did my homework. (In fact I've RSiteSearched with keyword "remove AND library" but got timed out.(why?)....) How do I unload a library? I don't mean getting ride of it permanently but just to unload it for the time being. A related problem : I have some libraries loaded at startup in .First() which I have in .Rprofile. Now, I exited R
2017 Sep 12
0
show 0 at y axis in xyplot lattice
Hi Maria Rule 1 make sure your data is in the right format dat <- source("G:/1/savedat.txt") > dat $value Location Date Zn2 upper.zn lower.zn 1 upstream 2016-04-27 29.92477 55.59800 13.912207 2 spill 2016-04-27 12.84040 22.07006 6.964934 3 downstream 2016-04-27 22.49673 41.60901 11.739109 4 upstream 2016-06-28 23.98425 45.60219 10.690640 5
2017 Sep 12
2
Σχετ: show 0 at y axis in xyplot lattice
Dear all, Thank you very much for the help. ylim=c(-5, 80) worked.? Regarding the reproducible example, I used dput () and saved the file as txt. It is not the first time that I used this way and normally it works. Because when I try to attach a .csv file with the data, most of the time it doesn't go through.? I will know for the next time.? Many thanks. Regards,Maria ???? 2:11 ?.?.
2017 Sep 12
0
Σχετ: show 0 at y axis in xyplot lattice
Dear Maria The file you attached to your first e-mail did come through but I think some people on the list must have missed it. Michael On 12/09/2017 12:54, Maria Lathouri via R-help wrote: > Dear all, > Thank you very much for the help. ylim=c(-5, 80) worked. > Regarding the reproducible example, I used dput () and saved the file as txt. It is not the first time that I used this way
2010 Jun 16
4
questions on some operators in R
Hi all, I have two questions. Can some one give some help? The first question is regarding the pair of operators "&" and "&&". What is the difference between the two? The second question is regarding "<-" and "=". Usually we use "<-" as the assignment operator. I saw some people use "=". Is there any
2007 Apr 24
4
Size of an object in workspace
Hi folks, Is there a function to show the size of an R object? eg. in Kbytes? Couple months ago Bendix Carstensen posted this marvelous little function lls(), which shows all objects in the current workspace by mode, class and 'size'. This is a wonderful enhancement to the build-in ls() already and I now have it sourced in my Rprofile.site at startup. The only drawback is,
2010 Dec 23
2
problem installing R on ubuntu
Following the official instructions to install R on ubuntu 10.04, I issued this command on the prompt, sudo apt-get install r-base Here is the error msg, Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that
2006 Aug 10
2
day, month, year functions
Hi list, I'm trying to turn a date into something productive. (Not what you may be thinking....) I want three functions so I could take a "date" object and get the day of week, month, and year from it. xx <- as.Date("2006-01-05") month(xx) equal 1 day(xx) equal 5 year(xx) equal 2006 I'm aware of the weekdays() and months() functions in the base package. But
2007 Jun 12
1
Viewing a data object
Dear list, First apologize that this is trivial and just betrays my slothfulness at the keyboard. I'm sick of having to type a long name just to get a glimpse of something. For example, if my data frame is named 'AuroraStochasticRunsJune1.df" and I want to see what the middle looks like, I have to type AuroraStochasticRunsJune1.df[ 400:500, ] And often I'm not even sure rows
2007 Aug 21
1
small issue with densityplot
Hi folks, This is really minor but to someone not familiar with the various tentacles of the lmer package it could be really annoying. I was trying to plot the posterior density of the fixed effect parameters of a lmer model, > hr.mcmc = mcmcsamp(hr.lmer, n=50000) > densityplot(hr.mcmc, plot.points=F) There is this error, "Error in densityplot(hr.mcmc, plot.points = F) : no
2010 Jun 08
2
type conversion with apply or not
Folks, i thought it should be straightforward but after a few hours poking around, I decided it's best to post my question on this list. I have a data frame consisting of a (large) number of date columns, which are read in from a csv file as character string. I want to convert them to Date type. Following is an example, where the first column is of integer type, while the rest are type
2010 Jul 29
1
Crash report: projection pursuit & predict
Folks, The projection pursuit regression function in the base R seems to crash when the optimization level is set to zero, i.e. the initial ridge terms are accepted without refitting. I encountered this problem in an out-of-sample prediction exercise using predict. But further investigation suggests the issue is with the ppr fit and predict just sppeds up the crash. The other optlevels seem to be
2018 Jul 24
2
oddity in transform
The idea is that one wants to write the line of code below in a general way which works the same whether you specify ix as one column or multiple columns but the naming entirely changes when you do this and BOD[, 1] and transform(BOD, X=..., Y=...) or other hard coding solutions still require writing multiple cases. ix <- 1:2 transform(BOD, X = BOD[ix] * seq(6)) On Tue, Jul 24, 2018 at
2018 Jul 23
2
oddity in transform
Note the inconsistency in the names in these two examples. X.Time in the first case and Time.1 in the second case. > transform(BOD, X = BOD[1:2] * seq(6)) Time demand X.Time X.demand 1 1 8.3 1 8.3 2 2 10.3 4 20.6 3 3 19.0 9 57.0 4 4 16.0 16 64.0 5 5 15.6 25 78.0 6 7 19.8 42 118.8 >
2007 Sep 22
1
rsync not running on IA64
I have built rsync on IA64 using Intel's 'icc' compiler and can run the rsync executable interactively but when attempting to run under 'crontab' I get the following error: + /home/horace/mccssmb2/src/rsync-2.6.9/rsync -z --partial -v --progress --recursive --stats --times --links --exclude-from=/project/horace/mcc101/.rsync-EXCLUDE --timeout=1200 /project/horace/mcc101
2009 Sep 28
6
SAS user now converting to R - Help with Transpose
I am just starting to code in R and need some help as I am used to doing this in SAS. I have a dataset that looks like this: Chemical Well1 Well2 Well3 Well4 BOD 13.2 14.2 15.5 14.2 O2 7.8 2.6 3.5 2.4 TURB 10.2 14.6 18.5 17.3 and so on with more chemicals.... I would like to transpose my data so that it looks like this: Chemical WellID Value BOD Well1 13.2 BOD Well2 14.2 BOD Well3 15.5 BOD
2007 Sep 07
3
Delete query in sqldf?
Dear All, Is sqldf equipped with delete queries? I have tried delete queries but with no success. Thanks in advance, Paul
2009 Aug 12
2
Symbolic references - passing variable names into functions
Hello All, I am trying to write a function which would operate on columns of a dataframe specified in parameters passed to that function. f = function(dataf, col1 = "column1", col2 = "column2") { dataf$col1 = dataf$col2 # just as an example } The above, of course, does not work as intended. In some languages one can force evaluation of a variable, and then