Displaying 20 results from an estimated 1000 matches similar to: "vlookup in R"
2006 Sep 15
2
prediction interval for new value
Hi,
1. How do I construct 95% prediction interval for new x values, for example - x = 30000?
2. How do I construct 95% confidence interval?
my dataframe is as follows :
>dt
structure(list(y = c(26100000,
60500000, 16200000, 30700000, 70100000, 57700000, 46700000, 8600000,
10000000, 61800000, 30200000, 52200000, 71900000, 55000000, 12700000
), x = c(108000, 136000,
2006 May 23
5
conditional replacement
Hi
How can do this in R.
>df
48
1
35
32
80
If df < 30 then replace it with 30 and else if df > 60 replace it with 60. I have a large dataset so I cant afford to identify indexes and then replace.
Desired o/p:
48
30
35
32
60
Thanx in advance.
Sachin
2010 Feb 22
9
Couldn't find Order with ID=pending_orders
I have a Controller named Orders which has a pending_orders method
which is expected to fetch some records from the database.
If i dont write a route for this method, I get the following error
when i call this method.
Couldn''t find Order with ID=pending_orders
I am using rails 2.3.5, in the previous versions i use to get this
I am not getting whether its new version requirement...
Help
2008 May 13
2
Plotting Frequency Distribution in R
Hi,
How can plot a frequency distribution curve for the following data.
V1 V2
1 1 160.54%
2 1 201.59%
3 1 18.45%
4 1 179.03%
5 1 274.37%
6 1 0.00%
7 1 24.52%
8 1 39.17%
9 3 43.72%
10 1 53.06%
11 1 64.97%
12 1 79.84%
13 1 98.08%
14 1 115.32%
15 1 127.96%
16 1 155.38%
17 1 157.25%
18 1 193.17%
19 1 51.53%
20 15 99.32%
21 1 106.86%
22 1 219.44%
2011 Jun 03
1
VLOOKUP in R - tried everything.
I am attempting to emulate the VLOOKUP function from Excel in R.
I want to compare one column (coll.minus.release) with another
(release.days) to get the number of parasitoid released at that time
(TotalParasitoids).
for example:
coll.minus.release release.days ParasitoidTotal
-12 -266 1700
8 -259 1000
8
2012 Feb 28
4
vlookup type function
Hi
I''m looking for an Excel Vlookup type function in R.
Example:
list <- c(1,2,3,4,5,6,7)
base <- c(2.2,3,5.2)
What I want is, for each number in base, the highest value in list,
which is equal to or less than the number in base
So the results would be:
base ? ? ? ? list
2.2 ?------> 2
3 ? ?------> 3
5.2 ?------> ?5
Thanks for your help!
2006 Jul 14
2
Recreate new dataframe based on condition
Hi,
How can I achieve this in R. Dataset is as follows:
>df
x
1 2
2 4
3 1
4 3
5 3
6 2
structure(list(x = c(2, 4, 1, 3, 3, 2)), .Names = "x", row.names = c("1",
"2", "3", "4", "5", "6"), class = "data.frame")
I want to recreate a new data frame whose rows are sum of (1&2, 3&4, 5&6)
2006 Apr 21
3
Creat new column based on condition
Hi,
How can I accomplish this task in R?
V1
10
20
30
10
10
20
Create a new column V2 such that:
If V1 = 10 then V2 = 4
If V1 = 20 then V2 = 6
V1 = 30 then V2 = 10
So the O/P looks like this
V1 V2
10 4
20 6
30 10
10 4
10 4
20 6
Thanks in advance.
Sachin
2010 Jul 06
4
Adding two files into one and vlookup
I have two files with dates and prices in each. The number of rows in each of
them will differ. How do I create a new file which contains data from both
these files? Cbind and merge are not helpful. For cbind because the rows are
not the same replication occurs. Also if I have similar data how do I write
a vlookup kind of function? I am giving an example below:
Say Price1 file contains the
2007 Oct 22
3
median value dataframe coming from multiple dataframes
Hi all,
I am not a skillful R programmer and has I am handling with large dataframes (about 30000 x 300) I am in need of an efficient function.
I have 4 dataframes with the same dimension. I need to generate other dataframe with the some dimension than the others where in each position it has the median value of the 4 values in the same position coming from the 4 dataframes.
Grateful by your
2006 Jul 06
2
KPSS test
Hi,
Am I interpreting the results properly? Are my conclusions correct?
> KPSS.test(df)
---- ----
KPSS test
---- ----
Null hypotheses: Level stationarity and stationarity around a linear trend.
Alternative hypothesis: Unit root.
----
Statistic for the null hypothesis of
level stationarity: 1.089
Critical values:
0.10 0.05 0.025 0.01
0.347 0.463
2010 May 28
4
vlookup in R?
Hi R-users,
I would like to search for the values of seq that match my rand values. In excel I will use =VLOOKUP(G2,$E$2:$F$32,2). For example, for rand=.262 it will give me approximately seq=120 and rand=0.964293344, seq=460 and etc.
E F G
cdf seq rand
0.00E+00 0 0.262123478
1.56E-03 20 0.964293344
1.55E-02 40 0.494827113
5.30E-02 60
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
2006 Apr 24
1
Handling large dataset & dataframe [Broadcast]
Here's a skeletal example. Embellish as needed:
p <- 5
n <- 300
set.seed(1)
dat <- cbind(rnorm(n), matrix(runif(n * p), n, p))
write.table(dat, file="c:/temp/big.txt", row=FALSE, col=FALSE)
xtx <- matrix(0, p + 1, p + 1)
xty <- numeric(p + 1)
f <- file("c:/temp/big.txt", open="r")
for (i in 1:3) {
x <- matrix(scan(f, nlines=100), 100,
2006 Apr 20
2
Conditional Row Sum
Hi,
How can I accomplish this in R. Example:
R1 R2
3 101
4 102
3 102
18 102
11 101
I want to find Sum(101) = 14 - i.e SUM(R1) where R2 = 101
Sum(102) = 25 - SUM(R2) where R2 = 102
TIA
Sachin
---------------------------------
[[alternative HTML version deleted]]
2006 Jun 26
2
write.table & csv help
Hi,
How can I produce the following output in .csv format using write.table function.
for(i in seq(1:2))
{
df <- rnorm(4, mean=0, sd=1)
write.table(df,"C:/output.csv", append = TRUE, quote = FALSE, sep = ",", row.names = FALSE, col.names = TRUE)
}
Current O/p:
x 0.287816 -0.81803 -0.15231 -0.25849 x 2.26831 0.863174
2006 Apr 24
6
Handling large dataset & dataframe
Hi,
I have a dataset consisting of 350,000 rows and 266 columns. Out of 266 columns 250 are dummy variable columns. I am trying to read this data set into R dataframe object but unable to do it due to memory size limitations (object size created is too large to handle in R). Is there a way to handle such a large dataset in R.
My PC has 1GB of RAM, and 55 GB harddisk space running
2010 May 28
1
something like vlookup in R?
Hi r users,
I would like sort of
cdf seq rand
0.00E+00 0 0.262123478
1.56E-03 20 0.964293344
1.55E-02 40 0.494827113
5.30E-02 60 0.733726005
1.16E-01 80 0.800408948
1.97E-01 100 0.925748466
2.88E-01 120 0.047578356
3.80E-01 140 0.266060366
4.68E-01 160 0.125522629
5.48E-01 180 0.701193274
6.18E-01 200 0.915799432
2006 May 18
1
write.csv + appending output (FILE I/O)
Hi,
How can I write the output to an excel (csv) file without printing row names (i.e without breaks). Here is my code:
library(
fn <- function()
{
q <- c(1,2,3)
write.csv(q,"C:/Temp/op.xls", append = TRUE, row.names = FALSE,quote = FALSE)
}
# Function Call
for(i in 1:3)
{
fn()
}
Present Output :
x 1 2 3 x 1 2
2006 Aug 18
2
dataframe of unequal rows
Hi,
How can I read data of unequal number of observations (rows) as is (i.e. without introducing NA for columns of less observations than the maximum. Example:
A B C D
1 10 1 12
2 10 3 12
3 10 4 12
4 10
5 10
Thanks in advance.
Sachin
---------------------------------
[[alternative HTML version deleted]]