Displaying 20 results from an estimated 200 matches similar to: "How to count the nos. in a range?"
2013 Mar 28
6
How to delete Identical columns
Dear R forum
Suppose I have a data.frame
df = data.frame(id = c(1:6), x = c(15, 21, 14, 21, 14, 38), y = c(36, 38, 55, 11, 5, 18), x.1 = c(15, 21, 14, 21, 14, 38), z = c("D", "B", "A", "F", "H", "P"))
> df
id x y x.1 z
1 1 15 36 15 D
2 2 21 38 21 B
3 3 14 55 14 A
4 4 21 11 21 F
5 5 14 5 14 H
6 6 38 18 38 P
2013 Apr 16
3
Splitting the Elements of character vector
Dear R forum
I have a data.frame
df = data.frame(currency_type = c("EURO_o_n", "EURO_o_n", "EURO_1w", "EURO_1w", "USD_o_n", "USD_o_n", "USD_1w", "USD_1w"), rates = c(0.47, 0.475, 0.461, 0.464, 1.21, 1.19, 1.41, 1.43))
currency_type rates
1 EURO_o_n 0.470
2 EURO_o_n 0.475
3 EURO_1w 0.461
2012 Dec 21
2
Can data.frame be saved as image?
Dear R forum
I have one stupid question, but I have no other solution to it in sight?
Suppose some R process creates graphs etc alongwith main output as data.frame e.g
output1 = data.frame(bands = c("A", "B", "C"), results = c(74, 108, 65))
I normally save this output as some csv file.
But I need to save this output as some image (I understand this is weird,
2013 Apr 03
4
Better way of writing R code
Dear R forum,
(Pl note this is not a finance problem)
I have two data.frames as
currency_df = data.frame(current_date = c("3/4/2013", "3/4/2013", "3/4/2013", "3/4/2013"), issue_date = c("27/11/2012", "9/12/2012", "14/01/2013", "28/02/2013"), maturity_date = c("27/04/2013", "3/5/2013",
2012 Jun 20
2
passing function parameters into a 'with' statement to dynamically pick out columns
Hi,
I've built a function to generate plots and would like to be able pass in column names as a parameter. Here's a boiled down version of what I have right now:
pmts <- data.frame(date=c(1,2,3), all=c(5,6,7),maj=c(4,5,6),ind=c(3,4,5))
perc.mktshare <- function(df){
range1 <- floor(min(with(df, 100*ind/all)))
range2 <- ceiling(max(with(df, 100*ind/all)))
2013 Apr 15
6
Sorting data.frame and again sorting within data.frame
Dear R forum,
I have a data.frame as defied below -
df = data.frame(names = c("C", "A", "A", "B", "C", "B", "A", "B", "C"), dates = c("4/15/2013", "4/13/2013", "4/15/2013", "4/13/2013", "4/13/2013", "4/15/2013", "4/14/2013",
2013 Oct 17
4
Subseting a data.frame
Dear Forum,
I have a data frame as
mydat = data.frame(basel_asset_class = c(2, 8, 8 ,8), defa_frequency = c(0.15, 0.07, 0.03, 0.001))
> mydat
basel_asset_class defa_frequency
1 2 0.150
2 8 0.070
3 8 0.030
4 8 0.001
I need to get the subset of this data.frame where no of records for the
2013 Oct 17
4
Subseting a data.frame
Dear Forum,
I have a data frame as
mydat = data.frame(basel_asset_class = c(2, 8, 8 ,8), defa_frequency = c(0.15, 0.07, 0.03, 0.001))
> mydat
basel_asset_class defa_frequency
1 2 0.150
2 8 0.070
3 8 0.030
4 8 0.001
I need to get the subset of this data.frame where no of records for the
2013 Oct 16
1
How to write an error to output
Dear R forum,
The example below is just an indicative one and I have constructed it. My real life data and conditions are different.
I have a data.frame as given below
mydat = data.frame(A = c(19, 20, 19, 19, 19, 18, 16, 18, 19, 20), B = c(19, 20, 20, 19, 20, 18, 19, 18, 17, 16))
if (length(mydat$A) > 10)
{
stop("A has length more than 10")
}else
if (max(mydat$B) > 18)
{
2007 Dec 14
4
rcom close Excel problem
Hello,
I just discovered that I cannot close the Excel application and task
manager shows numerous copies of Excel.exe
I tried both
x$Quit() # shown in the rcom archive
and
x$Exit()
and Excel refuses to die.
Thank you very much.
S.
"You can't kill me, I will not die" Mojo Nixon
I also have a problem with saving. It produces a pop-up dialog and
does
not take my second
2013 Feb 18
2
error: Error in if (is.na(f0$objective)) { : argument is of length zero
Dear all,
I tried running the following syntax but it keeps running for about 4 hours
and then i got the following errors:
Error in if (is.na(f0$objective)) { : argument is of length zero
In addition: Warning message:
In is.na(f0$objective) :
is.na() applied to non-(list or vector) of type 'NULL'
Here is the syntax itself:
library('nloptr')
library('pracma')
#
2006 Jun 29
1
RCOM Package
Hi list,
I just installed the rcom package and tried to read/give out some values
from/to Excel. Altogether it works great... but nevertheless I don't know
how the syntax works or in other words: "Which command needs which
parameters?"
Is there somwhere a manual about this package with good examples? I've read
the Package description... but there are not really good
2013 Apr 17
3
Creating a vector with repeating dates
Dear R forum
I have a data.frame
df = data.frame(dates = c("4/15/2013", "4/14/2013", "4/13/2013", "4/12/2013"), values = c(47, 38, 56, 92))
I need to to create a vector by repeating the dates as
"Current_date", 4/15/2013, 4/14/2013, 4/13/2013, 4/12/2013, "Current_date", 4/15/2013, 4/14/2013, 4/13/2013, 4/12/2013, Current_date,
2013 Apr 26
2
Splitting data.frame and saving to csv files
Dear R Forum,
I have a data.frame as
df = data.frame(date = c("2013-04-15", "2013-04-14", "2013-04-13", "2013-04-12", "2013-04-11"),
ABC_f = c(62.80739769,81.04525895,84.65712455,12.78237251,57.61345256),
LMN_d = c(21.16794336,54.6580401,63.8923307,87.59880367,87.07693716),
XYZ_p = c(55.8885464,94.1358684,84.0089114,98.99746696,64.71083712),
2013 Mar 26
2
Counting various elemnts in a vactor
Dear R forum
I have a vector say as given below
df = c("F", "C", "F", "B", "D", "A", "D", "D", "A", "F", "D", "F", "B", "C")
I need to find
(1) how many times each element occurs? e.g. in above vector F occurs 4 times, C occurs 2 times etc.
(2)
2013 Apr 29
2
Adding elements in data.frame subsets and also subtracting an element from the rest elements in data.frame
Dear R forum
I have a data.frame as
cashflow_df = data.frame(instrument = c("ABC","ABC","ABC","ABC","ABC","ABC","ABC","ABC","ABC","ABC","ABC","ABC","ABC","ABC", "ABC", "PQR", "PQR",
2012 Aug 02
5
IP range
Hi all
Can someone explain me this:
ifcfg-eth0-range1:
ONBOOT="yes"
IPADDR_START="192.168.1.48"
IPADDR_END="192.168.1.55"
CLONENUM_START="1"
Why Bcast is 192.168.1.51 and why Mask is 255.255.255.252 ?
OS: Centos 6.3/64bit
Thanks
Levi
# ifconfig
eth0:1 Link encap:Ethernet HWaddr 00:9C:02:99:FA:00
inet addr:192.168.1.48
2013 Mar 27
1
Archieve of mails from R forum
Dear R helpers,
Everyday I do receive many many mails from R forum and after some period of times, INBOX is filled with numerous mails. At times if for some period of time, I haven't accessed mails, it becomes difficult to keep track of mails and many times simply due to the volume (and owing to the lack of time due to office constraints), I have to simply delete the mails without opening
2013 Apr 25
1
Linear Interpolation : Missing rates
Dear R forum
I have data.frame as
df = data.frame(rate_name = c("USD_1w", "USD_1w", "USD_1w", "USD_1w", "USD_1m", "USD_1m", "USD_1m", "USD_1m", "USD_2m", "USD_2m", "USD_2m", "USD_2m", "GBP_1w", "GBP_1w", "GBP_1w", "GBP_1w",
2015 Jan 11
1
Help with IPv6 /48 block
On 1/10/2015 8:38 PM, Gordon Messmer wrote:
> On 01/10/2015 08:10 PM, F. Mendez wrote:
>> Hello. Yes I confirm...its a /48 (this guys are crazy here at my
>> work...).
>
> It's not crazy, that's the standard deployment for a building. It's
> almost certainly not possible to use all of the addresses in such a
> space, but that's the point. IPv6 is